SgtBatten / HA_blueprints

Somewhere to store automation blueprints
200 stars 79 forks source link

[Issue]: websocket notifications no message #237

Open Mikescotland opened 3 months ago

Mikescotland commented 3 months ago

Description

When having companion app on FCM notifications all is good, however when switching to websocket, frigate Notifications come with title but no message. FCM: DOORCAM A person detected. Picture Websocket: DOORCAM picture This happens only with frigate notifications, any other notification has normal message showing. When digging into notifications flow I can see that frigate Notifications inserts line "subject" into websocket notification and it's empty. I added message to subtitle and it's showing now in the websocket notification. Subtitle goes to "subject" line it appears, in websocket notifications. FCM ignores subtitle (on Samsung one ui 6.1). Looks like a workaround.

Version

0.12. 0.4a

Automation Config

alias: Frigate doorcam notification
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.doorcam
    notify_device: xx
    notify_group: ALL_DEVICES
    base_url: https://xxx
    title: Doorcam
    message: A {{label}} detected at front door
    critical: "true"
    attachment: snapshot.jpg?crop=1
    update_thumbnail: true
    icon: >-
      mdi:{{'account-outline' if label == 'Person' else 'dog' if label == 'Dog'
      else 'cat' if label == 'Cat' else 'car' if label == 'Car' else 'cctv'}}
    zone_filter: true
    zones:
      - entrance
    cooldown: 15
    silence_timer: 10
    button_3: Silence 10 mins
    android_auto: false
    video: ""
    alert_once: true
    sticky: true
    button_1: Video
    button_2: Snapshot

Frigate Config

No response

Any other relevant information

No response

azerioxal commented 3 months ago

I'm experiencing the same issue, but I'm not seeing anything in the traces or debug logbook events that would indicate why.

Mikescotland commented 3 months ago

I'm experiencing the same issue, but I'm not seeing anything in the traces or debug logbook events that would indicate why.

It won't be in traces. If you take a look in the companion app in notification history, tap on the relevant notification and you'd see the full message body. Subject is just empty when using websocket. This line does not appear then using FCM notification method. Workaround that works: in the blueprint repeat message content "A {{label}} detected" etc into subtitle field (same value, just copy. I've tested and now I have full message on both, FCM and Websocket

SgtBatten commented 3 months ago

Just to confirm adding a new key for subject: and duplicating title is sufficient?

Mikescotland commented 3 months ago

Just to confirm adding a new key for subject: and duplicating title is sufficient?

Title is fine in both cases. Goes properly into FCM and Websocket. The message field doesn't go into "subject" in websocket but somehow subtitle does work as main message when using websocket

SgtBatten commented 3 months ago

Just to confirm adding a new key for subject: and duplicating title is sufficient?

Title is fine in both cases. Goes properly into FCM and Websocket. The message field doesn't go into "subject" in websocket but somehow subtitle does work as main message when using websocket

What change are you suggesting I need to make?

Mikescotland commented 3 months ago

I think changing the code would be pointless, you have more pressing things. Maybe just add to the documentation to repeat the same content in message and subtitle fields, so it works with both, FCM and Websocket