I have an automation to check status of my water and gas-meter. The meter is from Smartgateways. The automation checks the sensor gasmeter_lastchanged. This keeps track of changes received from MQTT. Approx. every 30 seconds an update is received over MQTT.
So I want a notification when this sensor is above 30 seconds for over 15 minutes so I know that I need to check.
I created this YAML code:
alias: Gasmeter alive check
description: Check of gasmeter nog live is en na 15 minuten een mail
triggers:
- entity_id:
- sensor.gasmeter_lastchanged
for:
hours: 0
minutes: 15
seconds: 0
above: 30
trigger: numeric_state
conditions: []
actions:
- metadata: {}
data:
message: >-
Gasmeter al meer dan 15 minuten geen waarde doorgegeven. Check status
van device op IP: 192.168.xxx.xxx
title: Gasmeter not reporting
action: notify.email_1
- action: notify.persistent_notification
metadata: {}
data:
message: >-
Gasmeter al meer dan 15 minuten geen waarde doorgegeven. Check status
van device op IP: 192.168.xxx.xxx
title: Gasmeter not reporting
mode: single
sensor was down for over a day a few days ago and no notification send. Tried to test by setting value to above 5 seconds to trigger notification. This did not work too. Have used the Automation Editor to build this one.
What am I not doing right to get this working. Thank you for the support.
Hi, have you checked the traces from that automation?
Also, there is no use to mask that IP address since it’s a private/LAN IP which a lot of users will be using too and those are not reachable from the internet.
Yes checked the traces there were none. When I run it as test it only shows traces of the notification. Yeah I know RFC1918 IP’s but still just a habit
Will check the scripts later (depending on the weather) this weekend.
Looked in developer tools no reference to the trigger.
Will test later more complicated then hoped for. I am used to ‘Blocky’ which most likely is not as powerful but I did understand what is going on
3 days ago it was triggered but no notification or mail. Strange.
When I set the trigger to above 5 seconds and remove the for 15 minutes, I should receive after within a minute a notification.