Thanks @tom_l for the reply. Unfortunately it didn’t work. I tried this adding an automation from the Automations page, I first added the notification using the UI, then went to the YAML editor to paste your code and edit the entity_id (I changed the hours to minutes just to test it faster):
alias: Notify Unchanged Living Temp X
description: ""
trigger:
- platform: state
entity_id: sensor.ble_temperature_living_temp_x
to:
for:
minutes: 1
condition: []
action:
- service: notify.mobile_app_pixel_6a
data:
message: Living Temp X Unchanged
mode: single
After saving it, if I enter again to the automation editor it says “to: null”. And even though the sensor updates its temperature every 5 minutes, the automation was never triggered.
In the meantime, I explored more and ended up finding something similar to what @MaxK said.
It worked fine but I was worried about copying and pasting many times.
When using WebCoRE, I would create automations in ways that were easily “scalable” and editable. So I created a Node-RED flow (with the help of ChatGPT for the Function node) that has all the device IDs listed in the inject node (which executes every 1 hour), a Function node that sends these deviceIDs in separate messages, and a Current State node that checks the timeSinceChanged value.
[{"id":"9c7389cccd519965","type":"function","z":"a3a03ad94d09ee01","name":"function 1","func":"var entityIds = msg.payload.split(\",\");\nvar i = 0;\n\nfunction sendEntity() {\n var entityId = entityIds[i];\n var newMsg = { payload: entityId };\n node.send(newMsg);\n i++;\n if (i < entityIds.length) {\n setTimeout(sendEntity, 2000);\n }\n}\nsendEntity();","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":920,"wires":[["4af6293b4d8ac84a"]]},{"id":"3883cbe19fe60980","type":"inject","z":"a3a03ad94d09ee01","name":"","props":[{"p":"payload"}],"repeat":"3600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"sensor.ble_temperature_bedroom_temp_x,sensor.ble_temperature_living_temp_x,sensor.ble_temperature_kitchen_temp_x,sensor.ble_temperature_study_temp_x,sensor.bathroom_temp_s_temperature,sensor.living_temp_s_temperature,sensor.water_leak_temperature","payloadType":"str","x":150,"y":920,"wires":[["9c7389cccd519965"]]},{"id":"866ee38723b25939","type":"link out","z":"a3a03ad94d09ee01","name":"link out 11","mode":"link","links":["3357c1ef43290083"],"x":705,"y":920,"wires":[]},{"id":"4af6293b4d8ac84a","type":"api-current-state","z":"a3a03ad94d09ee01","name":"","server":"8a86b0cc.b2bac","version":3,"outputs":2,"halt_if":"$entity().timeSinceChangedMs > 3600000","halt_if_type":"jsonata","halt_if_compare":"jsonata","entity_id":"{{payload}}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":530,"y":920,"wires":[["866ee38723b25939"],[]]},{"id":"8a86b0cc.b2bac","type":"server","name":"Home Assistant R","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
So this starts another question:
Is it problematic in any way to have these automations running inside Node-RED? (Instead of HA automations). I don’t plan to do things that are much more complex. Do I need to worry about performance or any other issues? I understand that Node-RED is a third party and then this could mean trouble at some point, but apart from that, is there any reason to worry?
Thanks,
Rodrigo