Back in the days when I was programming complex industrial automation systems, an essential element was the watchdog functionality, which, depending on the controlling device, was built many ways, but typically e.g. just calling a function with some paramters like output, input etc)
The purpose of the watchdog was to monitor, that things happen as they should. E.g. when firing up a valve that moves a cylinder, it was clear to expect that the piston rod reaches the end sensor in few seconds and if it did not, there obviously was something wrong, which caused some actions to be made. The conditions did not need to be physical sensor, but any variables or “states”
Basic sh*t.
Now, how to easiest do the similar in HA? I have tried to set up an automation in graphical ui, which goes OK with setrting up e.g condition, but in the end when you have to set the action, there just is nothing suitable. In “Call servive” there seems to be no service that I could use. I cannot configure systen to fire an event without warning message, nor a device or anything else. There seems to be “notify” service, but I have no idea, what should be a target where to send the notifications.
If the case is, like mine is to monitor that e.g. some sensor is in “on” state for too long, it throws a message to UI, is there a SIMPLE way just e.g. use an event, that you soecify there on the fly and use it later as you need? E.g i have the following custom panel the visibility is controlled via saensor value, but what i need it to be is some variable etc.
- background_color: '#A81419'
entity: binary_sensor.xxx_door_sensor
font_color: '#fff'
hide_condition: |
[[[ return entity.state === "off" ]]]
icon: mdi:door-open
large: false
title: XXX door open!
type: custom:button-text-card
Or do we always need to go specifying some templating in configuration.yaml, use automations, perhaps together with scripts etc, which is very work-intensive to say the least for this kind of basic automation task.
To ask a concrete question, what is the easisest way of monitoring a sensor (or any else “variable” or “state”) and if it stays in monitored state a specified time, it throws a message to UI?