Hello people. I made this automation to send me a message when the temperature of a sensor is below 28 thanks. This happened due to a broken heater and I’m at 23 degrees but it never ran. Could you tell me if it’s wrong? Thank you
- alias: Aviso temperatura minima sonda 2
description: ""
initial_state: true
trigger:
- platform: numeric_state
entity_id: sensor.temperatura_sump
below: 28
for:
minutes: 5
condition:
- condition: numeric_state
entity_id: sensor.temperatura_sump
below: 28
action:
- service: notify.mobile_app_sm_g973f
data:
title: Importante
message: "La temperatura de la sonda 2 esta por debajo de los 28°"
When you created the automation, was the value of sensor.temperatura_sumpalready below28?
If it was already below 28 then that explains why the automation hasn’t triggered yet.
The Numeric State Trigger will trigger only when it detects the value crossing the threshold, so at the moment the temperature decreases from above 28 to below 28.
In addition, the automation’s Numeric State Condition is superfluous. It checks if the temperature is below 28 but that’s exactly what the Numeric State Trigger is monitoring.
I have doubts if the temperature was below because the NUC image started to fail and I reinstalled it. It may have happened just then. The other question is whether an automation with an error in the automations file can corrupt all the others? First I wanted to make sure that it was well written and had no errors.
Depends on how you created the automation and what kind of error.
If you create an automation in the gui, and it contains serious syntax errors so it cannot be parsed, it won’t save so it cannot corrupt anything else. It just won’t accept the new automation. It is really hard to create one that cannot be parsed in the gui unless you write a bit in yaml mode here anyway.
If you edit automations.yaml outside HA and reload it, and it cannot be parsed that is a different matter. It may very well be other automations won’t get loaded either until you fix the file. I wouldn’t call it corrupt though, but other automations could be no longer there for a while.
If you call automations in other automations (you shouldn’t: that what scripts are for) you could in a way have corrupted the calling automation, as calling a missing automation fails and aborts the calling automation too.
It’s fine, even with the needless Numeric State Condition.
FWIW, when someone on the forum asks why their automation’s Numeric State Trigger failed to trigger is due to, in almost all cases, a misunderstanding of how that trigger works. They don’t realize it triggers only when the value crosses the threshold. In your case, after crossing the threshold, it must also remain below the threshold for at least 5 minutes before it triggers.
I’m not following your explanation of the sensor’s temperature and its relation to re-installing Home Assistant.
Forgiveness. The translation is a bit complicated to express. The image of ha was corrupted and perhaps the download occurred while home assistant was not working. For everything I told you, I wanted to know if the automation was good or if it was poorly thought out. If I remove the numerical state, how would the automation be written?