SgtBatten / HA_blueprints

Somewhere to store automation blueprints
207 stars 80 forks source link

[Config Support]: Android not being sent the notification. #281

Closed Handrail9 closed 1 month ago

Handrail9 commented 2 months ago

Describe the problem you are having or the outcome you are trying to achieve.

Hello, I am trying to set up notifications, but I can't seem to get the blueprint working. I did not customize the blueprint past giving it the camera and device to send the notification to. I'm not sure what I need to provide so please be very in depth with where to get more information if you need more information. I appreciate the help in advance

Version

Frigate Notifications 0.12.0.4d

Automation config

alias: Camera
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.my_camera
    notify_device: c4689b943f537a61aa15f548b0fee1f2
    base_url: https://homeassistant.domain.changed

Frigate Config

mqtt:
  enabled: true
  host: 192.168.1.80
  user: redacted
  password: redacted

detectors:
  coral:
    type: edgetpu
    device: pci

cameras:
  my_camera: # <--- this will be changed to your actual camera later
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.81:8080/video/h264
          roles:
            - detect
    detect:
      enabled: true
    zones:
      Zone:
        coordinates: 0.435,0.964,0.445,0.515,0.162,0.515,0.159,0.97
        loitering_time: 20
        objects: person
    motion:
      mask: 0.435,0.966,0.444,0.521,0.164,0.515,0.157,0.967
    record: # <----- Enable recording
      enabled: True
version: 0.14

Any other information that may be helpful

Frigate, MQTT and Home Assistant are all run in Docker. I tried referencing this guide when I could not get it to work reading the official Frigate documentation but it did not fix the issue.

SgtBatten commented 2 months ago

Any traces? screenshot the trace tree if there is. If not, mqtt probably isnt configured in a way that home assistant is getting the messages from frigate

SgtBatten commented 2 months ago

wait also you dont have the record roll defined for your camera in frigate

Handrail9 commented 2 months ago

wait also you dont have the record roll defined for your camera in frigate

Thanks for catching that, I've added - record under - detect and restarted Frigate & HA.

Any traces? screenshot the trace tree if there is. If not, mqtt probably isnt configured in a way that home assistant is getting the messages from frigate

I had tried manually running the automation in HA to test the notification and didn't receive anything. This trace is what shows up when I hit run, when I make a new one and walk in front of the camera myself it's blank after.

Here's the trace: Screenshot_20240914_010419

What can I post to verify if MQTT is configured correctly? I'm a little dull and am not sure which parts will be important to debugging.

SgtBatten commented 2 months ago

you cant manually trigger it by pressing run, nothing will happen. You need to walk in front of the camera as you mentioned.

To check on mqtt you need to install something like mqtt explorer in home asisstant and then look for the frigate/events channel. if frigate events arent showing up in the mqtt explorer then HA isnt recieving the messages.

Handrail9 commented 1 month ago

To check on mqtt you need to install something like mqtt explorer in home asisstant and then look for the frigate/events channel. if frigate events arent showing up in the mqtt explorer then HA isnt recieving the messages.

Okay, I've got MQTT explorer installed on my main PC and I went ahead and reset the MQTT password just to make sure that wasn't the issue. I'm out of the house for the next couple days but other people will be there so I'll check back in when I have an update. (Either when I can test it when I get back or if theres a ping sent to my phone while im gone)

JBakers commented 1 month ago

nvm

My wife just returned from work, and I got a notification from the new automation. No clue why it didn't work when I walked in front of my cameras the first 15 times...

Handrail9 commented 1 month ago

To check on mqtt you need to install something like mqtt explorer in home asisstant and then look for the frigate/events channel. if frigate events arent showing up in the mqtt explorer then HA isnt recieving the messages.

