Trigger on "last updated"

Moderator: leecollings

Post Reply
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Trigger on "last updated"

Post by domovincent »

Hi all,
I noticed that Blockly doesn’t seem to expose a device’s “last updated” value. Is that intentional, or would it be acceptable to add a Blockly block for this?

For example, it would make rules like this possible:
If the temperature sensor has not been updated for more than 30 minutes, send a notification.
I’m happy to look into implementing this if it fits with the project’s direction.
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Trigger on "last updated"

Post by waltervl »

This is a bad example as you do not need blockly (or any other scripting for this ) ;-)
Just use the Notification button on the device widget, it can notify when sensors have not been updated for x time.
See https://wiki.domoticz.com/Managing_Devi ... ifications
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Trigger on "last updated"

Post by domovincent »

Good point. I wanted to keep the discussion clean, but in doing so used an example that is specifically solved by the UI itself.

Let me provide you with one that I've written a script for: I have a temperamental piece of hardware that just crashes every few weeks/months (steinel IS140-2). It's connected to a switch that I simply turn off, and on again in that case. Problem solved. I'd live to be able to do that from within Domoticz (using blockly) instead of writing scripts, either within or outside of domoticz.
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Trigger on "last updated"

Post by waltervl »

Unfortunately not supported by Blockly. Writing dzvents scripts is in latest stable 2026.2 very easy as it has now a wizard, almost as simple as Blockly. Give it a try.
Screenshot_20260614-204310_Firefox.png
Screenshot_20260614-204310_Firefox.png (253.75 KiB) Viewed 749 times
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 7021
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2026.3
Location: NL
Contact:

Re: Trigger on "last updated"

Post by waltervl »

By the way if a hardware gateway crashes you can also try the hardware gateway timeout option on the hardware gateway. It will restart the gateway when it hasnt updates its Domoticz devices for x time.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
domovincent
Posts: 30
Joined: Friday 18 March 2022 13:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Trigger on "last updated"

Post by domovincent »

Thanks for that, I will give the wizard a go.
As for the specific issue, it's not a hardware gateway. Indeed, that one has a restart option.

I guess this is more about making blockly a bit more complete.
I'm going to see if there's a light weight way to add this, if that's okay.
Opened issue https://github.com/domoticz/domoticz/issues/6853 to track it
Domoticz (RPI 5), Z-Wave, 433, MQTT, ANWB-energy. Happy user since 2017
Post Reply