Replies: 5 comments 2 replies
-
Home Assistant (HA) is not dicussed here or any other home automation. But maybe parts of my configuration (rtl > homebridge > Apple HomeKit) can help. I use a config file at "retain" is in my opinion not useful in this scenario. It means that the mqtt-broker caches the data and as soon a new client subscribe to that topic, it will deliver this (meanwhile maybe OLD) data. While HA should be constantly subscribing, there is no need for retaining/caching this data. For homebridge it is the easiest way to use "devices", because you get seperate topics for each data field. With "event" you get a single JSON-datablock each time your rtl receives data. "states" brings you statistics every x minutes (see report_meta stats). But you can combine multiple mqtt-outputs by seperating with comma or set multiple output-lines:
as command line it should be: Here is the output of mosquitto_sub for a weather sensor. the first 8 lines are the 'devices'-lines and the last one the 'events'-line
If rtl_433 knows your contact sensor there should be a topic field kinda |
Beta Was this translation helpful? Give feedback.
-
Much appreciated, thanks!
Hmm, maybe I understand this wrong. Say, my window sensors only send updates when opening/closing a window. Say I open a window once a month. If I restart Home Assistant, it would not know the state until I open/close the window. With retain=1, MQTT broker would have cached the previous result and I get the latest state. Is this thinking wrong?
Thanks for the explanation. Seems this is default then. I do not give any argument to mqtt but I still get
I know this is again more HA (possibly homebridge?) specific; could these be of any use for HA? Or is "devices" everything I should make use of? Do you use any By the way, the documentation suggests to use |
Beta Was this translation helpful? Give feedback.
-
Here's the YAML for the main open/close sensor for one of my DSC sensors:
Note: I've been using that definition for a year or two, so it may not reflect the current state of Hass features, like trigger based sensors. Also I'm not sure whether
You don't need to run autodiscovery all the time -- it actually isn't recommended. I believe I put notes in the README about running the script and having it post to a different topic. so you see what it creates and use it as a template. I do recommend hand editing the YAML config so you can edit the names, device classes. (Door vs. window vs. smoke vs ...), and even model.
First, before we get into retain, the piece you are missing is that the DSC (and other security sensors), resend their current state periodically as a heartbeat -- both the monitor that the device is still alive and can be received and to refresh state in case any messages were lost. There is an event field that will be false on heartbeats. Most DSC sensors in this family send heartbeats around once per hour. (There are a few models of sensors that send heartbeats only every 72 - 84 minutes based on my observations. These are made by another company for DSC.) Your understanding of retain is correct, when connecting/subscribing to the MQTT broker, with retain off, you won't get anything from MQTT until there is another update. With retain on, when you connect/subscribe, you will get the current state of those topics from the MQTT broker. So in this case retain is desirable, but there are drawbacks. The primary drawback with retain on is that everything device the rtl_433 hears will have a permanent set of topics created under (Note: The above is the primary reason why many don't recommend e autodiscovery script full-time, you'll have to clean up falsely created sensors in Home Assistant too.) One alternative would be to use a custom rtl_433 -> MQTT bridge, and in the bridge set retain based on some criteria like model, known devices, etc. Just curious, do you also have a DSC panel? If so, have you integrated it into Home Assistant? Finally there is more active discussion of Home Assistant configuration for rtl_433 over on the community forum: |
Beta Was this translation helpful? Give feedback.
-
Ugh, my mistake sorry, that is actually JSON because I've been keeping all of the MQTT configs in MQTT, so to Home Assistant they are autodiscovered. For what it is worth, I edit these using the MQTT Explorer client/GUI, which is really useful for any MQTT work. I also set retain when editing/publishing them from MQTT Explorer. When I run the auto-discovery script, I have it configured to publish to a different topic name
Adding
That's what this does, it ties the entities together into a device. You'll get a device page where you'll be able to see the entities and also a link to MQTT info for the device.
Yes. exactly. They will be individual binary sensor entities, mapped to one device.
Not in Home Assistant. My automations all just look for the state changes on the closed and tamper sensors. So in Hass, all I care is that it changed. I asked about the DSC panel (ADT resold them at some point) because I was wondering if you had connected it to Home Assistant. I have the DSC sensors because I have a DSC panel. I'm using an Envisalink to connect the panel to Home Assistant. The DSC panel connects to central station monitoring which makes my home owner's insurance company happy.
I don't think there is anything special about those magnets. If you open the sensor, you'll see there is just a reed switch inside. Maybe that sensor is just dead?
Those are the small/slimline sensors. They are actually made by a different company. After there has been activity, those devices send a different bit on the next heartbeat. You can use that to determine if the last message you saw was not an event, you missed an event, possibly because it was being interfered with. |
Beta Was this translation helpful? Give feedback.
-
This is a very intriguing approach! Then I wouldn't need to restart HASS if I change config. I think I'll move towards this approach.
I think my question was the difference to I am setting
Must have done something wrong then. I'll try this again
:-) I got SimpliSafe for free but fortunately they don't require me to sign up for it. I rather build this myself. Sorry, did not connect the old panel to HA; actually not even sure how to turn it on... EDIT: Maybe the devices do not work for me because data comes from a YAML in my case?
|
Beta Was this translation helpful? Give feedback.
-
While I really love the configurability of rtl433 with mqtt etc I have a real hard time figuring out how to get my DSC contact sensors into HA (using a "best practice approach"). I decided do not want to use the auto configuration script (since my setup won't change much).
The documentation only shows a temperature/humidity sensor.
I am really confused what I should use as mqtt parameter (retain, devices, etc) and how my yaml section would like like.
Since I have dozens of sensors with the same structure, I'd like to have one line to get all of them. The documentation makes use of "+" but doesn't show how the names are dynamically created.
Would anyone be so kind sharing their rtl433 command line and their yaml section showing how the contact sensor is mapped properly into HA?
Beta Was this translation helpful? Give feedback.
All reactions