I would like to know if it was possible in Dzvent to have a check of the widget domoticz and applied to the light the command corresponding to the status of the widget domoticz because of times a light and lit following a breakdown of electricity and I would like that domoticz turn off the light if this one and I use a lua script that I found but I would like a Dzvent
Any help to write the Dzvent would be welcome thank you
Dzvent
Every 2 mins
Check domoticz status (off)
check light bulb (on)
Command off
commandArray = {}
--recupere les minutes
time=os.time()
minutes=tonumber(os.date('%M',time))
hours=tonumber(os.date('%H',time))
print('!*!*!*!*!*!*!*!*!Lancement du check à '..hours..'h'..minutes)
-------Toutes les 15 minutes
------------------------------------------------------------------------
if( (minutes==5) or (minutes==10) or (minutes==15) or (minutes==20) or (minutes==25) or (minutes==30) or (minutes==35) or (minutes==40) or (minutes==45) or (minutes==50) or (minutes==55) ) then
-- Put your script code here that shall run every 5 minutes
--------Renforcement des envois de signal-------------------------------------
------------------------------------------------------------------------------
print('check de tous les materiels rfxcom (sans retour d\'etat)');
local check={}
--Chauffage
check['0']='SAM'
--Parcours le Tableau
for key, valeur in pairs(check) do
print ('CHECK : '..valeur.. ' -> ' ..otherdevices[valeur])
commandArray[valeur]=otherdevices[valeur]
end
--------FIN Renforcement des envois de signal-------------------------------------
------------------------------------------------------------------------------
end
return commandArray
Hydci wrote: ↑Friday 19 July 2019 19:40
Dzvent
Every 2 mins
Check domoticz status (off)
check light bulb (on)
Command off
My understanding from your Lua script is that you want to resend the current state of all switch devices.
so if a device.state == "On" , you want to send device.switchOn() and vice versa.
Hello, that's fine you understand my request unfortunately I do not know how to take it I would like to do that if the widget says off and the light on and then turn it off if possible
Hydci wrote: ↑Sunday 21 July 2019 11:31
Hello, that's fine you understand my request unfortunately I do not know how to take it I would like to do that if the widget says off and the light on and then turn it off if possible
I don't know how to do that either. Below script just resends the current state of switch like devices.