I’m using a HA setup, which is somehow restriced concerning how I can access the system and therefore, I only check recorded values once I’m sitting in front of a dedicated PC.
Last week, something happened and the HA stopped recording temperature values and no one noticed that, because recently no one has been using the dedicated PC.
Therefore my question is: is there something already availabe to e.g. write a log and to put this one to a samba share (which I could check from another PC). Or is there an idea existing, concerning how this isolated system could make itself heard?
One way to detect if a sensor’s value is stale (i.e. has not changed for a long time) is to compare the entity’s last_changed to the current time. If it’s more than some threshold value, like 30 minutes, that means the entity’s value hasn’t changed in the past half-hour.
You can create an automation with a Template Trigger that triggers when the monitored temperature sensor is stale. The action can be whatever you want. It can log the incident to a file, notify you, do both and more. In the example below it simply posts a notification to all notification services you have configured.
alias: example abc123
trigger:
- platform: template
value_template: "{{ now() - states.sensor.temperature.last_changed >= timedelta (minutes=30) }}"
action:
- service: notify.notify
data:
title: Stale Temperature
message: "{{ now().timestamp() | timestamp_local }} Value unchanged for the past 30 minutes."
Thank you both for your answer. The issue is still that the system is isolated, so it cannot simply send me a notification on my mobile phone or similar actions. Therefore my idea was to log those issues somewhere into a file placed in a shared folder. Is there a well known way to do that?
You can use the File integration to send notifications to a file.
The file platform allows you to store notifications from Home Assistant as a file.
If you want the file to reside not on the host machine but a shared Samba drive on the network, you will need to mount it (using your Linux skills). Search online for “linux mount samba drive”.