jcwillox / hass-template-climate

❄️Templatable Climate Device for Home Assistant, Supports Running Actions On Service Calls.
MIT License
133 stars 38 forks source link

hvac action template #28

Open tomfool1985 opened 1 year ago

tomfool1985 commented 1 year ago

Hi to everyone,

I tried to set the hvac action template in order to have the current status of the entity, but i does not work, thi is the template:

hvac_action_template: "{% set p = states('sensor.fancoil_cucina') | float > 0 %}
                           {% set eu = states('input_select.stagione') == 'Inverno' %}
                           {{  'HVACAction.HEATING' if p == true and eu ==true else  'HVACAction.COOLING' if p == true and eu == false else 'HVACAction.OFF' }}"

thanks for your help

jcwillox commented 1 year ago

Looks like the issue is you're returning the literal HVACAction.HEATING instead of the actual value heating, for a list of valid values look here https://github.com/home-assistant/core/blob/dev/homeassistant/components/climate/const.py#L90.

Otherwise, perhaps @laszlojakab can help.

tomfool1985 commented 1 year ago

Looks like the issue is you're returning the literal HVACAction.HEATING instead of the actual value heating, for a list of valid values look here https://github.com/home-assistant/core/blob/dev/homeassistant/components/climate/const.py#L90.

Otherwise, perhaps @laszlojakab can help.

Thanks!! work now!