tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
569 stars 103 forks source link

No devices found for location ID #692

Closed Tomcatter31 closed 1 year ago

Tomcatter31 commented 1 year ago

Describe the Bug

Ring Devices are not being discovered.

Steps to Reproduce

Restart Home Assistant - MQTT Ring wil not detect devices

Expected Behavior

Ring MQTT Detects devices

Log Output

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/ring-mqtt.sh
-------------------------------------------------------
| Ring-MQTT with Video Streaming                      |
| Addon for Home Assistant                            |
|                                                     |
| For support questions please visit:                 |
| https://github.com/tsightler/ring-mqtt/discussions  |
-------------------------------------------------------
cont-init: info: /etc/cont-init.d/ring-mqtt.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 ring-mqtt (no readiness notification)
s6-rc: info: service legacy-services successfully started
-------------------------------------------------------
ring-mqtt.js version: 5.5.1
Node version v18.17.0
NPM version 9.1.2
git version 2.38.5
-------------------------------------------------------
Running ring-mqtt...
2023-07-30T01:32:20.613Z ring-mqtt Detected runmode: addon
2023-07-30T01:32:20.614Z ring-mqtt Configuration file: /data/options.json
2023-07-30T01:32:21.540Z ring-mqtt Reading latest data from state file: /data/ring-state.json
2023-07-30T01:32:21.541Z ring-mqtt Succesfully started the token generator web UI
2023-07-30T01:32:21.542Z ring-mqtt Configured MQTT Host: 192.168.1.4
2023-07-30T01:32:21.542Z ring-mqtt Configured MQTT Port: 1883
2023-07-30T01:32:21.542Z ring-mqtt Configured MQTT User: admin
2023-07-30T01:32:21.542Z ring-mqtt Configured MQTT password: <hidden>
2023-07-30T01:32:21.542Z ring-mqtt MQTT URL: mqtt://admin:********@192.168.1.4:1883
2023-07-30T01:32:21.572Z ring-mqtt Attempting connection to Ring API using saved refresh token...
2023-07-30T01:32:24.013Z ring-mqtt Successfully established connection to Ring API using saved token
2023-07-30T01:32:24.014Z ring-mqtt Received updated refresh token
2023-07-30T01:32:24.014Z ring-mqtt Saving updated refresh token to state file
2023-07-30T01:32:25.029Z ring-mqtt Successfully saved updated state file: /data/ring-state.json
2023-07-30T01:32:26.014Z ring-mqtt Attempting connection to MQTT broker...
2023-07-30T01:32:26.131Z ring-mqtt MQTT connection established, processing Ring locations...
2023-07-30T01:32:28.414Z ring-mqtt ------------------------------------------------------------------------------------------
2023-07-30T01:32:28.414Z ring-mqtt This account has access to the following locations:
2023-07-30T01:32:28.414Z ring-mqtt            Palm Bay (5703d294-4252-48ce-b78e-10217daf36dd)
2023-07-30T01:32:28.414Z ring-mqtt                                                                                           
2023-07-30T01:32:28.414Z ring-mqtt IMPORTANT: If *ANY* alarm or smart lighting hubs at these locations are *OFFLINE* 
2023-07-30T01:32:28.414Z ring-mqtt            the device discovery process below will hang and no devices will be    
2023-07-30T01:32:28.415Z ring-mqtt            published!                                                             
2023-07-30T01:32:28.415Z ring-mqtt                                                                                           
2023-07-30T01:32:28.415Z ring-mqtt            If the message "Device Discovery Complete!" is not logged below, please
2023-07-30T01:32:28.415Z ring-mqtt            carefully check the Ring app for any hubs or smart lighting devices    
2023-07-30T01:32:28.415Z ring-mqtt            that are in offline state and either remove them from the location or  
2023-07-30T01:32:28.415Z ring-mqtt            bring them back online prior to restarting ring-mqtt.                  
2023-07-30T01:32:28.415Z ring-mqtt                                                                                           
2023-07-30T01:32:28.415Z ring-mqtt            If desired, the "location_ids" config option can be used to restrict   
2023-07-30T01:32:28.415Z ring-mqtt            discovery to specific locations. See the documentation for details.    
2023-07-30T01:32:28.415Z ring-mqtt ------------------------------------------------------------------------------------------
2023-07-30T01:32:28.415Z ring-mqtt Starting Device Discovery...
2023-07-30T01:32:28.415Z ring-mqtt                                                                                           
2023-07-30T01:32:28.415Z ring-mqtt New location: Palm Bay (5703d294-4252-48ce-b78e-10217daf36dd)
2023-07-30T01:32:32.420Z ring-mqtt                                                                                           
2023-07-30T01:32:32.420Z ring-mqtt Device Discovery Complete!
2023-07-30T01:32:32.420Z ring-mqtt ------------------------------------------------------------------------------------------
2023-07-30T01:32:35.421Z ring-mqtt No devices found for location ID 5703d294-4252-48ce-b78e-10217daf36dd

Screenshots

No response

Config File

mqtt_url: mqtt://admin:PASS@192.168.1.4:1883
mqtt_options: ""
livestream_user: adminww
livestream_pass: PASS
disarm_code: "1234"
enable_cameras: true
enable_modes: true
enable_panic: true
branch: addon
debug: ring-*
location_ids:
  - ""
  - 5703d294-4252-48ce-b78e-10217daf36dd
