That would be helpful, thanksbertbigb wrote:I do that with something like:LouiS22 wrote:Is it possible to control groups (for ex: 4 bulbs simultaneously) with the script posted on domoticz wiki?
Then you call such a function like:Code: Select all
--YEELIGHT -- port number for the yeelights PORT = '55443' --IP adresses of the bulbs involved, local IPs = {'192.168.2.80', '192.168.2.81', '192.168.2.82', '192.168.2.83', '192.168.2.84', '192.168.2.85'} function YeelightOff() --command Yeelight Off for n,IP in pairs(IPs) do runcommandYeelight = "sudo echo -ne '{\"id\":"..n..",\"method\":\"set_power\", \"params\":[\"off\", \"smooth\", 500]}\\r\\n' | /opt/bin/nc -w1 " ..IP.." " ..PORT..""; os.execute(runcommandYeelight) end end function YeelightTemperature(WhiteYee, DimYee, DurationYee) --Yeelight part for n,IP in pairs(IPs) do --runcommandYeelight = "sudo echo -ne '{\"id\":1,\"method\":\"set_scene\",\"params\":[\"ct\", " .. WhiteYee .. "," .. DimYee .. "]}\\r\\n' | nc -w1 " ..IP.." " ..PORT..""; --runcommandYeelight = "sudo echo -ne '{\"id\":1,\"method\":\"set_ct_abx\",\"params\":[" .. WhiteYee .. ",\"smooth\","..DurationYee.."]}\\r\\n' | nc -w1 " ..IP.." " ..PORT..""; runcommandYeelight ="sudo echo -ne '{\"id\":"..n..",\"method\":\"start_cf\",\"params\":[1,1,\"" ..DurationYee..",2,"..WhiteYee..","..DimYee.."\"]}\\r\\n' | /opt/bin/nc -w1 " ..IP.." " ..PORT..""; if debug then print(runcommandYeelight) end os.execute(runcommandYeelight) end end
YeelightOff() or something like YeelightTemperature(WhiteYeeValue, DimYeeValue, DurationYeeValue)
The function will run for all IP's in the list IPs
Hope this helps you.
If you want i can share the complete scripts if that is more helpful
