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

Adding Zone Emoji/Icon to Location

$
0
0

I would like to use the Zone “Emoji/Icon” to my automation.
How would I do that based on my code.

- id: "b95c50bd-84aa-425a-a054-830044fefd6b"
  alias: "CWB Zone Notification GPS Logger"
  description: "CWB Zone Notification GPS Logger"  
  trigger:

  - platform: zone
    entity_id: device_tracker.cwb_gps_logger
    zone: zone.ace_hardware
    event: enter
  - platform: zone
    entity_id: device_tracker.cwb_gps_logger
    zone: zone.ace_hardware
    event: leave

  condition:
    - condition: template
      value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
    - condition: template
      # Only run if more than 5 minutes since it last ran
      value_template: >-
        {{(as_timestamp(now(),0) - as_timestamp(state_attr("automation.cwb_zone_notification", "last_triggered"),0) | int > 300 )}}
      # Now as a timestamp value MINUS the timestamp value of the last trigger of your automation.
      # The resulting number (as an INT) is the seconds elapsed. If Greater than COMPARISON VALUE (900) then TRUE. Automation continues. If FALSE, automation STOPS.  
  action:
  - service: notify.service
    data:
      message: "CWB {% if trigger.event == \"leave\" %}\n  {{ trigger.from_state.attributes.friendly_name\
        \ }} left {{ trigger.zone.attributes.friendly_name }}\n{% else %}\n  {{ trigger.from_state.attributes.friendly_name\
        \ }} arrived {{ trigger.zone.attributes.friendly_name }}\n{% endif %}\n"
  mode: queued   

So if I am at the Ace hardware store it will send a message to all in my list that I have arrived and/or departed.

I would like to add the Zone Icon, or my own that I can add to the message.

Can it be done.
Thank you

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106877

Trending Articles



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