Hi Guys,
apologies for the question, I’ve researched templates and I’ve researched template switches and I thought I understand them but home assistant brought me back down to earth with error messages.
Background: I bought a portable AC unit, it has Tuya compatibility and it slotted straight into HA as a climate entity. I have a Stream deck that allows me to ‘at the touch of a button’ switch devices on and off. To do so, I need a switch entity and the Tuya interface doesn’t provide that. So I walk down the path of using a switch template, however the state of the entity is not on/off. Its ‘cool’ and ‘off’. So the return value of the template doesn’t match its dictionary
Failure Simplified:
value_template {{ is_state ('climate.kogan', 'cool') }}
I was hoping to return a true/false that HA would derive as Boolean on/off
I have not been able to determine the best way to create a template that will return specific values based on another entities values.
Creating a new entity seems the best way:
{{ iif (is_state('climate.kogan.state', 'cool'), 'on', 'off') }}
then converting that entity to a switch, however I was hoping to appeal to collective wisdom…