Help with automation 201015

Hi,
can somebody say why this automation might not firing up?

- id: '1602314685193'
  alias: ekonomie otapeni vypnuti hdo stop on
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.topeni_temp
    above: '49'
    below: '90'
  condition:
  - condition: time
    after: '8:01:00'
    before: '20:55:00'
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: switch.hdo_tc_stop
        state: 'off'
      sequence:
      - service: switch.turn_on
        data: {}
        entity_id: switch.hdo_tc_stop
    default: []
  mode: single

State now:
[sensor.topeni_temp] 54.6
Time 10:07

It only triggers when the change from the old to the new value crosses one of the thresholds. So if you temperature is 50 and changes to 55, it doesn’t trigger wheras if your temperature is 48 and changes to 55 it triggers (above threshold crossed) or it is 92 and changes to 88 (below threshold crossed).
See the explanation here in the docs.

So you think it lagged and didn’t check?And afterwards it didn’t fired.
Do you have any sugestions on how i can fix it so it will run? :stuck_out_tongue:
Screenshot_38

No, I assume the old state was within the thresholds and the new state was also within the thresholds. And the trigger only fires when a threshold has been crossed.

I had a similar challenge on something. The way I worked around that was to also include the time within the trigger, maybe something like this (not tested!):

- id: '1602314685193'
  alias: ekonomie otapeni vypnuti hdo stop on
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.topeni_temp
    above: '49'
    below: '90'
  - platform: time
	at: '08:01'
  condition:
  - condition: time
    after: '8:01:00'
    before: '20:55:00'
  - condition: numeric_state
	entity_id: sensor.topeni_temp
    above: '49'
    below: '90'
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: switch.hdo_tc_stop
        state: 'off'
      sequence:
      - service: switch.turn_on
        data: {}
        entity_id: switch.hdo_tc_stop
    default: []
  mode: single

This way when the temp moves into the range (trigger), and the time condition passes (the new condition of temp will also pass as that triggered it!) your good. Secondly, when 08:01 comes around and it triggers, if the temp is within the range it should also trigger (even if the temp was within the range previously).

Not tested but a similar thing to what I had to do to meet a similar problem.

1 Like

Will try and let you know,thank you !

Can you please exactly explain when your automation should trigger?

With @woodmj74’s suggestion you will just have an additional trigger at 8:01, but otherwise nothing changes. It will still only trigger at 8:01 and whenever the state was outside the boundaries (below 49 or above 90) and changes to a state inside the boundaries (49 < state < 90).

Ah, I may have misread the problem…I thought it was when 08:01 came around and the state was already within the range (49 < state < 90) it didn’t trigger (and had been in that range from before 08:01 until 10:07 when it was checked manually)

(sorry if I’ve confused matters :wink: )

1 Like

No need to apologise, you may as well be correct with your code, however, I need to understand the exact requirements from OP to evaluate.

Sorry guyz with late reply, it seems after removing the above or below on off or on its working.
So i thout its like programing language below 10 and above 0 0<x<10
But no, now its working, i hope it will further :stuck_out_tongue:

- id: '1602314685193'
  alias: ekonomie otapeni vypnuti hdo stop on
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.topeni_temp
    above: '49'
  condition:
  - condition: time
    after: '8:01:00'
    before: '20:55:00'
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: switch.hdo_tc_stop
        state: 'off'
      sequence:
      - service: switch.turn_on
        data: {}
        entity_id: switch.hdo_tc_stop
    default: []
  mode: single
- id: '1602314728181'
  alias: ekonomie otapeni zapnuti, hdo stop off
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.topeni_temp
    below: '42'
  condition:
  - condition: time
    after: '8:01:00'
    before: '20:01:00'
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: switch.hdo_tc_stop
        state: 'on'
      sequence:
      - service: switch.turn_off
        data: {}
        entity_id: switch.hdo_tc_stop
    default: []
  mode: single

Between times it checking the temps, if the boiler temp is higher,it turn it off, if its lower it turn it on.

Screenshot_40
The red is automatic by the device, the green is by HA

Yeah, not working again…
i gues its already above the state and it just did’nt trigger, i wonder how other people have automation working, i’m missing something

I tryed to put FOR value 10seconds and it seems it triggered once now. Let’s see further how it goes

Trigger on any change in temperature and check in the conditions whether the temperature is within range.

So the trigger becomes

trigger:
  - platform: state
    entity_id: sensor.topeni_temp

and the condition:

conditions:
  - condition: numeric_state
    entity_id: sensor.topeni_temp
    above: 49
1 Like

ohh okay, this seems different, thank you!!! will try after i try actual one. Will let you know

So it seems working now. Will try yours if i incounter again :slight_smile: