Right, you’re dealing with light templates – this still gives you an entity (not a device; a device is something very specific to HA).
Also, please format your code.
It shouldn’t make a difference, but also want to point out that to turn on a switch, just call the switch.turn_on
service directly (don’t need to use the more generic homeassistant.turn_on
).
Now, given your config, what is going wrong? Describe the symptoms/show logs. Can you confirm that manually (from within HA) you can turn switch.double_relay_switch_2x1_5kw_current_value
on and off and that it behaves as expected?
Start simple: template lights only require turn_on
and turn_off
to be defined (as per the docs). Only do that and confirm that it works. Everything else is optional.