Temperature automation doesn't work

Hi guys,

I created this automation but it doesn’t trigger at all.
I can’t figure why and maybe someone else will give me an solution/ideea.

alias: "Piscina: Anti-inghet piscina"
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.senzor_temperatura_ext_actual_temperature
    below: 0
    id: temperatura_este_sub_0_grade
    value_template: ""
    attribute: value_state
  - platform: numeric_state
    entity_id: sensor.senzor_temperatura_ext_actual_temperature
    id: temperatura_este_peste_2_grade
    above: 2
    value_template: ""
    attribute: value_state
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: temperatura_este_sub_0_grade
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id:
                - switch.modul_curte_8_canale_pompa_filtrare_ch10
                - switch.hmip_ps_000218a9abbcbe
          - service: notify.mobile_app_s_galaxy_s22_ultra
            data:
              message: Risc de inghet, verifica piscina!
      - conditions:
          - condition: trigger
            id: temperatura_este_peste_2_grade
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id:
                - switch.modul_curte_8_canale_pompa_filtrare_ch10
                - switch.hmip_ps_000218a9abbcbe
mode: restart

I think because thats one trigger, you’re asking it to fire when the temperature is both below zero AND above 2, which is impossible.

EDIT:- misread that… it is 2 triggers.

What does the entity history say?

Probably this that should be deleted.
Not sure but if you include an image of the sensor from developer tools then we can know for sure.

1 Like

This or something elese?

state_class: measurement
interface_id: RaspberryMatic-HmIP-RF
address: 0010DBE99234A5:1
model: HmIP-STHO-A
entity_type: generic
parameter: ACTUAL_TEMPERATURE
function: null
value_state: valid
unit_of_measurement: °C
device_class: temperature
friendly_name: Senzor temperatura ext. Actual

Just online status and when I triggered it with “Run”.

Yes.
Remove the attributes lines.

Using dev tools, what is this sensors state value:-

sensor.senzor_temperatura_ext_actual_temperature

And does the history of that sensors state show it going above and below the thresholds you’ve set ?

-5.5

Yes, the sensor works normally.

And it should work?

I will give it a try. I will bring the sensor inside my house to read above 0°C and the I will move it out again to test.

Yes that should work.
But you could also look at the generic thermostat.

Removed the attributes line and no luck. It’s like this automation doesn’t exist…

There is two lines with attribute.
What does the trace say?

Yes. I removed them both!

Nothing at all. Just when I manually triggered it.

You cannot use the “Run” button to test automations that rely on trigger ids or trigger variables. That data is not generated when you press the “Run” button.

Test Method for automations with trigger based variables/conditions

Got it, thanks for the tip!

I finally managed to make it work. I changed the trigger type from “Numeric State” to “Device” with the corresponding trigger (temperature change) and it worked.

Thanks guys for getting involved!