Can status times of switches be used in Blocky?

Moderator: leecollings

Post Reply
HoogendoornJH
Posts: 37
Joined: Wednesday 31 July 2019 16:43
Target OS: Windows
Domoticz version: 12736
Location: Netherlands
Contact:

Can status times of switches be used in Blocky?

Post by HoogendoornJH »

The on/off times of switches are being monitored (see picture below). Can these times and status be queried, stored in variables and be used in Blocky? And if so, how?

schakeltijd.jpg
schakeltijd.jpg (125.96 KiB) Viewed 1416 times
Aeotec Z-wave Gen5, RFXtrx433xl, Philips Hue Bridge, Davies Weather Station, Honeywell HGI/S80, AurAir CO2
User avatar
boum
Posts: 135
Joined: Friday 18 January 2019 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: France
Contact:

Re: Can status times of switches be used in Blocky?

Post by boum »

No.

Even in classic Lua scripting or dzVents, you'll only have access to lastUpdate. You have to query the database to go deeper.
willemd
Posts: 628
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Can status times of switches be used in Blocky?

Post by willemd »

I use DZvents and track the switch-on and switch-off times of switches in my boiler for hot water and central heating. In that way I am calcuating the total time hot water and/or central heating was used (with lastUpdate.secondsAgo). Those seconds are then used later to classify the gas usage into gas for hot water and gas for heating.

So, yes it is possible in DzVents. Just check lastUpdate.secondsAgo at the time of switch-off and you get the time since the previous switch-on.

If you want to add all those seconds together during a day or an hour for example, you can store the result of each lastUpdate.secondsAgo in persistent variables ( or you could use a separate device).

I am not sure how to do this in blockly or whether this is even possible.
HoogendoornJH
Posts: 37
Joined: Wednesday 31 July 2019 16:43
Target OS: Windows
Domoticz version: 12736
Location: Netherlands
Contact:

Re: Can status times of switches be used in Blocky?

Post by HoogendoornJH »

Thanks for your reply. I've been meaning to delve into LUA or dzVents for a long time, but unfortunately it hasn't happened so far.
Aeotec Z-wave Gen5, RFXtrx433xl, Philips Hue Bridge, Davies Weather Station, Honeywell HGI/S80, AurAir CO2
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests