Hi, i might have a suggestion (that was probably mentioned or "thought" about). I was just looking at the examples again (looking for inspiration
) and I noticed example that checks if a switch in gui is "on" or 'off" for the "is_active" part. from example "only run script when button pressed.lua"
Code: Select all
active = function(domoticz)
return (domoticz.devices['script_blabla'].state == 'On')
end,
I also noticed there is persistant storage now (awesome feature btw!), so I had an idea about combining it maybe in order to gain performance for "active" parameter by caching switch state?
F.eks. we would define which switches are "script controll", either by name or id, and then in the "active" logic it would be enought to read "is_active" state from the memory rather then checking for the devices all the time. When switch state changes, it is being re-read and cached again in persistant storage (and maybe cached every 30mins for synchronisation improvement).
But it could be that benefits are zero to none and it would just complicate functionality (not to mention falling out of sync etc...)
But just a thought
Raspberry Pi 2 B - MySensors (dimmers, switches, motion, temperature, lux, humidity sensors)
zWave (220v switches)
various 433 via RFLink