Hello, I'm back. I went ahead and tried the "walk in front of the camera" test today and it doesn't seem to be producing any results. I'm pretty sure however that both Frigate and HA are connected to MQTT correctly. I'm using the MQTT-Explorer AppImage as I'm using Home Assistant in Docker and the addon for MQTT-Explorer isn't available on the Docker version AFAIK. Publishing a test to MQTT from home assistant shows that HA is able to connect, and Frigate seems to have been publishing as well. Attaching a screenshot of what I'm able to see. What steps can I take from here to troubleshoot, and I appreciate your patience :) image

SgtBatten commented 1 month ago

events topic is all that matters which i cant see in the screenshot there, but otherwise yes it does look to be connected.

Please share your latest automation config and frigate config. feel free to jsut edit the first post or post it in a new comment

Handrail9 commented 1 month ago

Sure thing

alias: camera
description: ""
use_blueprint:
  path: SgtBatten/Stable.yaml
  input:
    camera: camera.camera
    notify_device: c4619b843f537a64aa15f578b0fee4f3
    base_url: https://changed-this
    mqtt_topic: frigate/events
mqtt:
  enabled: true
  host: 192.168.1.80
  user: USERNAME
  password: PASSWORD

detectors:
  coral:
    type: edgetpu
    device: pci

cameras:
  camera: # <--- this will be changed to your actual camera later
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://192.168.1.128:8080/video/h264
          roles:
            - record
            - detect
    detect:
      enabled: true
    zones:
      Zone:
        coordinates: 0.435,0.964,0.445,0.515,0.162,0.515,0.159,0.97
        loitering_time: 20
        objects: person
    motion:
      mask: 0.435,0.966,0.444,0.521,0.164,0.515,0.157,0.967
    record: # <----- Enable recording
      enabled: True
version: 0.14

I am noticing that there is no events topic in MQTT explorer. Is there anything I should change to get that to exist?

SgtBatten commented 1 month ago

explain your mqtt setup. somethings off.

Where is mqtt installed, where is home assistant installed what are the host IP addresses. How did you integrate home assistant with mqtt what are you monitoring using mqtt explorer.

Handrail9 commented 1 month ago

mqtt, home assistant and frigate are all in docker on the same server. Frigate and MQTT are in the same compose file, home assistant is in a separate compose file. They are both a part of the same docker network. Host IP is 192.168.1.80, and I used the MQTT integration to connect HA and mqtt. I connected to the mqtt server that is in the frigate compose file with MQTT explorer. I exposed the port on my local network to connect to it.

SgtBatten commented 1 month ago

okay sounds good. Getting events inside frigate?

Handrail9 commented 1 month ago

I may be a little stupid but do you mean am I able to see events inside of thr frigate UI or do you mean can I see it under frigate in mqtt explorer? I dont see it in mqtt explorer and I'm not sure how to check within the frigate ui (if thats what you meant)

SgtBatten commented 1 month ago

I meant in frigate yes.

What version of frigate are you using. is it the latest major relase, i.e 0.14?

Handrail9 commented 1 month ago

The UI is reporting version 0.14.1-f4f3cfa, which should be the latest docker version

SgtBatten commented 1 month ago

Okay so in frigate, do you have alerts and detections on the review page? image

Handrail9 commented 1 month ago

Yes, it shows 70 alerts, 0 detections and 0 motion. I dont see one named events I dont think? ResizedImage_2024-09-21_21-12-37_6270

SgtBatten commented 1 month ago

thats looks fine.

When you walk in front of the camera you should see events in mqtt explorer. they stick around so you should have time to walk out front then come back and see it

image

The moment that happens you should be getting trace information in the automation. I don;t understand how it;s not working right now.

Handrail9 commented 1 month ago

image Just tried walking in front of the camera and made sure it showed up under Alerts but events isn't showing :( Is this an issue I should take to the Frigate repo's issues?

SgtBatten commented 1 month ago

Seems to be as we need the mqtt message in order to trigger the automation.

Handrail9 commented 1 month ago

Went ahead and opened a discussion here. I'm not sure if you'd prefer to leave this open until I figure out my issue or close it out now that we've figured it's an issue between Frigate and MQTT. Whichever is fine with me though :)

Handrail9 commented 1 month ago

Solved here