The problem is here:
- service_template: >
{% if states('sensor.blitzwolf_01_wattage') | float < 40 %}
switch.turn_off
{% else %}
{% endif %}
entity_id: switch.blitzwolf_01_relay
You can’t set service_template
to nothing, it must be a valid service. However, what you can do is specify a non-existent entity. Home Assistant won’t complain if you attempt to turn off a switch that doesn’t exist.
We can leverage that information to achieve what you want:
- service: switch.turn_off
data_template:
entity_id: "{{ 'switch.blitzwolf_01_relay' if states('sensor.blitzwolf_01_wattage') | float < 40 else 'switch.none' }}"
EDIT
Corrected the example; overlooked to include data_template: