Generic Thermostat doesn't work with fireplace flame (light entity)

Hey folks, I am been struggling to get my fireplace to work with the generic thermostat. The flame entity for my fireplace is a light and therefore I cannot use it natively as the thermostat actuator. After reading some posts here I settled on a Template Switch to implement the thermostat actuator. Here is the configuration:

climate:
  - platform: generic_thermostat
    unique_id: office_fireplace_thermostat
    name: Office Fireplace
    heater: switch.office_fireplace_actuator
    target_sensor: sensor.office_temperature
    min_temp: 60
    max_temp: 80
    ac_mode: false
    target_temp: 74
    cold_tolerance: 0.3
    hot_tolerance: 0
    min_cycle_duration:
      seconds: 1
    keep_alive:
      minutes: 1
    initial_hvac_mode: "off"
    #away_temp: 65
    precision: 1

switch:
  - platform: template
    switches:
      office_fireplace_actuator:
        unique_id: office_fireplace_actuator
        friendly_name: "Office Fireplace Actuator"
        value_template: "{{ is_state('switch.office_fireplace_actuator', 'on') }}"
        turn_on:
          - action: switch.turn_on
            target:
              entity_id: light.office_fireplace_flame
          - action: light.turn_on
            target:
              entity_id: light.office_fireplace_flame
            data:
              brightness_pct: 100
        turn_off:
          - action: switch.turn_off
            target:
              entity_id: light.office_fireplace_flame
          - action: light.turn_on
            target:
              entity_id: light.office_fireplace_flame
            data:
              brightness_pct: 0

Testing the office_fireplace_actuator switch all by itself works. It will set the flame to 100% when on and 0% when off. Great. When I test the thermostat by raising the desired temp greater than the sensor.office_temperature the Fireplace will turn on. Even better! When I set the thermostat to a temp lower than the temp sensor it does not turn off. Not great.

I suspect the thermostat is not switching the flame because it has 3 states: on, idle, off. But I don’t know have to sync the switch to idle mode. Anyways, thanks in advance to anyone who can help!

Reference docs:

Change the Template Switch’s value_template to monitor the light’s state.

      value_template: "{{ is_state('light.office_fireplace_flame', 'on') }}"

The Template Switch is effectively duplicating the light so its state should be in lock-step with the light’s state.

It’s incorrect to set a Template Switch’s value_template to monitor its own state (ouroboros).

1 Like

Awesome that was my problem!

1 Like

@123 The thermostat will now turn off the flame when in idle! I updated my switch to keep the blower running when in idle state. However, now the blower will keep running even when the thermostat is off. This is my new configuration:

switch:
  - platform: template
    switches:
      office_fireplace_actuator:
        unique_id: office_fireplace_actuator
        friendly_name: "Office Fireplace Actuator"
        value_template: "{{ is_state('light.office_fireplace_flame', 'on') }}"
        turn_on:
          - action: switch.turn_on
            target:
              entity_id: light.office_fireplace_flame
          - action: light.turn_on
            target:
              entity_id: light.office_fireplace_flame
            data:
              brightness_pct: 100
          - action: fan.turn_on
            target:
              entity_id: fan.office_fireplace_blower
            data:
              brightness_pct: 100
        turn_off:
          - action: switch.turn_off
            target:
              entity_id: light.office_fireplace_flame
          - action: light.turn_on
            target:
              entity_id: light.office_fireplace_flame
            data:
              brightness_pct: 0
          - action: fan.turn_off
            target:
              entity_id: fan.office_fireplace_blower
            data:
              brightness_pct: 30

How to a setup the switch to turn off the blower and flame when the thermostat is in the off state? Do you also know if it is possible to create a 3 way template switch?

The latest example you posted contains errors and unnecessary actions.

  1. The expected entity for switch.turn_on or switch.turn_off action is a switch (not a light). For a light entity, use light.turn_on and light.turn_off.

  2. If you use one action to turn off a light, there’s no need to use a second action to set the same light’s brightness to zero.

  3. The fan.turn_off action doesn’t have a brightness_pct option.

  4. Some of the errors I have described have probably already been reported in your Log. After composing a Template entity (like a Template Switch) and then executing Reload Template Entities (in Developer Tools → YAML) you should check the Log for errors.

switch:
  - platform: template
    switches:
      office_fireplace_actuator:
        unique_id: office_fireplace_actuator
        friendly_name: "Office Fireplace Actuator"
        value_template: "{{ is_state('light.office_fireplace_flame', 'on') }}"
        availability_template: "{{ has_state('light.office_fireplace_flame') }}"
        icon_template: "mdi-fire{{ iif(bool(states('light.office_fireplace_flame'), none), '', '-off', '-alert') }}"
        turn_on:
          - action: light.turn_on
            target:
              entity_id: light.office_fireplace_flame
          - action: fan.turn_on
            target:
              entity_id: fan.office_fireplace_blower
        turn_off:
          - action: light.turn_off
            target:
              entity_id: light.office_fireplace_flame
          - action: fan.turn_off
            target:
              entity_id: fan.office_fireplace_blower

AFAIK know there is no such thing as a three way switch in Home Assistant, they are either on or off. If this is for your dashboard though, you could create a template fan with a certain number of preset modes to choose from with different combinations of fan and flame.