Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Stumped using a State Attribute as a Trigger in an Action

$
0
0

@gooberautomation wrote:

I want to be alerted when my thermostat changes its “hvac_action” attribute. This would be heating to idle, idle to heating, cooling to idle, idle to cooling. There are only these three values: heating, idle, cooling. I’m simply interested in any change of the attribute.

I’ve fiddled and fiddled, but every attempt results in errors from the configuration validator. As it sits now (see below) the validator complains about an invalid use of value template. Note that Blockquote inserted dots where I have dashes in my code. I feel like I’m dancing around the answer and just can’t quite nail it down.

- alias: NOTIFICATION Furnace Mode Changes
  trigger:
    platform: state
    entity_id: climate.trane_corporation_model_tzemt524aa21ma_mode
    value_template: >
      {{ trigger.to_state.attributes.hvac_action !=
         trigger.from_state.attributes.hvac_action }}
  action:
    - service: notify.clicksend_bkk
      data:
        message: 'Furnace action {{ state_attr("climate.trane_corporation_model_tzemt524aa21ma_mode","hvac_action") }}, Temp: {{ state_attr("climate.trane_corporation_model_tzemt524aa21ma_mode","temperature") }}'

Other stuff I monkeyed with…

Tried using platform:template as the trigger with:

"{{ state_attr('climate.trane_corporation_model_tzemt524aa21ma_mode', 'hvac_action') }}"

Also tried this as a value_template at one time…

  value_template: >
    {{ state_attr('climate.trane_corporation_model_tzemt524aa21ma_mode', 'hvac_action') in ['idle','heating','cooling'] }}

…and this…

  value_template: {{ state_attr('climate.trane_corporation_model_tzemt524aa21ma_mode', 'hvac_action') }}

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>