Template Switch for Garage Heater

Currently I’m running a BroadLink rm4pro in my garage and want to make it into a switch for my garage heater. I have an energy meter hooked up to it so it knows the status of how much wattage it’s drawing.

I’ve looked at the template switch page but I’m stumped as it doesn’t have a value_attr for power consumption. Any help? I’m a templating noob

Welcome to HA! :slightly_smiling_face:

You can use the state of your energy meter for the value_template.
So with the example from the docs:

# Example configuration.yaml entry
switch:
  - platform: template
    switches:
      skylight:
        value_template: "{{ states('your_sensor.energy_meter') | float > 100 }}" # <- replace the entity_id and the value to your needs
        turn_on:
          service: switch.turn_on
          data:
            entity_id: switch.skylight_open
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.skylight_close