Climate automation

i’m using RF on GPIO with the climate component to turn on and off an RF switch for my window AC unit.

however, sometimes the RF switch doesn’t register that the climate told it to fire on/off. either the RF switch doesn’t hear the request, or HA isn’t sending it. which leads to it never firing the on/off again. according to climate it should currently be “cool” mode, yet the AC is not on. or climate is currently in “idle” and the AC is still on, making it butt cold.

so i need an automation that will check if climate status is “cool” yet the temp is getting warmer then fire the ON again. and another that will check that climate is in “idle” yet it’s getting colder then fire the OFF again. rinse. repeat.

so that means being able to store the last temp, compare against the current temp and do math inside an automation.

can i even do add/subtract math in an automation with yaml code?

Hmm can’t you just send the code again after a second or so?

the firing of the on/off is all managed from the climate component. so, no.

You might be able to handle that with a trend sensor. You can also do math in a template sensor - template sensors change each time the state of entity_id they refer to changes.

Won’t keep_alive achieve a retrigger?

i like the idea of the trend sensor, i can prolly make that work.

climate really just needs a RETRY: TRUE/FALSE where it’ll retrigger on it’s own.

trying these out:

- alias: 'Retry A-C On'
  trigger:
    platform: state
    entity_id: binary_sensor.temperature_up
    state: "on"
  condition:
    condition: state
    entity_id: climate_cooler.operation_mode
    state: "cool"
  action:
    service: switch.turn_on
    entity_id: switch.switch_1

- alias: 'Retry A-C Off'
  trigger:
    platform: state
    entity_id: binary_sensor.temperature_down
    state: "on"
  condition:
    condition: state
    entity_id: climate_cooler.operation_mode
    state: "idle"
  action:
    service: switch.turn_off
    entity_id: switch.switch_1

and

binary_sensor:
  - platform: trend
    sensors:
      temperature_up:
        friendly_name: 'Temp Increasing'
        entity_id: sensor.temp
        device_class: heat
  - platform: trend
    sensors:
      temperature_down:
        friendly_name: 'Temp Decreasing'
        entity_id: sensor.temp
        device_class: cold
        invert: Yes

not working. the trigger is true and the condition is true, yet it’s not firing.

Hi, did you find a solution for this? I need to do something similar. Something that shuts off the heater when it’s not idle and the temperature is decreasing.

no, i replaced the RF with a more reliable sonoff switch, that solved my problem.