"Unable to Connect to Frigate" when installing Frigate Integration

I am new to Home Assistant and this forum so please forgive me if this has been asked before or I am making some noobie mistake.

'I am using Home Assistant 2021.2.1 on a 4GByte Raspberry Pi. I would like to integrate some IP cameras with person detection so I am trying to install Frigate. I have added the Frigate Repository version 1.0.3 to HACS and installed the Mosquitto MQTT broker.
However, when I try to add the Frigate Integration under /configuration/integrations I get “Unable to Connect to Frigate”. I have tried using the host http://localhost:5000 and http://frigate:5000 but in both cases I get the same message.

The log file gives me the following messages:

*Logger: custom_components.frigate*
*Source: custom_components/frigate/api.py:90*
*Integration: Frigate ([documentation](https://github.com/blakeblackshear/frigate), [issues](https://github.com/blakeblackshear/frigate-hass-integration/issues))*
*First occurred: 11:33:04 AM (4 occurrences)*
*Last logged: 11:37:42 AM*
** Error fetching information from http://frigate:5000/api/stats - Cannot connect to host frigate:5000 ssl:default [Try again]*
** Error fetching information from http://localhost:5000/api/stats - Cannot connect to host localhost:5000 ssl:default [Connect call failed ('127.0.0.1', 5000)]*
** Error fetching information from http://10.0.0.214:5000/api/stats - Cannot connect to host 10.0.0.214:5000 ssl:default [Connect call failed ('10.0.0.214', 5000)]*
** Error fetching information from http://ccab4aaf-frigate:5000/api/stats - Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Try again]*

And

Logger: custom_components.frigate
Source: custom_components/frigate/config_flow.py:84
Integration: Frigate ([documentation](https://github.com/blakeblackshear/frigate), [issues](https://github.com/blakeblackshear/frigate-hass-integration/issues))
First occurred: 11:33:04 AM (4 occurrences)
Last logged: 11:37:42 AM
* Cannot connect to host frigate:5000 ssl:default [Try again]
* Cannot connect to host localhost:5000 ssl:default [Connect call failed ('127.0.0.1', 5000)]
* Cannot connect to host 10.0.0.214:5000 ssl:default [Connect call failed ('10.0.0.214', 5000)]
* Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Try again]

Any help would be greatly appreciated.

2 Likes

I just ran into the same issue myself. I’m running Frigate in Docker and it turns out my image was outdated. It didn’t have the /api endpoint so the integration couldn’t connect. Updating the image and configuration file fixed it for me. Configuration file needed to be updated because the newer image expects a slightly different format.

Thanks for the response. I am not using Docker as I am using the HACS repository for Frigate. I have the latest version of that repository (version 1.0.3) but there is no configuration file because I can’t get as far as installing the Frigate integration. It bombs out with “Unable to Connect” when I try.
I hope someone can help me as it is driving me crazy!

Make sure you’re using the 0.8.1 docker image listed here… the HACS integration only works with 8.0+. Make sure to update your config too if moving from an older version. The config is completely different. Also, the code listed above must also be running somewhere… the integration doesn’t install that as far as I know so you may also need the docker container.

Docker containers: https://hub.docker.com/r/blakeblackshear/frigate/tags?page=1&ordering=last_updated

Thanks but I am somewhat confused because I am not using a Docker container. My understanding from the Frigate documentation was that if I used the HACS integration I just installed the repository and then did Frigate integration (the step that is failing for me). I am not even sure if the Raspberry Pi version of Home Assistant includes Docker.
The code listed in the Log file above is running in python files which are installed in /config/custom_components/frigate. This directory and the scripts in it are installed when you add the HACS repository.

According to the documenation, you have to start the addon container in step 4 so if you don’t have the home assistant os with the add on store, you will need to install the container yourself along with mqtt. If you do have the add on store, you will have to go to that addon tab and start the container there.

have you managed to find a solution?

Yes, here are the instructions (with acknowledgement to @blakeblackshear and https://github.com/paularmstrong):
Here’s a step-by-step for those using Home Assistant OS (which the Frigate documentation in Reference 1 refers to as HassOS):

  • from the left side nav of Home Assistant, click “Supervisor”.
  • Around the center-top of the page, click “Add-on Store”
  • At the far right top of this page, three vertical dots will appear. Click this
  • From the dropdown that appears, click “Repositories”
  • At the bottom of the new modal that appears, paste https://github.com/blakeblackshear/frigate-hass-addons into the input box that says “Add repository”, then click “Add”
  • Close this modal
  • Under “Frigate Hass.io addons”, click “Frigate NVR”
  • On this new page, you should see a button near the bottom-left of the main content that says “Install” click this.
  • Before starting the add-on, you’ll need to create a frigate.yml file in your Home Assistant configuration directory. Follow the format specified in the Frigate docs here: https://blakeblackshear.github.io/frigate/configuration/index
  • Now you should be ready to start the Frigate add-on. Head back to the Supervisor section, click “Frigate” and then “Start”
  • In order to get Home Assistant to actually have sensors and receive data from Frigate, you’ll want to install the integration (via HACS or manually). (note: integrations are also sometimes called “custom components”)
5 Likes

Hi, after experimenting a long time with doods I would like to try this other way … but … the whole afternoon I have struggled to install this addon with no success neither with hacs nor through adding the repository as you described, i.e. i’m not able to find what you say on point #8 I simply don’t have this “Frigate addons" nowhere. Would you mind giving me another hint. Thank you

As I am not sure what you have already done, forgive me if I ask questions which you have already considered. So:

  1. Did you follow the instructions at https://blakeblackshear.github.io/frigate/ ?
    2 Did you create the frigate.yml file (note yml not yaml - I am not sure if that makes a difference but it may)?
    3 Did you enable MQTT by installing and setting up the Mosquitto broker?
    4 Did you install the Frigate integration?

I also found that I had to reboot the server a couple of times before I got it working.
I hope that helps

First of all many thanks for having been so quick with the reply. Then, for the time being, the problem seems to have been solved, in fact I almost by chance I stumbled upon its solution. Upon adding the repository https://github.com/blakeblackshear/frigate-hass-addons the addon shows up only after refreshing the page … as I said I discovered it by pure luck as I never used this procedure to install addons. Now it’s time to start some experiment to see in which way it differs from doods, as a matter of fact it seems to have a completely other way to be handled. Again thank you :slight_smile:

1 Like

Hi I to having the same problem installing Frigate. I have got the point where the addon installed in store, I created /Config/frigate.yml but receiving error in Frigate NVR * Starting nginx nginx ...done. Error parsing config: expected a dictionary textlog,
Can you advise where i have gone wrong.

Thanks in advance

I have been able to install the Frigate NVR addon and hopefully the config/config.yml is correctly , however when i start the addon it will not load, As I have following log errors

* Starting nginx nginx
   ...done.
Error parsing config: while parsing a block mapping
  in "<unicode string>", line 3, column 2:
     mqtt:
     ^
expected <block end>, but found '<scalar>'
  in "<unicode string>", line 8, column 4:
       client_id:frigateaddon
  
    ^

Here is a copy of my yml file :

`mqtt:

   host:192.168.0.45
   port:1883
 # topic_prefix: frigateaddon
   client_id:frigateaddon
   user:mqtt
   password:mqtt
 
 
  back
   ffmpeg:
   imput: 
    - path:rtsp://viewer:[Frigate_RTSP_PASSWORD}210.01.10.10:554/cam/realmonitor?channel=1&subtype=5
    roles:
    - detect:
    - rtmp:
    width:1280
    height:720
    fps:5

I am running HA on VM on a iMac and it is difficult to copy and paste and i find it difficult to find where the problems lies. any advice and help would be appreciated

Hi Hope you can help me `I have beeb able install Frigate NVR and creates Config.Frigate.yml in config directory. However the addon will not startras it loads with errors .

* Starting nginx nginx
   ...done.
Error parsing config: while parsing a block mapping
  in "<unicode string>", line 3, column 2:
     mqtt:
     ^
expected <block end>, but found '<scalar>'
  in "<unicode string>", line 8, column 4:
       client_id:frigateaddon
  
    ^

Here is a copy of my yml file :

`mqtt:

   host:192.168.0.45
   port:1883
 # topic_prefix: frigateaddon
   client_id:frigateaddon
   user:mqtt
   password:mqtt
 
 
  back
   ffmpeg:
   imput: 
    - path:rtsp://viewer:[Frigate_RTSP_PASSWORD}210.01.10.10:554/cam/realmonitor?channel=1&subtype=5
    roles:
    - detect:
    - rtmp:
    width:1280
    height:720
    fps:5

Can you confirm what ai m doing wrong based on your config. any help would be appreciated.

Hi - you seem to have a single quote (’) in front of the mqtt: line which I do not think should be there.

I installed and configured everything today so it should all be current. It works but I am getting the error described in the original post:

2021-05-17 10:47:32 ERROR (MainThread) [custom_components.frigate] Error fetching information from http://ccab4aaf-frigate:5000/api/stats - Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Try again]
2021-05-17 10:47:32 ERROR (MainThread) [custom_components.frigate] Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Try again]

I am using the Home Assistant Blue and everything is up to date.
Given that everything seems to work I am confused as to why I am getting the error.

EDIT: I see it mentions ssl:default and I am not using SSL. May this have something to do with it?

Hey Michal, you figured that one out? I have exactly the same issue since today.

hi,
i installed frigate step by step via >

I am getting issue as>
Failed to to call /supervisor/options - Invalid Add-on repository!

12:12:35 PM – (ERROR) Home Assistant Supervisor

Error fetching information from http://ccab4aaf-frigate:5000/api/stats: Cannot connect to host ccab4aaf-frigate:5000 ssl:default [Try again]

September 27, 2021, 11:36:42 AM – (ERROR) frigate (custom integration) - message first occurred at September 27, 2021, 11:32:31 AM and shows up 3 times

ok Frigate has to be installed first … separately before integration plugin … the doc is pretty confusing.

1 Like

I have frigate installed and running on Hassio. Also have HACS to install the integrations but when I try to configure the integration, I get this failed to connect error