Ring doorbell

Maybe I do need the JS sooner then expected :expressionless:

Every time I run the code I need to re-enter my credentials :pensive:

Would somebody be so kind to publish a step-by-step for Python or JS version for less technically inclined folks here? :slight_smile:

Hi,

I struggled to integrate my ring cams as well. Until I came across this nice little piece of work. And that guy also provides a maintained docker container on dockerhub.

Using this, integration of my ring cams was a breeze. Only drawback ist, that I do not have live video. only events and snapshots. But for my purpose that is ok.

If you enable homeassisstant plugin, the channels will even be discovered automatically.

hope this helps,
Lars

1 Like

Lars, this is absolutely amazing, thank you for your find!
I was able to configure access to Ring, it just works!
I can see all security devices and cameras!
Now on to tinkering and figuring out what to do with all of it! :slight_smile:

Spoke too soon - auto-discovered Ring devices show up in the Inbox, but cannot be added.
@Lars_Deutsch did you have to configure homeassisstant plugin in any way?
I know that mqtt broker is working well - I am using it for zigbee without issues, plus devices are discovered

Thank you!

yes, I had to add the homeassistant binding for auto configuration, but you can just spy on the messages sent via MQTT and configure it in a things file. That is what I did at first.

I would also be interested in using Ring with openhab.
Wouldn’t the web interface be an option using the http binding?

Edit number 2 or 3, I managed to get it working. @Lars_Deutsch , thank you again for the lead.
I suspect the core issue is that ring-mqtt does not put “retain” flag on configuration messages.
As a result components only get discovered and configured when ring-mqtt is restarting and re-publishes the configuration messages.
I need to read-up if there is a way to brute-force “retain” flag on a set of mqtt channels.

Here is the basic sequence of steps:

  • Install and configure MQTT broker
  • Install and run ring-mqtt. Note that if you are running it through docker, docker instance will have a different IP, so you need to direct ring-mqtt to true IP address of your MQTT broker (vs. localhost)
  • Install mqtt binding, it will enable homeassistant discovery and support by the default
  • Restart ring-mqtt instance - this will push configuration messages and they will be read by openhab
  • At this point you should see ring devices being auto-discovered, try adding one
  • Thing for device will show up, but will be in “unknown” state and without channels
  • Restart ring-mqtt AGAIN - at this point openhab will read device-specific config messages
  • Now newly added Thing will show up as being online and with all channels
  • Repeat as needed

Thoughts on simplifying the process are very welcome!

Thanks all!

Could you provide some screenshots please?

Hey Angelo, see my post above, try that sequence!

Here is follow-up on ring-mqtt message board: https://github.com/tsightler/ring-mqtt/issues/240#issuecomment-905974725. In short, discovery in the current configuration does not work reliably


I’ve noticed that my things go and stay offline or various not online states when I restart OpenHAB until I then restart ring-mqtt but they all seem to work anyway. I bet that’s part of the same problem too, but I think fixable with a rule on startup

1 Like

What would the rule do, terminate ring-mqtt instance and create a new one?

According to the GitHub issue you linked, all we need to do is publish offline and online messages to the homeassistant/status topic to have it re send the config messages so that’s all we should need to do if I understand properly

edit:
Here’s the rule I put together that does just that. Running it manually forces ring-mqtt to re-send all the config topics as well

triggers:
  - id: "1"
    configuration:
      startlevel: 100
    type: core.SystemStartlevelTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      type: application/python
      script: |-
        mqttActions = actions.get("mqtt","mqtt:broker:mqttBroker")
        mqttActions.publishMQTT("homeassistant/status", "online")
    type: script.ScriptAction

Also, while the ring-mqtt doesn’t appear to listen for “offline” on the homeassistant/status topic, I configured my mqtt broker to send it anyway out of caution

1 Like

Now if I could only get my auto configured ring locks to stop throwing this in the log that would be great

[ab.binding.mqtt.generic.ChannelState] - Command 'LOCKED' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType.LOCKED

Setting a map on the channel or not having the channel linked at all doesn’t seem to make a difference and it still reports anyway

Not only locks, I am getting a very similar message from window/door sensors:

[WARN ] [t.generic.ChannelStateTransformation] - Executing the JINJA-transformation failed: An error occurred while transformation. Argument named 'default_value' is required but missing for filter default
[WARN ] [ab.binding.mqtt.generic.ChannelState] - Command ' OFF ' not supported by type 'OnOffValue': No enum constant org.openhab.core.library.types.OnOffType. OFF

Any thoughts?

How is that channel configured ?

Somehow you get an OFF command with leading space which cannot be transformed


Given that channels and maps are fully auto-discovered, it implies that it’s either (a) issue with OpenHab discovery process of HomeAssistant elements, or (b) ring-mqtt does not provide the right specification for it’s channels


This is perfect!