SgtBatten / HA_blueprints

Somewhere to store automation blueprints
151 stars 55 forks source link

[Issue]: Automations not loading with HA 2024.7 #232

Closed tykeal closed 2 days ago

tykeal commented 3 days ago

Description

With the update to HA 2024.7 all of my uses of this blueprint are showing up as needing repair.

For instance:

The blueprinted automation "1 - Frigate - Doorbell Notification" (automation.1_doorbell_room_notification) failed to set up.

Error:Unknown device '0890f6e26024ebfbd3aa304bfb86243d'.

To fix this error, edit the automation to correct it, then save and reload the automation configuration.

My issue is, that I can't figure out where that device is getting defined!

Version

0.12.0.4a

Automation Config

alias: 1 - Frigate - Doorbell Notification
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: doorbell
    notify_group: tea_room
    tv_transparency: 0%
    attachment: snapshot
    update_thumbnail: true

Frigate Config

---
mqtt:
  host: haos.h7925.bardicgrove.org
  port: 1883
  user: REDACTED
  password: REDACTED

birdseye:
  enabled: true
  mode: continuous

detectors:
  # cpu1:
  #   type: cpu
  #   num_threads: 2
  # cpu2:
  #   type: cpu
  #   num_threads: 2
  # cpu3:
  #   type: cpu
  #   num_threads: 2
  # cpu4:
  #   type: cpu
  #   num_threads: 2
  # cpu5:
  #   type: cpu
  #   num_threads: 2
  # cpu6:
  #   type: cpu
  #   num_threads: 2
  coral:
    type: edgetpu
    device: usb

go2rtc:
  streams:
    doorbell:
      - rtsp://REDACTED:REDACTED@REDACTED:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
    doorbell_sub:
      - rtsp://REDACTED:REDACTED@REDACTED:554/cam/realmonitor?channel=1&subtype=1#backchannel=0
    office:
      - rtsp://REDACTED:REDACTED@REDACTED/onvif/profile4/media.smp
    tearoom:
      - rtsp://REDACTED:REDACTED@REDACTED/onvif/profile4/media.smp
  webrtc:
    candidates:
      - 10.42.42.57:8555
      - stun:8555

cameras:
  doorbell:
    ffmpeg:
      inputs:
        # high resolution stream
        - path: rtsp://127.0.0.1:8554/doorbell
          input_args: preset-rtsp-restream
          roles:
            # - detect
            # - clips
            - record
        # low resolution stream
        - path: rtsp://127.0.0.1:8554/doorbell_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
      output_args:
        record: preset-record-generic-audio-copy
    detect:
      width: 720
      height: 576
      fps: 5
    objects:
      track:
        - person
    motion:
      mask:
        # Road
        - 0,134,237,131,233,327,0,371

    snapshots:
      enabled: true
      retain:
        default: 2
    record:
      enabled: true
      events:
        retain:
          default: 2
      retain:
        days: 0
        mode: active_objects

  office:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/office
          roles:
            - detect
            # - clips
            - record
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
        - person
      mask:
        # Door
        - 709,617,896,652,986,518,976,203,687,233
        # Andy's workstation
        # - 0,720,408,720,404,514,322,414,0,466

    motion:
      mask:
        # Door
        - 709,617,896,652,986,518,976,203,687,233
        # Andy's workstation
        # - 0,720,408,720,404,514,322,414,0,466

    zones:
      andy_desk:
        coordinates: 0,720,408,720,404,514,322,414,0,466
      main_office:
        # yamllint disable-line rule:line-length
        coordinates: 0,0,0,466,322,414,404,514,408,720,841,720,898,647,729,622,710,292,978,280,983,513,1280,0

    record:
      enabled: true
      retain:
        days: 0
        mode: active_objects
      events:
        retain:
          default: 2

    snapshots:
      enabled: true
      retain:
        default: 2

Any other relevant information

When I try to update the automation, I find that the capitlization of entity changes in the drop down, but when I try to save I get:

Message malformed: Unknown device 'False'

tykeal commented 3 days ago

Doing some other work and I found this log line:

2024-07-04 10:00:36.811 ERROR (MainThread) [homeassistant.components.automation] Blueprint 'Frigate Notifications (0.12.0.4a)' generated invalid automation with inputs {'camera': 'doorbell', 'notify_group': 'tea_room', 'tv_transparency': '0%', 'notify_device': '0890f6e26024ebfbd3aa304bfb86243d', 'attachment': 'snapshot', 'update_thumbnail': True}: Unknown device '0890f6e26024ebfbd3aa304bfb86243d'

Which given my configuration doesn't make sense. I'm not defining a notification device but notification group to use

tykeal commented 3 days ago

Follow on, I configured a notification device and that has resolved the issue. It looks like the default value of 'false' is the culprit as that "device" doesn't exist for the notify platform.

This seems to have fixed the issue entirely, but that means that the real issue is that the notify_device (Mobile Device) must be defined now and it currently marked as optional

SgtBatten commented 2 days ago

A mobile device has been required since november 2023 after home assistant removed the ability to leave it blank. The behaviour of the blueprint for sending to groups is unchanged, and the mobile device will be ignored.

See #112 for additional information.