Automations

Automations examples.

Notify Mobile App.

Notify Mobile App using image and button.

The below is a notification using the Android APP of Home Assistant to notify with an image from API of the camera or a photo from a screenshot saved local.

Camera API image.
action: notify.mobile_app_kostas
data:
  message: Αυτό είναι ένα μυνήμα.
  title: Κάποιος είναι στην αυλόπορτα.
  data:
    image: /api/camera_proxy/camera.garden_door
    entity_id: camera.garden_door
    actions:
      - action: URI
        title: Κάμερα
        uri: /lovelace-cameras/garden
      - action: URI
        title: Άνοιγμα Εικόνας
        uri: /media/local/camera/garden_door/person.jpg
Photo from screenshot saved local.
action: notify.mobile_app_kostas
data:
  message: Αυτό είναι ένα μυνήμα.
  title: Κάποιος είναι στην αυλόπορτα.
  data:
    image: /media/local/camera/garden_door/person.jpg
    entity_id: camera.garden_door
    actions:
      - action: URI
        title: Κάμερα
        uri: /lovelace-cameras/garden
      - action: URI
        title: Άνοιγμα Εικόνας
        uri: /media/local/camera/garden_door/person.jpg
File Location Mapping

The key difference is that /local/ maps to /config/www/ directory, while /media/local/ maps to /media/ directory

Physical Path Notification Path Usage
/config/www/file.jpg /local/file.jpg Public access, no auth required
/media/file.jpg /media/local/file.jpg Authenticated access, secure
Camera entity /api/camera_proxy/camera.entity_id Live camera proxy

Ins0mniA

Auto Update Home Assistant

Automation that auto update Home Assistant OS , Supervisor

Nightly HA updates (core/supervisor/OS/add-ons)
alias: Nightly HA updates (core/supervisor/OS/add-ons)
description: Create backup, then install all available Supervisor-provided updates.
triggers:
  - at: "03:15:00"
    trigger: time
conditions: []
actions:
  - alias: Create backup using UI-defined settings
    action: backup.create_automatic
    data: {}
  - delay: "00:02:00"
  - alias: Install available Supervisor updates (core/supervisor/OS/add-ons)
    action: update.install
    target:
      entity_id: |-
        {{ expand(integration_entities('hassio'))
           | selectattr('domain','eq','update')
           | selectattr('state','eq','on')
           | map(attribute='entity_id') | list }}
    data:
      backup: true
mode: single
Nightly HACS updates
alias: Nightly HACS updates
description: Install all available HACS updates exposed as update entities.
triggers:
  - at: "03:30:00"
    trigger: time
conditions: []
actions:
  - alias: Install available HACS updates
    action: update.install
    target:
      entity_id: |-
        {{ expand(integration_entities('hacs'))
           | selectattr('domain','eq','update')
           | selectattr('state','eq','on')
           | map(attribute='entity_id') | list }}
    data: {}
mode: single

Ins0mniA