Giter Club home page Giter Club logo

Comments (6)

tsightler avatar tsightler commented on August 16, 2024

I wanted to do this because after a power outage, this addon loads faster than the mqtt addon.

While I can agree this should probably be fixed, I'm more interested in this described issue because this should not be a problem. The script is designed to start without MQTT being started and simply wait for it (it's a feature of the script for a very long time and logs that the MQTT broker is unreachable). Only once the MQTT broker starts and the connection is established does it being to publish data. Connection monitoring of MQTT has been since the early says of the script.

I just tested this behavior in my lab setup of Hass.io by setting the MQTT on manual start and leaving ring-mqtt on autostart (so obviously ring-mqtt starts before MQTT broker). The addon properly logged that the MQTT broker was unreachable and continues to log it's reconnection attempts. After 120 seconds I started the MQTT broker and indeed, ring-mqtt script/addon connected to MQTT broker immediately and started publishing data. About 60 seconds later it appeared in the UI, no automations needed.

If you are seeing different behavior you should describe it so that it can be fixed. No automations should be required.

from ring-mqtt.

Pabsilon avatar Pabsilon commented on August 16, 2024

Ok, so I gave it some time after a restart and the ring alarm is still unavailable.
The log seems like there was actually an mqtt connection:

2020-02-26T17:44:38.932Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/alarm_control_panel/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/alarm_state disarmed
2020-02-26T17:44:38.934Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/alarm_control_panel/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/attributes {"tamper_status":"ok"}
2020-02-26T17:44:38.936Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz/motion_state ON
2020-02-26T17:44:38.937Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz/attributes {"battery_level":100,"tamper_status":"ok"}
2020-02-26T17:44:38.940Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/motion_state OFF
2020-02-26T17:44:38.941Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/attributes {"battery_level":100,"tamper_status":"ok"}
2020-02-26T17:44:38.944Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/motion_state ON
2020-02-26T17:44:38.945Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/attributes {"battery_level":100,"tamper_status":"ok"}
2020-02-26T17:44:48.006Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/motion_state ON
2020-02-26T17:44:48.006Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/attributes {"battery_level":100,"tamper_status":"ok"}
2020-02-26T17:45:31.272Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/cccccccc-cccc-cccc-cccc-cccccccccccc/motion_state OFF
2020-02-26T17:45:31.274Z ring-mqtt ring/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/alarm/binary_sensor/cccccccc-cccc-cccc-cccc-cccccccccccc/attributes {"battery_level":100,"tamper_status":"ok"}

In the end, following an add-on restart, the ring alarm becomes available again.

from ring-mqtt.

Pabsilon avatar Pabsilon commented on August 16, 2024

I've done another reboot for other reasons and now it worked.
The log output for the ring addon is identical. I have yet to determine why this happens.

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

Yep, the log above clearly shows that ring-mqtt had made the connection and was sending config and state updates.

By any chance did the reboot where it didn't work involve an upgrade? The script actually sends the discovery data 10 times, once every 30 seconds, after in connects to MQTT, but I've noticed that recent Hass.io upgrades are starting to take quite a long time for the service to start (I think they took almost 4 minutes on my RPi3B last week). Maybe I should extend the time after initial startup.

Also, did you configure the recommended mqtt birth messages. The script listens for these to know when Home Assistant itself has connected to MQTT and is ready to receive messages, but if you don't set this up there's no way for the script to know.

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

Also, you might want to rebuild your addon if you installed in the last few days. There was one minor bug that could have caused devices to be set to "offline" status even when they were online. I just committed a fix for that yesterday. I don't think your particular case would have been impacted by it (it was more if the connection to Ring had gone online then offline) but maybe it could be in there. You don't have to do anything other than click the "Rebuild" option in the addon and restart it to get the latest code.

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

I changed the slug to use an underscore because I agree that this was a good idea due to the issue you noted so I'm going to go ahead and close this.

If you continue to have issues with devices not showing after a reboot please feel free to open an issue on the Github page for the addon because it is definitely expected to work in all cases without manual or automated restarts, it's a design goal.

from ring-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.