I have a Tasmota 3-Way lightswitch that has two switches within it - one for the power and one for the power status on it.
I set up as a template to automatically flip its status light when the power switches on it. It worked for a while, but some time ago started getting the error “Template Rendered Invalid Service” when flipped. The odd part is that it works most of the time, but not always. Not clear on what I am doing wrong with it.
switch:
basement_lights:
friendly_name: Basement Lights
value_template: "{{ states('switch.basement_lights_power_status') }}"
turn_off:
service: >
{% if is_state('switch.basement_lights_power_status', 'on') %}
switch.toggle
{% endif %}
entity_id: 'switch.basement_lights_power_switch'
turn_on:
service: >
{% if is_state('switch.basement_lights_power_status', 'off') %}
switch.toggle
{% endif %}
entity_id: 'switch.basement_lights_power_switch'
icon_template: mdi:lightbulb