blakeblackshear / frigate-hass-integration

Frigate integration for Home Assistant
MIT License
709 stars 113 forks source link

Entities remain unknown after Frigate setup #517

Closed NeillHerbst closed 1 year ago

NeillHerbst commented 1 year ago

Version of the custom_component

Frigate: 0.12.1 Frigate Integration: 4.0.0

Configuration

mqtt:
  host: 192.x.x.2
  topic_prefix: frigate
  user: mqttuser
  port: 1883
  password: password

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu

cameras:
  driveway_cam:
    ffmpeg:
      inputs:
        - path: rtsp://admin:XXXXX@192.x.x.253:554/h264_stream
          roles:
            - detect

    detect:
      enabled: True
      width: 1280
      height: 720
      fps: 5

    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 3

    objects:
      track:
        - person
        - car
      filters:
        car:
          threshold: 0.6

    motion:
      mask:
        - 371,720,367,664,47,667,51,720
        - 417,45,420,167,993,364,1063,147,883,0,421,0  
    zones:
      driveway_gate:
        coordinates: 333,177,415,167,415,74,33,100,42,189,44,247
      driveway_near:
        coordinates: 89,545,139,720,438,720,1185,720,1280,720,1280,308,1107,0,794,285

Describe the bug

Setup frigate in Home Assistant and successfully detects cars and persons. When trying to setup the integration all goes well but all the entities remain unavailable. I suspect it might be a MQTT issue but I'm not sure.

image

Debug log

MQTT LOGS:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[14:38:24] INFO: SSL is not enabled
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
[14:38:24] INFO: Starting NGINX for authentication handling...
s6-rc: info: service legacy-services successfully started
[14:38:24] INFO: Starting mosquitto MQTT broker...
1689683904: Loading config file /share/mosquitto/solar_assistant.conf
2023-07-18 14:38:24: Warning: Mosquitto should not be run as root/administrator.
[14:38:25] INFO: Successfully send discovery information to Home Assistant.
[14:38:26] INFO: Successfully send service information to the Supervisor.
2023-07-18 14:38:24: mosquitto version 2.0.15 starting
2023-07-18 14:38:24: Config loaded from /etc/mosquitto/mosquitto.conf.
2023-07-18 14:38:24: Loading plugin: /usr/share/mosquitto/go-auth.so
2023-07-18 14:38:24:  ├── Username/password checking enabled.
2023-07-18 14:38:24:  ├── TLS-PSK checking enabled.
2023-07-18 14:38:24:  └── Extended authentication not enabled.
2023-07-18 14:38:24: Opening ipv4 listen socket on port 1883.
2023-07-18 14:38:24: Opening ipv6 listen socket on port 1883.
2023-07-18 14:38:24: Opening websockets listen socket on port 1884.
2023-07-18 14:38:24: Connecting bridge SolarAssistant (192.168.50.182:1883)
2023-07-18 14:38:24: mosquitto version 2.0.15 running
2023-07-18 14:38:25: Expiring client local.core-mosquitto.SolarAssistant due to timeout.
2023-07-18 14:38:25: New connection from 127.0.0.1:39764 on port 1883.
2023-07-18 14:38:25: Client <unknown> closed its connection.
2023-07-18 14:38:26: New connection from 172.30.32.1:56682 on port 1883.
2023-07-18 14:38:26: New client connected from 172.30.32.1:56682 as frigate (p2, c1, k60, u'mqttuser').
2023-07-18 14:38:49: New connection from 172.30.32.2:52780 on port 1883.
2023-07-18 14:38:49: Client <unknown> closed its connection.
2023-07-18 14:40:39: Client frigate disconnected.
2023-07-18 14:40:49: New connection from 172.30.32.2:44298 on port 1883.
2023-07-18 14:40:49: Client <unknown> closed its connection.
2023-07-18 14:40:58: New connection from 172.30.32.1:56570 on port 1883.
2023-07-18 14:40:58: New client connected from 172.30.32.1:56570 as frigate (p2, c1, k60, u'mqttuser').
2023-07-18 14:42:49: New connection from 172.30.32.2:33402 on port 1883.
2023-07-18 14:42:49: Client <unknown> closed its connection.
2023-07-18 14:44:49: New connection from 172.30.32.2:50164 on port 1883.
2023-07-18 14:44:49: Client <unknown> closed its connection.
2023-07-18 14:46:49: New connection from 172.30.32.2:42596 on port 1883.
2023-07-18 14:46:49: Client <unknown> closed its connection.
2023-07-18 14:48:49: New connection from 172.30.32.2:50786 on port 1883.
2023-07-18 14:48:49: Client <unknown> closed its connection.
2023-07-18 14:50:49: New connection from 172.30.32.2:58120 on port 1883.
2023-07-18 14:50:49: Client <unknown> closed its connection.
2023-07-18 14:52:49: New connection from 172.30.32.2:59394 on port 1883.
2023-07-18 14:52:50: Client <unknown> closed its connection.
2023-07-18 14:54:50: New connection from 172.30.32.2:47772 on port 1883.
2023-07-18 14:54:50: Client <unknown> closed its connection.
2023-07-18 14:56:50: New connection from 172.30.32.2:60620 on port 1883.
2023-07-18 14:56:50: Client <unknown> closed its connection.
2023-07-18 14:58:50: New connection from 172.30.32.2:42652 on port 1883.
2023-07-18 14:58:50: Client <unknown> closed its connection.
2023-07-18 15:00:41: Client frigate disconnected.
2023-07-18 15:00:50: New connection from 172.30.32.2:42160 on port 1883.
2023-07-18 15:00:50: Client <unknown> closed its connection.
2023-07-18 15:00:56: New connection from 172.30.32.1:54110 on port 1883.
2023-07-18 15:00:56: New client connected from 172.30.32.1:54110 as frigate (p2, c1, k60, u'mqttuser').
2023-07-18 15:02:50: New connection from 172.30.32.2:50452 on port 1883.
2023-07-18 15:02:50: Client <unknown> closed its connection.
2023-07-18 15:04:50: New connection from 172.30.32.2:38268 on port 1883.
2023-07-18 15:04:50: Client <unknown> closed its connection.
2023-07-18 15:06:50: New connection from 172.30.32.2:39902 on port 1883.
2023-07-18 15:06:50: Client <unknown> closed its connection.
2023-07-18 15:08:25: Saving in-memory database to /data//mosquitto.db.
2023-07-18 15:08:50: New connection from 172.30.32.2:53086 on port 1883.
2023-07-18 15:08:50: Client <unknown> closed its connection.
2023-07-18 15:10:50: New connection from 172.30.32.2:55864 on port 1883.
2023-07-18 15:10:50: Client <unknown> closed its connection.
2023-07-18 15:12:50: New connection from 172.30.32.2:59222 on port 1883.
2023-07-18 15:12:50: Client <unknown> closed its connection.
NickM-27 commented 1 year ago

