10.08.2020, 12:48
(This post was last modified: 10.08.2020, 12:54 by Erwin van der Zwart.)
Hi,
Yes you can do that, in the user.hue there are already 2 functions to use for group commands, getHueGroups() and sendToGroup()
First you have to get the groups by this command:
When you know the group ID you can control it with:
BR,
Erwin
Yes you can do that, in the user.hue there are already 2 functions to use for group commands, getHueGroups() and sendToGroup()
First you have to get the groups by this command:
Code:
--Get all group information
require('user.hue')
-- get all lights from bridge
result = getHueGroups()
log(result)
Code:
require('user.hue')
value = event.getvalue()
group_id = 1 -- change this ID to your actual group, see getHueGroups() result
if value == true then
body_msg = '{"on":true}'
sendToGroup(group_id,body_msg)
else
body_msg = '{"on":false}'
sendToGroup(group_id,body_msg)
end
Erwin