All Projects → piotrC4 → mqtt-rflink-bridge

piotrC4 / mqtt-rflink-bridge

Licence: other
Homie based bridge between MQTT and RFlink module

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to mqtt-rflink-bridge

homie-control
A high level application for the Homie-esp8266 IoT framework
Stars: ✭ 40 (+90.48%)
Mutual labels:  homie
sonoff-homie
Homie based software for Sonoff module
Stars: ✭ 25 (+19.05%)
Mutual labels:  homie
homie-device
NodeJS port of Homie for IoT
Stars: ✭ 20 (-4.76%)
Mutual labels:  homie
SenseoWifi
Wifi'ify the Senseo coffee maker. Circuit and firmware for an internal Senseo hack to monitor and control the daily coffee brew (via MQTT) ☕️📶
Stars: ✭ 73 (+247.62%)
Mutual labels:  homie
SuperLEDstrip
No description or website provided.
Stars: ✭ 13 (-38.1%)
Mutual labels:  homie
mqtt-433mhz-gateway-homie
433Mhz <-> MQTT gateway for smart home 🏡 automation
Stars: ✭ 37 (+76.19%)
Mutual labels:  homie
ComfoAirQ-Homie
Homie4 for Zehnder ComfoAirQ
Stars: ✭ 14 (-33.33%)
Mutual labels:  homie
mijia-homie
A Homie MQTT bridge for the Xiaomi Mijia 2 hygrometer-thermometer. This repo also serves as the monorepo for a handful of helper crates related to Homie and Bluetooth.
Stars: ✭ 40 (+90.48%)
Mutual labels:  homie
microhomie
MicroPython implementation of the Homie MQTT convention for IoT.
Stars: ✭ 72 (+242.86%)
Mutual labels:  homie
espRFLinkMQTT
ESP8266 gateway between RFLink and MQTT server
Stars: ✭ 72 (+242.86%)
Mutual labels:  rflink
RFLink
RFLink for ESP, with MQTT client
Stars: ✭ 52 (+147.62%)
Mutual labels:  rflink

Homie based bridge MQTT to RFLink module

Features:

  • publish via MQTT in JSON format message received from RFlink gateway
  • send to RFlink gateway message received via MQTT
  • All Homie buildin features (OTA,configuration)

Limitations

  • Too long messages (mostly debug) may not be published - error message will be published

Connections

  • Do standard RFlink wiring
  • Connect RFLink to ESP8266
    • Arduino MEGA TX (D1) to ESP8266 Soft Serial RX (GPIO14/D5) via logic level shifter 5V->3,3V or voltage divider (use 200Ohm and 470Ohm resistors)
    • Arduino MEGA RX (D0) to ESP8266 Soft Serial TX (GPIO5/D1)

schematic

alt text

MQTT messages

Property Message format Direction Description
_HOMIE_PREFIX_/_node-id_/serial01/to-send/set See [RFlink protocol reference](http://www.nemcon.nl/blog2/protref) Controller → Device
_HOMIE_PREFIX_/_node-id_/serial01/publish-mode/set (RAW|JSON|STANDARD) Controller → Device Set publishing methods
_HOMIE_PREFIX_/_node-id_/serial01/_device_name_ See below JSON message format section Device → Controller
_HOMIE_PREFIX_/_node-id_/$online (true|false) Device → Controller /true when the device is online, false when the device is offline (through LWT)

Message format

  • JSON Message received from RFLink is converted to JSON array. Each field is converted to array element. Name is used in topic name.

RFlink message: 20;1B;Keeloq;ID=e311;SWITCH=0A;CMD=ON;BAT=OK; will be published in topic: HOMIE_PREFIX/node-id/serial01/Keeloq with value {"msgIdx":"12","ID":"e331","SWITCH":"01","CMD":"ON","BAT":"OK"}

  • RAW Message recived from RFLink is published as is. Used in debug.

  • STANDARD Message received from RFLink is converted to JSON array partialy RFlink message: 20;1B;Keeloq;ID=e311;SWITCH=0A;CMD=ON;BAT=OK; will be published in topic: HOMIE_PREFIX/node-id/serial01/Keeloq/e331 with value {"SWITCH":"01","CMD":"ON","BAT":"OK"}

Examples of usage

  • Sending RF - Publish to HOMIE_PREFIX/node-id/serial01/to-send/set value: 10;Kaku;00004d;1;OFF;
  • Turn on RFDEBUG - Publish to HOMIE_PREFIX/node-id/serial01/to-send/set value: 10;RFDEBUG=ON;
  • PING RFLink module - Publish to HOMIE_PREFIX/node-id/serial01/to-send/set value: 10;PING;. Response will be published in topic HOMIE_PREFIX/node-id/serial01/PONG

Usage with OpenHAB

  • STANDARD format
    • create rflink.items file:
    Group gRFLink
    String rfLinkKeeloq
            "Keeloq message [%s]" (gRFLink)
            {mqtt="<[mosquitto:_HOMIE_PREFIX_/_node-id_/serial01/Keeloq/1111:state:default]"}
    • create keeloq.rules file:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule keeloqUpdate
when
        Item rfLinkKeeloq received update
then
        var String SWITCH = transform("JSONPATH", "$.SWITCH", Message)
        var String CMD = transform("JSONPATH", "$.CMD", Message)
        var String BAT = transform("JSONPATH", "$.BAT", Message)
        if (SWITCH=="01" && CMD=="ON")
        {
                // When button was pressed log it
                logInfo("keeloq","Received message from keeloq")
        }
end
  • JSON format
    • create rflink.items file:
Group gRFLink
String rfLinkKeeloq
        "Keeloq message [%s]" (gRFLink)
        {mqtt="<[mosquitto:_HOMIE_PREFIX_/_node-id_/serial01/Keeloq:state:default]"}
  • create keeloq.rules file:
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*

rule keeloqUpdate
when
        Item rfLinkKeeloq received update
then
        var String Message = rfLinkKeeloq.state.toString
        var String ID = transform("JSONPATH", "$.ID", Message)
        var String SWITCH = transform("JSONPATH", "$.SWITCH", Message)
        var String CMD = transform("JSONPATH", "$.CMD", Message)
        var String BAT = transform("JSONPATH", "$.BAT", Message)

        if (ID=="1111" && SWITCH=="01" && CMD=="ON")
        {
                // When button was pressed log it
                logInfo("keeloq","Received message from keeloq")
        }
end
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].