Generic thermostat - reverse switch state

Hello all,

I need your help in setting up my Generic Thermosat. I’ve searched the forum for solutions on simillar issues, but didn’t find any that would fit my needs.

So, my current set up is a Generic Thermostat for controlling floor heating valves according to the room temperature. Floor heating servo is managed by a sonoff mini switches.
Actually my problem is that I have to use Cooling Thermosat for heating needs.
My floor heating valves are “Normally Open”, which means they are “closed” if the sonof mini are “on” (servodrive must be energized to close).
So, thermostat must be “on” for cooling, and “off” for heating. This made me to use reversed thermostat logic for my heating needs - “Coolong thermostat” instead of “heating thermostat”.
This looks wierd and makes me crazy. I’d like to fix that and have it in the proper way.

Can anyone advise me how can I make the thermostat to work the following way:
in the heating mode (ac_mode: false) when thermostat stops heating, it should turn “on” the switch. and when thermostat needs to heat - the switch should be “off”

You can use a template switch to reverse your sonoff switch and use it in your thermostat.

switch
  - platform: template
    switches:
      switch_sonoff_reversed:
        value_template: "{{ is_state('switch.your_sonoff_switch', 'off') }}"
        turn_on:
          service: switch.turn_off
          data:
            entity_id: switch.your_sonoff_switch
        turn_off:
          service: switch.turn_on
          data:
            entity_id: switch.your_sonoff_switch
1 Like

Fantastic, thank you! That works great for me.
Now I need to figure out how to apply filter for lovelace to hide the original switch from Overview page.

Just my personal note to myself - for debug history:
line 1, after “switch” add “:”