Page 1 of 1
give philips hue light a color
Posted: Sunday 20 October 2019 15:11
by Frankseijts
Hello,
this is my first day of dzVents script and after some ours i did get my lamp on and of but now i want color to
this is my script
Code: Select all
return {
active = true,
on = {
timer = {
'at 15:00-15:01',
},
},
execute = function(domoticz, dummy)
domoticz.devices('Hue color lamp 3').toggleSwitch()
domoticz.myLight('Hue color lamp 3').setRGB(124, 233, 11)
end
}
can some one help me
Re: give philips hue light a color
Posted: Sunday 20 October 2019 21:43
by waaren
Frankseijts wrote: ↑Sunday 20 October 2019 15:11
I did get my lamp on and of but now i want color to
can some one help me
I don't understand why you used myLight but maybe this is what you intended ?
Code: Select all
return {
active = true,
on = {
timer = {
'at 15:00-15:01',
},
},
execute = function(domoticz)
myHueLamp = .devices('Hue color lamp 3')
myHueLamp.toggleSwitch()
myHueLamp.setRGB(124, 233, 11)
end
}
If you start with a new script and it is not working as expected it can help to switch on debug loggging in the script and look at the log what happens during execiuion.
It would then look like
Code: Select all
return {
active = true,
on = {
timer = {
'at 15:00-15:01',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = "Hue light test",
},
execute = function(domoticz)
myHueLamp = .devices('Hue color lamp 3')
myHueLamp.toggleSwitch()
myHueLamp.setRGB(124, 233, 11)
end
}
Re: give philips hue light a color
Posted: Monday 21 October 2019 18:56
by Frankseijts
Thank jou very much,
I did chose mylight because wen i was seaching the web to find out how i can get color to my lamp.
i was reading that in a new update of dzVents mylight was the trigger to set collor
but i wil look at the log wat happend wit the logging in the script
Re: give philips hue light a color
Posted: Monday 21 October 2019 21:04
by Frankseijts
i did use the script
but this is the error what i get
2019-10-21 21:01:00.492 Error: dzVents: Error: (2.4.29) Hue light test: ...omoticz/scripts/dzVents/generated_scripts/Hal - Hue3.lua:16: attempt to call global 'devices' (a nil value)
i attempt to find the problem but i didnt find it
Re: give philips hue light a color
Posted: Monday 21 October 2019 22:29
by waaren
Frankseijts wrote: ↑Monday 21 October 2019 21:04
i did use the script
but this is the error what i get
2019-10-21 21:01:00.492 Error: dzVents: Error: (2.4.29) Hue light test: ...omoticz/scripts/dzVents/generated_scripts/Hal - Hue3.lua:16: attempt to call global 'devices' (a nil value)
i attempt to find the problem but i didnt find it

My bad. domoticz fell off in my Copy/paste action. new one with domoticz included
Code: Select all
return {
active = true,
on = {
timer = {
'at 15:00-15:01',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = "Hue light test",
},
execute = function(domoticz)
myHueLamp = domoticz.devices('Hue color lamp 3')
myHueLamp.toggleSwitch()
myHueLamp.setRGB(124, 233, 11)
end
}
Re: give philips hue light a color
Posted: Tuesday 22 October 2019 21:10
by Frankseijts
Thanks waaren
this was good
but now i was thinken lets turn on a group
so i replaced devices into groups and Hue collor lamp 3 into Hal ( the hue color lamp 3 is in the group hal)
but the i did get this massage
Hue3.lua:18: attempt to call field 'toggleSwitch
so do i have to do something with toggleSwitch
on the wiki page i read this
groups = { ...}
A list of one or more group-names or indexes. The same rules as devices apply.
so i was thinking how hard can i be :0)
Re: give philips hue light a color
Posted: Wednesday 23 October 2019 19:48
by waaren
Frankseijts wrote: ↑Tuesday 22 October 2019 21:10
on the wiki page i read this
groups = { ...}
A list of one or more group-names or indexes. The same rules as devices apply.
so i was thinking how hard can i be :0)
I guess you need to read a bit further on the
wiki page. You will find which methods are available for group objects.
Re: give philips hue light a color
Posted: Thursday 24 October 2019 20:47
by Frankseijts
Thanks waaren
i had to change Domoticz.Groups('hal') into Domoticz.groups('hal')