Numeric state problems, not actioned

Hi, for some reason the numeric state is getting ignored, it was written on love lace, but is resorting to the time trigger and not the numeric state

alias: Central Heating Off morning
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.tv_control_temp_sensors_temperature
    above: 15.5
  - platform: time
    at: "11:45:00"
condition:
  - condition: time
    after: "08:00:00"
    before: "12:00:00"
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.central_heating
mode: single

Its now getting a problem as the heating is only just needed, but runs until the time trigger, so getting a bit too warm.
I finding the same problem with the automation that controls the boiler hot water, its ignoring the numeric state trigger, and using the fall back tank thermostat.
The HA version is a bit old , but all other is working so I haven’t upgraded , version 2023.7.3
strangely the logs show it triggered, but much earlier, previous day
its as if the numeric trigger per device can only get used once each day ???

It’s not getting ignored, it’s doing exactly what you’d told it to. That automation will trigger on two events happening:

  • when the temperature rises from below to above 15.5°C
  • at 11:45.

It will continue to the action only if it’s between 08:00 and 12:00.

If it’s already above 15.5°C at 08:00, nothing will happen (trigger at e.g. 07:00 but blocked by condition; or not triggered at all if it hasn’t dropped below that temperature all night). You need an additional trigger at 08:00 and an additional condition that the temperature is (already) above 15.5°C.

Note that this won’t turn the heating off at 11:45 if the temperature is still low. If that’s an issue, explain how you want it to work.

alias: Central Heating Off morning
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.tv_control_temp_sensors_temperature
    above: 15.5
  - platform: time
    at:
      - "08:00:00"
      - "11:45:00"
condition:
  - condition: numeric_state
    entity_id: sensor.tv_control_temp_sensors_temperature
    above: 15.5
  - condition: time
    after: "08:00:00"
    before: "12:00:00"
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.central_heating
mode: single
2 Likes

Um perhaps I was not clear enough, temp at 8am is below 15.5 heating comes on at 7:45 and stays on until the time trigger when its above 17.
Same problem with numeric trigger on hot water before the conditional period 36 C, numeric trigger at 42 C, gets ignored until fail safe thermostat switches off at 50 C
So its not doing as it is supposed to

OK, so look at the sensor history graph to see when the threshold was crossed, and the automation trace at that time to see what happened.

Ive found that the numeric state trigger is just too unreliable.
What I did for my heating was to start a timer that runs for 20 minutes.
At the end of the timer it checks if any conditions are met to turn on/off the heat.
It then performs the action, and restarts the timer.
If no action is taken, the timer restarts anyway.
I still have the numeric trigger in the automation but its pretty much just a backup. The timer is always reset no matter the trigger.
The timer can be set for shorter intervals, but in my setup, 20 minutes is pretty good.

Yeah, no.

I have hundreds of them and they all work reliably. Maybe it is an issue with your sensors?

1 Like

Its been while since I tried to rely on just those triggers, so maybe its been improved.

It’s not that they are unreliable, it’s that most of the time people use them without understanding exactly how they work. TBH, I’d rather see them get renamed to something like “threshold triggers” as that’s really what they are; Threshold points that need to be crossed, not in the range of.

1 Like

Seems pretty simple to me. If temperature is above a certain point, trigger the automation. Its just not 100% reliable. Ive just gotten to where I put in a backup trigger.

Not the sensors,as both as displayed as gauges.
It is a big problem as gas is expensive, and the whole reason for automation was to save money.
I even have an additional automation to turn off at any time if temperatures are exceeded.
AND that’s fails
Needs something like cron to check every 5 mins

You could use a time pattern trigger set to 00:05:00 and then add numeric conditions to prevent/allow the automation to run. That should solve the issue for both of your automations.

Needs your system fixed. These triggers should be 100% reliable if the data is good. Timed polling is a sticking plaster for a poor setup.

Are you sure your sensors are always sending a number, and not going from e.g. 15 to unavailable to 16?

Show me the history graph for the sensor crossing the threshold, and if the automation shows a trace at that point, include the full trace file. There will be a reason for its failure that is not a fault of the numeric state trigger. Without that data your claims that the trigger is inherently unreliable are baseless.

If you do have an unreliable sensor that goes unavailable between readings, for example:

alias: Central Heating Off morning
description: ""
trigger:
  - platform: state
    entity_id: sensor.tv_control_temp_sensors_temperature
  - platform: time
    at: "11:45:00"
condition:
  - condition: numeric_state
    entity_id: sensor.tv_control_temp_sensors_temperature
    above: 15.5
  - condition: state
    entity_id: switch.central_heating
    state: "on"
  - condition: time
    after: "08:00:00"
    before: "12:00:00"
action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.central_heating
mode: single

That’s not how it works. The trigger fires when the temperature rises above a certain point. It is the act of the temperature crossing the threshold that fires the trigger.

1 Like

Thats basically what I said. I just worded it improperly. What I said would be correct for a condition.

Well I’m finding like others that when it crosses the threshold it does not do what it supposed to do,
I can fix the hot water easily as there is a function on the Shelly1 Pm when used with a temp sensor , so I can use that to switch the hot water on and off. But the central heating doesn’t use the same Shelly for temp sensing and control.
I do dislike the attitude of some that facts are misrepresented .
I’d be interested in the solution Rich37804 uses

Is there a reason that you are seemingly refusing to post the info that has been asked of you a couple of times now?

If you come here for help the least you could do is provide the info that the people that are trying to help you are asking for.

Unless that’s not the goal?

1 Like

I assume you’re referring to this?

I’ve asked you twice now to provide some data. I am trying to help you — if the numeric state trigger isn’t firing, there will be a good reason for it. The underlying code isn’t complicated: if the new state is higher than the threshold and the old state was lower, fire.

If you don’t like the attitude I show when you repeat a claim without the data requested, then either supply the data or carry on claiming “it doesn’t work”. The first way will get you more help, the second way probably won’t.

1 Like

I dont have the graph from last night when the HW was at 36C before evening switch on, and within the conditional period, where the numeric trigger failed yet again. Tonights HW is up at 42 where we have been out all day and not using it. and the CH is up at 19.3 way above the turn on threshold, so the person who disbelieves me will have to wait, until the next incidence for proof I’m telling the truth. At midday the room temp at 17.4 C and the CH should not have come on.
I can put a numeric state condition to stop that, but I can stop the heating being turned off when the temp passes through or exceeds the upper limit.

Really?

To be clear, I’m not saying you’re lying, just that there will be an underlying cause related to your sensor or config that I was trying to help you track down. The numeric state trigger works as advertised.

I’ve thrown this in to try and catch the over temp on the CH

alias: CH max temperature
description: turn off CH if above 17.3 C
trigger:
  - platform: time_pattern
    minutes: /10
condition:
  - condition: numeric_state
    entity_id: sensor.tv_control_temp_sensors_temperature
    above: 17.5
action:
  - type: turn_off
    device_id: 0b6e278afd061db57c5ac8961518b0a9
    entity_id: b694f2bce0f086bce79b6505f2540bfd
    domain: switch
mode: single

The Hot water over temp will be harder as the rate of change is a lot quicker and every 10 mins will still give an over shoot