snapshot_mode: disabled
beam_duration: 0
mqtt_host: 192.168.1.4
mqtt_port: "1883"
mqtt_user: adminww
mqtt_password: Pass
ring_token: ""

Install Type

Home Assistant - Hassos

Version

2023.8.0b1

Operating System

HASSOS - Operating System 10.4

Architecture

X86_64

Machine Details

Physical X86_64 Machine

Tomcatter31 commented 1 year ago

Have checked all bridges / cameras are online - This was working before I moved to 2023.8.B01 build flawlessly

Have also tried to authenticate the instance

tsightler commented 1 year ago

Are you using the primary Ring account or a secondary account? I'd suggest removing the extra, empty value in locaton_ids, but I don't think that would actually cause a problem.

Unfortunately, other than logging into the Ring web dashboard with the same account and verifying devices are visibile there, I don't have much in the way of ideas. The code which lists devices is stupid simple, a single API call to Ring which returns JSON describing the devices, that's it. There's not much to go on if that API returns no devices.

Sn00kiT commented 1 year ago

I have the same problem with my Intercom. Reauthentification didn´t work so i deleted all Clients in the Web Dashboard of Ring and did a new authentification. It seems that the Home Assistant isn´t recognized and supported anymore in Ring. When it still worked, the Dashboard showed the devices as Python or with the name of Addon itself. This is no longer the case: 2023-07-30 12_04_10-Kontrollzentrum

keithr59 commented 1 year ago

Have checked all bridges / cameras are online - This was working before I moved to 2023.8.B01 build flawlessly

Have also tried to authenticate the instance

@Tomcatter31 Have you tried going back to HA Core 2023.7.to see if it fixes your issue as I believe that 2023.8 has introduced some breaking changes to MQTT, although I don't know if these changes would impact this add on.

tsightler commented 1 year ago

I'd ask that we please not confuse issues with HA vs ring-mqtt.

@Sn00kiT Your issue is confusing, you talk about Python, which is HA native Ring integration, not ring-mqtt. If you really have the same symptom as here, please provide logs showing ring-mqtt listing no devices and please share what devices you have.

@Tomcatter31 posted logs from ring-mqtt that show it being unable to discover devices, that can't really be impacted by anything in HA, so it's unlikely to be related to HA at all. I guess it would be interesting to know what devices @Tomcatter31 actually has at that location.

Tomcatter31 commented 1 year ago

Apologies for the delay.

I am using my primary account on the ring account.

I have the following:

Ring alarm with roughly 10 - 12 window sensors - 1x zwave extender - 2x keypads 1x doorbell pro 2x indoor cams 1x stick up cam (solar) 2x spotlight cam solar (1 with the pro solar panel) 1x ring light bridge 1x floodlight solar 1x hallway chime

The cameras are on a mix of my own wifi and the wifi from the hallway chime, which is on my guest wifi due to the coverage of the "main" wifi

I checked all of the devices, none have gone offline at all during the testing on this.

I went ahead and removed the the installation of ring-mqtt and reinstalled - logging in with the same account - all is well again

tsightler commented 1 year ago

Thanks for sharing. It's not really clear to me how re-installing could possibly resolve a problem like this. There ring-mqtt image is a static image, there are only two data files which are stored on /data, not in the image itself. The config file, and the state file. The config file is generated by HA and you posted it, and the state file contains the refresh token and some device specific user settings but could not impact device discovery.

Regardless, glad you got it working. Ring has had a ton of issues over the last 48 hours, even though they've only acknowledged a single 2.5 hour outage to this point. Perhaps it was somehow related.

Sn00kiT commented 1 year ago

I'd ask that we please not confuse issues with HA vs ring-mqtt.

@Sn00kiT Your issue is confusing, you talk about Python, which is HA native Ring integration, not ring-mqtt. If you really have the same symptom as here, please provide logs showing ring-mqtt listing no devices and please share what devices you have.

@Tomcatter31 posted logs from ring-mqtt that show it being unable to discover devices, that can't really be impacted by anything in HA, so it's unlikely to be related to HA at all. I guess it would be interesting to know what devices @Tomcatter31 actually has at that location.

I simply reinstalled the addon and it did work again, but maybe just a coincidence with outage on the ring side. Now it shows the correct connection on the ring web site

safetymonkey commented 1 year ago

I know this issue is closed, but I wanted to call out that I had this exact same issue when I upgraded to the official 2023.8.0 version last night, so I expect this may impact a lot of people. I had a little difficulty finding the remedy suggestion which ultimately worked (uninstall and reinstall the add-on), so you may want to consider throwing up a notice in the README or docs just to head off more folks opening issues.

tsightler commented 1 year ago

Uninstall and re-install is pretty much never required because the container literally stores no data, it's completely static. The only thing re-installing does is basically wipe out the refresh token and delete all the saved, device specific settings, assuming you had any.

Resetting the token can be done by simply stopping the addon, removing the authorized device from Ring Control Center, starting the addon and re-authenticating.

However even that is rarely needed, ~95% of issues can be solved by simply restarting the addon, which I feel like almost nobody does because they think restarting Home Assistant restarts addons as well, which it doesn't.

None of that is likely directly related to upgrading HA, that was probably just the catalyst for finding that the addon was already misbehaving.