hscholing wrote: ↑Monday 29 July 2019 20:59
..when using this remote to turn my lights on (so including the one that triggers the Blockly script) the Blockly script is not activated. I can see that the switch for this light is on in my dashboard, but no Blockly response. This is the same when turning the specific HUE light off. Can somebody telling my if I'm doing something wrong and how to fix this?
You don't do anything wrong but the way the Hue light state change is send to domoticz is not picked up by Blockly. If you do want this functionality you will have to switch to dzVents or classic domoticz Lua.
in dzVents it could look like
Code: Select all
local lights = { 'IKEA-1','IKEA-2','IKEA-3', 'Hue-1', 'Hue-2', 'Hue-3' }
return
{
on =
{
devices = lights,
},
execute = function(dz, item)
local IKEA_group = { 'IKEA-1','IKEA-2','IKEA-3' }
local Hue_group = {'Hue-1', 'Hue-2', 'Hue-3' }
dz.log('Device ' .. item.name .. ' was switched ' .. item.state , dz.LOG_INFO)
local function inTable (table, key)
for _, name in ipairs(table) do
if name == key then return true end
end
end
if item.active then
if inTable(IKEA_group, item.name) then
for _, name in ipairs(Hue_group) do
dz.devices(name).switchOn().silent()
end
else
for _, name in ipairs(IKEA_group) do
dz.devices(name).switchOn().silent()
end
end
end
end
}
When not yet familiar with dzVents please start with reading
Get started Before implementing. Special attention please for
"In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>>
dzVents wiki