Outdoor temperature sensor not triggering automation as expected

I am trying to use the outdoor temperature as one of the triggers to my fireplace on/off routine. Basically, I have time-based, location-based and temperature-based triggers on the same automations that result in my fireplace turning on/off during the day.

I have configured the Open Weather integration and the current temperature is being updated as expected. I set a “numeric state” trigger on “sensor.openweather_temperature” for when it drops below 2 degrees (sensor is in Celsius):

platform: numeric_state
entity_id: sensor.openweather_temperature
below: ‘2’

The temperature crossed the threshold this evening but the trigger did not fire. Any idea why?

Thanks!

Ricky

Post the entire automation containing the Numeric State Trigger.

This probably isn’t the cleanest automation, I’m a new user of HA. I am trying to limit the number of automations as well so I have lots of triggers and lots of conditions to control what tells the fireplace to turn on and what must be true in order for that to happen:

alias: Fireplace On
description: ''
trigger:
  - platform: time
    at: '05:00:00'
  - platform: state
    entity_id: group.family
    from: not_home
    to: home
  - platform: numeric_state
    entity_id: sensor.openweatherdetailed_temperature
    below: '2'
condition:
  - condition: numeric_state
    entity_id: sensor.openweatherdetailed_temperature
    below: '2'
  - condition: state
    entity_id: group.family
    state: home
  - condition: time
    after: '04:59:00'
    before: '21:31:00'
  - condition: device
    device_id: 3a934fde44e100dbab83f72180951938
    domain: climate
    entity_id: climate.fireplace
    type: is_hvac_mode
    hvac_mode: 'off'
action:
  - device_id: 3a934fde44e100dbab83f72180951938
    domain: climate
    entity_id: climate.fireplace
    type: set_hvac_mode
    hvac_mode: heat_cool
mode: single

Trigger 1 is at 5 AM and conditions 1 and 2 are meant to ensure that the family is home and that the local temp is below 2 degrees

Trigger 2 is if we come home and conditions 1 and 3 are meant to ensure that it falls in the right schedule and that the temperature is below 2 degrees

Trigger 3 (the one that isn’t firing) is to turn on the fireplace and conditions 2 and 3 ensure that the family is home and that it falls in the schedule

Condition 4 is just to avoid spamming my device with on commands if the fireplace is already on

Answering that question would have been guesswork without seeing the actual automation.

When the temperature crossed the threshold, it also met the requirements of the first condition. However, there are three more conditions. Were the other three conditions also met?

If you are not sure, you can check the automation’s trace. For more information refer to Troubleshooting Automations.

Full automation is above.

I just noticed that the start time trigger didn’t even activate this morning either. The last trigger was at 5:07 AM yesterday (the 2nd) when the temperature went above 2 degrees and the fireplace shut off. I was using the Environment Canada sensors until they stopped updating and I decided to switch to Open Wearher.

Not really sure what’s going on. What could cause a basic time trigger to not even fire?

I should also mention that I know it did not trigger since it did not create a trace at the time it should have.

Use the trace, Luke.

… and if you have no trace, ensure the automation has an id option. Automations created via the Automation Editor typically include one (although you won’t see it in the UI). Automations created with a text editor require that you add it.

If you look at the automation’s title in Configuration > Automations and see “Never” instead of a recent date next to it, there’ll be no trace available because it has never been triggered.

If even the Time Trigger isn’t working, you need to check if the Automation integration was loaded. If you introduce an error in an automation and then reboot the host, on startup Home Assistant will refuse to load automations because of the uncorrected error (none of the automations will work). Check the log for errors reporting problems encountered on startup.

I just added ids for the Triggers.

I do see never on some of them, but the automations are loading just fine since I have others that are working properly.

I will wait to see if the time trigger works tomorrow. If not, then I’ll try to recreate the automation. Maybe I have some ghosts in the server?

The id I described above is for the automation, not the trigger(s).

As explained, if you have composed the automation with the Automation Editor, the automation is automatically assigned an id with a unique value (but it’s not displayed in the UI).

Adding an id to a trigger serves an entirely different purpose (unrelated to traces).

If other automations work then, yes, the Automation integration is loaded.

If you wish to test this automation now, go to Developer Tools > States, select sensor.openweatherdetailed_temperature so that its details appear at the top of the page. Change the sensor’s value to something greater than 2 (unless it’s already above 2) and then click the Set State button. Then change the value to below 2 and click Set State. You have effectively simulated a state-change that should trigger the automation’s Numeric State Trigger and produce a trace.

If it fails to trigger, something is seriously wrong here.

Ok I set the temp to 5 C then down to -1 C and both triggered the two different automations (which didn’t fire because other conditions weren’t met but a trace was generated). Seems like it’s working oddly enough. I will confirm if everything is ok tomorrow at 5 AM when it should be less than 2 C and the fireplace should start!

Played around with the automations to have it fire just recently (based on time trigger) and it worked. I didn’t really change anything so I’m not sure what was wrong this morning and when the temperature crossed the threshold earlier… Are automations sometimes buggy?

All I can say is that I have been using Home Assistant for just over three years and I have never experienced the problems you have described. :man_shrugging:

Worked this morning as expected. Really have no idea what the issue was.