This is usually due to running multiple instances of frigate without changing the client id https://docs.frigate.video/troubleshooting/faqs#on-connect-called

NeillHerbst commented 1 year ago

How would I know if I have more than one instance? I just followed the instructions on the site for installation on Home Assistant.

NickM-27 commented 1 year ago

if for example the standard and full access addons were installed.

NeillHerbst commented 1 year ago

I only have the standard frigate addon installed at this point.

NeillHerbst commented 1 year ago

I only have the standard frigate addon installed at this point.

Frigate Log for Info:

s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service frigate-log successfully started
s6-rc: info: service nginx-log successfully started
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
2023-07-18 14:09:11.107929864  [INFO] Starting Frigate...
2023-07-18 14:09:11.112744222  [INFO] Preparing go2rtc config...
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
2023-07-18 14:09:11.140549759  [INFO] Starting NGINX...
s6-rc: info: service legacy-services successfully started
2023-07-18 14:09:11.289954295  [INFO] Got IP address from supervisor: 192.168.50.2
2023-07-18 14:09:11.461264012  [INFO] Got WebRTC port from supervisor: 8555
2023-07-18 14:09:12.328809544  [INFO] Starting go2rtc...
2023-07-18 14:09:12.552776148  16:09:12.552 INF go2rtc version 1.2.0 linux/arm64
2023-07-18 14:09:12.570102225  16:09:12.569 INF [api] listen addr=:1984
2023-07-18 14:09:12.571433479  16:09:12.571 INF [rtsp] listen addr=:8554
2023-07-18 14:09:12.573055616  16:09:12.572 INF [srtp] listen addr=:8443
2023-07-18 14:09:12.574595441  16:09:12.574 INF [webrtc] listen addr=:8555
2023-07-18 14:09:15.593621849  [2023-07-18 16:09:15] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-07-18 14:09:15.670034809  [2023-07-18 16:09:15] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-07-18 14:09:15.684058816  [2023-07-18 16:09:15] peewee_migrate                 INFO    : Starting migrations
2023-07-18 14:09:15.705526356  [2023-07-18 16:09:15] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-18 14:09:15.806429949  [2023-07-18 16:09:15] detector.cpu1                  INFO    : Starting detection process: 301
2023-07-18 14:09:15.820879338  [2023-07-18 16:09:15] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-18 14:09:15.829509627  [2023-07-18 16:09:15] frigate.app                    INFO    : Output process started: 304
2023-07-18 14:09:15.849964148  [2023-07-18 16:09:15] detector.cpu2                  INFO    : Starting detection process: 303
2023-07-18 14:09:15.870624406  [2023-07-18 16:09:15] frigate.app                    INFO    : Camera processor started for driveway_cam: 308
2023-07-18 14:09:15.903252875  [2023-07-18 16:09:15] frigate.detectors              WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
2023-07-18 14:09:15.915232104  [2023-07-18 16:09:15] frigate.app                    INFO    : Capture process started for driveway_cam: 310
2023-07-18 14:09:21.111256075  [INFO] Starting go2rtc healthcheck service...
2023-07-18 14:10:50.463308938  172.30.32.2 - - [18/Jul/2023:16:10:50 +0200] "GET / HTTP/1.1" 200 6641 "-" "HomeAssistantSupervisor/2023.07.1 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:14.395610697  172.30.32.1 - - [18/Jul/2023:16:12:14 +0200] "GET /api/stats HTTP/1.1" 200 2158 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:17.729491808  172.30.32.1 - - [18/Jul/2023:16:12:17 +0200] "GET /api/stats HTTP/1.1" 200 2158 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:17.743388410  172.30.32.1 - - [18/Jul/2023:16:12:17 +0200] "GET /api/version HTTP/1.1" 200 14 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:17.759626118  172.30.32.1 - - [18/Jul/2023:16:12:17 +0200] "GET /api/config HTTP/1.1" 200 5117 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:26.610576250  172.30.32.1 - - [18/Jul/2023:16:12:26 +0200] "GET /api/stats HTTP/1.1" 200 2158 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:34.623338147  172.30.32.1 - - [18/Jul/2023:16:12:34 +0200] "GET /api/stats HTTP/1.1" 200 2190 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:42.604319684  172.30.32.1 - - [18/Jul/2023:16:12:42 +0200] "GET /api/stats HTTP/1.1" 200 2158 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:50.486989523  172.30.32.2 - - [18/Jul/2023:16:12:50 +0200] "GET / HTTP/1.1" 200 6641 "-" "HomeAssistantSupervisor/2023.07.1 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:50.617279826  172.30.32.1 - - [18/Jul/2023:16:12:50 +0200] "GET /api/stats HTTP/1.1" 200 2158 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
2023-07-18 14:12:58.615263492  172.30.32.1 - - [18/Jul/2023:16:12:58 +0200] "GET /api/stats HTTP/1.1" 200 2158 "-" "HomeAssistant/2023.7.2 aiohttp/3.8.4 Python/3.11" "-"
NickM-27 commented 1 year ago

