Software to distribute RFlink data

Moderators: rtenklooster, Voyager, BertB, Stuntteam

Post Reply
Message
Author
fabianonline
New user
Posts: 3
Joined: 09 Jul 2017, 20:15

Software to distribute RFlink data

#1 Post by fabianonline » 09 Jul 2017, 20:34

Hi all.

I've written a piece of software for myself and am wondering if it could be useful for others as well. So before doing lots of work to make it "publishable", I want to ask if anyone is even interested in this. ;-)

So I'm using RFlink with Home Assistant. But there were a few things I didn't like: Firstly, no other software can use the Home Assistant data, because only one connection to a USB device is possible. Secondly, I would like to "repair" or "correct" data before sending it to other apps.

So I wrote a small ruby app. It basically does three things at the same time: It allows multiple clients to connect via TCP. All clients will get the unmodified data from RFlink and are able to send commands back to RFlink. It will output the "repaired" data in JSON format on STDOUT, so that logspout can grab that data and stuff it into my elasticsearch database. And it will feed the "repaired" and "corrected" data in a nice topic structure (see below) to a MQTT server, while also accepting commands via MQTT. This is so that I can use MQTT sensors and stuff in Home Assistant instead of the TCP connection stuff.

"Repaired" means for now that data from my cheap chinese D026 clones, which sometimes is (predictably) corrupt, will be repaired. "Corrected" means, that shortly after an "ON" command from a doorbell, an "OFF" command will be pretended to be received. Also, it will add rain_diff and is_raining fields to the reports from my rain sensor.

So, is anyone interested in this stuff? Or should I just keep this abonimation of an app for myself? ;-)


By the way, the topic structure and data at the MQTT server looks like this:

Code: Select all

rflink/temperature/Oregon Temp/D610/temp 24.7
rflink/temperature/Oregon Temp/D610/bat LOW
rflink/temperature/Oregon Temp/D610/timestamp 1499625137
rflink/rain/Alecto V5/00b6/temp 24.9
rflink/rain/Alecto V5/00b6/rain 32.4
rflink/rain/Alecto V5/00b6/rain_diff 0.0
rflink/rain/Alecto V5/00b6/is_raining false
rflink/rain/Alecto V5/00b6/bat OK
rflink/rain/Alecto V5/00b6/timestamp 1499625156
rflink/temperature/Eurochron/0001/temp 25.4
rflink/temperature/Eurochron/0001/hum 45
rflink/temperature/Eurochron/0001/timestamp 1499625169
rflink/temperature/LaCrosse/0103/temp 26.1
rflink/temperature/LaCrosse/0103/timestamp 1499625171
rflink/rain/Alecto V5/00b6/temp 24.7
rflink/rain/Alecto V5/00b6/rain 32.4
rflink/rain/Alecto V5/00b6/rain_diff 0.0
rflink/rain/Alecto V5/00b6/is_raining false
rflink/rain/Alecto V5/00b6/bat OK
rflink/rain/Alecto V5/00b6/timestamp 1499625204
rflink/temperature/Oregon Temp/D610/temp 24.6
rflink/temperature/Oregon Temp/D610/bat LOW
rflink/temperature/Oregon Temp/D610/timestamp 1499625215
rflink/switch/Eurodomest/0cd1c9/03 ON
rflink/switch/Eurodomest/0cd1c9/timestamp 1499625215

timoline
Normal user
Posts: 22
Joined: 03 Jul 2016, 10:17

Re: Software to distribute RFlink data

#2 Post by timoline » 10 Jul 2017, 06:55

intrestring, I used a little different approach with node, mqtt, influxdb and grafana And for rules engine Nools
Here's my rflonk 3 mqtt node code
https://github.com/timoline/node-rflink

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests