Help for HTML push notifications

I got lost of errors with HTML notifications. Lack of examples really make me post this. Can I have your notifications examples? (With function like icon,title,url, ect) Thanks for your help

Here’s a quick 3

- alias: Garage door is still open
  trigger:
    - platform: state
      entity_id: sensor.garage_door_status
      from: 'Closed'
      to: 'Open'
      for: '00:00:10'
  action:
    - service: notify.html5
      data_template:
        target: ['rogue', 'gambit']
        title: 'Home Assistant Message'
        message: 'The garage door is still open after 10 minutes'

Simply notifies me, or whoever when the garage has been open for a while. Pretty basic.

- alias: Garage Door Notify Clicked
  trigger:
    - platform: event
      event_type: html5_notification.clicked
      event_data:
        action: open_garage_door
  action:
    - service: mqtt.publish
      data:  
        topic: ha/garage/door/cmd
        payload: '99'
        retain: false
        qos: 0

Allows me to receive a notification upon arriving home. Click the notification and the door goes up.

- alias: Phone Battery Dying
  trigger:
    - platform: state
      entity_id: sensor.user1, sensor.user2, sensor.user4, sensor.user3
      from: '21'
      to: '20'
  action:    
    - service_template: >
        {% if trigger.to_state.attributes.friendly_name == 'User1 Battery' %}
          notify.html5_gambit
        {% elif trigger.to_state.attributes.friendly_name == 'User2 Battery' %}
          notify.html5_rogue
        {% elif trigger.to_state.attributes.friendly_name == 'User3 Battery' %}
          notify.html5_storm
        {% elif trigger.to_state.attributes.friendly_name == 'User4 Battery' %}
          notify.html5_jubiliee
        {% endif %}
      data:
        title: 'Home Assistant Message'
        message: 'Your battery needs charging soon!'

If a user’s battery has gone below 21% it notifies that user that their battery needs to be charged.

2 Likes

I guess you’re asking about Automations…?

Here is my camera motion notification…

- alias: HTML Notification for Courtyard Cam
  trigger: []
  action:
    - service: camera.snapshot
      data:
        entity_id: camera.courtyard
        filename: "<local storage>/www/snapshots/Courtyard_{{now().strftime('%A_%b-%d-%Y_%H-%M-%Z')}}.jpg"
    - delay: 
        seconds: 1
    - service: notify.<my domain>
      data_template:
        title: Courtyard Camera Triggered
        message: "{{now().strftime('%A, %b.%_e, %Y at%_l:%M%P (%H:%M)')}}"
        data:
          tag: courtyard_camera_notification
          image: "https://<my domain>/local/snapshots/Courtyard_{{now().strftime('%A_%b-%d-%Y_%H-%M-%Z')}}.jpg"
          url: https://<my domain>/ui3.htm?cam=courtyard&maximize=1&tab=alerts
1 Like

Can the “icon” be material design icon or it must be a picture (jpg)?