not sure then, something seems wrong with the mqtt broker

JensJackowski commented 1 year ago

i have exactly the same issue. i got a bunch of errors in the frigate log like this:

2023-07-31 08:11:33.145281810 [2023-07-31 10:11:33] frigate.comms.mqtt ERROR : Unable to publish to Wohnzimmer/person: client is not connected 2023-07-31 08:11:33.145430660 [2023-07-31 10:11:33] frigate.comms.mqtt ERROR : Unable to publish to Wohnzimmer/all: client is not connected 2023-07-31 08:11:37.844315112 [2023-07-31 10:11:37] frigate.comms.mqtt ERROR : Unable to publish to Schafstall/all: client is not connected 2023-07-31 08:11:38.180726196 [2023-07-31 10:11:38] frigate.comms.mqtt ERROR : Unable to publish to Schafstall/motion: client is not connected 2023-07-31 08:11:38.468941388 [2023-07-31 10:11:38] frigate.comms.mqtt ERROR : Unable to publish to events: client is not connected 2023-07-31 08:11:43.419552661 [2023-07-31 10:11:43] frigate.comms.mqtt ERROR : Unable to publish to events: client is not connected 2023-07-31 08:11:45.368433546 [2023-07-31 10:11:45] frigate.comms.mqtt ERROR : Unable to publish to Stall/all: client is not

As @NeillHerbst i have followed the installation guide useing HassOs and Frigate add-on plus the frigate integration. In the freegate UI it works finde, i can toggle recording / dection and so on. But in the integration all enteties are not available.

The mqtt section of my frigate.yalm: mqtt: host: 192.xxx.xx.132 port: 1883 user: mqtt-user password: my_password stats_interval: 60

My mqtt server seems to be working, but i am not shure under with topic frigate is pulishing. But using the testpage in the mqtt integration works just fine.

Is their any solution? Getting the enteties work is for me a core feature.

NickM-27 commented 1 year ago

@JensJackowski Frigate is not connected so check the beginning logs where frigate will say why it failed to connect. Also check the mqtt logs

JensJackowski commented 1 year ago

the problem is solved, i had a blocked port 1883 in my firewall. Verry hard to find the problem, but it was defently not frigate fault. Now it is working correct.