AppDaemon Q&A

I am trying to handle weather underground alerts and I was not sure how such can be implemented when dealing with attributes and which are not guaranteed to exist all the time. Some more discussion is going on here in this thread

alias: "Weather Warning Tornado"
trigger:
  - platform: numeric_state
    entity_id: sensor.pws_alerts
    above: 1
condition:
   condition: or
   conditions:
     - condition: template
       value_template: '{{ states.sensor.pws_alerts.attributes.Description == "Tornado Warning" }}'
     - condition: template
       value_template: '{{ states.sensor.pws_alerts.attributes.Description_TOR == "Tornado Warning" }}'
action:
  service: script.weather_warning_tornado
1 Like