Something like this?
Use the following function for my events to see if someone is using a device or not.
But could also serve your purpose, i think.
It aint tested but should give you a headstart.
You could also include the "parasitic = total - lights - plugs - kitchen" into the function to make it cleaner
Code: Select all
function powerusage(powerplug)
local powerplug = powerplug
local reading
local usage
reading = otherdevices[powerplug]
_,_,usage = string.find(reading, "(.+)")
current_usage = tonumber(reading)
return current_usage
end
commandArray = {}
total = powerusage['total']
lights = powerusage['lights']
kitchen=powerusage['kitchen']
plugs = powerusage['plugs']
parasitic = total - lights - plugs - kitchen
commandArray['UpdateDevice']=tostring(parasitic)
return commandArray
Setup:
- DS923+ Docker
Domoticz Latest Stable
Mosquitto / ZwaveJSUI @ Aeotec Z-Stick Gen5+ / PiHole Unbound
P1 USB Gas/Power, HW watermeter
- A lot of Zwave switches, contacts, plugs, smoke/Co2 ect
- DiY 7.5kWh Solar Storage @
GitHuB