1 parent
1fa5d48e74
commit
aa263dc559
114 files changed
+1739
-64
No files matched your search
@@ -0,0 +1,17 @@
|
||||
# Actuators
|
||||
## ON OFF
|
||||
This module enables to actuate things by giving to a PIN a HIGH or LOW value corresponding to an MQTT topic.
|
||||
Example usage: Connect a transistor to power a relay, connect a led...
|
||||
|
||||
So as to pilot the pin use the following commands:
|
||||
|
||||
OFF command:
|
||||
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m OFF`
|
||||
|
||||
ON command
|
||||
`mosquitto_pub -t home/OpenMQTTGateway_MEGA/commands/MQTTtoONOFF -m ON`
|
||||
|
||||
## FASTLED
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# BLE gateway
|
||||
## Receiving signals from BLE beacon devices for Presence detection
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
_NOTE: HM-10 or HM-11 module needed if you are not using ESP32; configure in `user_config.h`_
|
||||
|
||||
The BT gateway module for OpenMQTTGateway enables the detection of BLE beacons and their signal strength. Generally BLE devices will not broadcast if they are paired so you may need to ensure your beacons is unpaired before it will be seen by the gateway.
|
||||
|
||||
If beacons are detected the gateway will periodically publish messages to MQTT (beacons must not be paired, see above):
|
||||
|
||||
```
|
||||
home/OpenMQTTGateway/BTtoMQTT/45E174126E00 {"id":"45:e1:74:12:6e:00","rssi":-89,"distance":21.51847,"servicedata":"fe0000000000000000000000000000000000000000"}
|
||||
```
|
||||
```
|
||||
home/OpenMQTTGateway/BTtoMQTT/C7FaaD132C00 {"id":"c7:fa:ad:13:2c:00","rssi":-68,"distance":2.799256,"servicedata":"drfgdrgdsrgesrdgdrgdregesrgtrhtyhtfyhdtyhh"}
|
||||
```
|
||||
|
||||
The subtopic after `home/BTtoMQTT/` is the MAC address of the Bluetooth low energy beacon. The rssi value is the [RSSI signal level](https://www.metageek.com/training/resources/understanding-rssi.html) from which you may deduce the relative distance to the device.
|
||||
Consider the distance as a beta featuer as currently we are not retrieving the emitting power of the beacon to make it more accurate.
|
||||
|
||||
Note that you can find apps to simulate beacons and do some tests like [Beacon simulator](https://play.google.com/store/apps/details?id=net.alea.beaconsimulator)
|
||||
|
||||
IOS version >=10 devices advertise without an extra app a mac address, nevertheless this address [changes randomly](https://github.com/1technophile/OpenMQTTGateway/issues/71) and cannot be used for presence detection. You must install an app to advertise a fixed MAC address.
|
||||
|
||||
|
||||
## Receiving signals Mi Flora/ Mi jia device/ LYWDS02, ClearGrass or Mi scale
|
||||
So as to receive BLE sensors data you need either a simple ESP32 either an ESP8266/arduino + HM10/11 with firmware >= v601
|
||||
The mi flora supported firmware is >3.1.8
|
||||
|
||||
Verify that your sensor is working with the App and update it with the last software version.
|
||||
You should see in your MQTT broker the following data:
|
||||

|
||||
|
||||
Note that the gateway return one or two measurement value each time. The different measures depending on the devices are:
|
||||
* Lux
|
||||
* Temperature
|
||||
* Moisture
|
||||
* Fertilization
|
||||
* Weight
|
||||
* Impedance
|
||||
* Battery (mi jia only)
|
||||
|
||||
The infos will appear like this on your MQTT broker:
|
||||
|
||||
`home/OpenMQTTGateway/BTtoMQTT/4C33A6603C79 {"hum":"52.6","tem":"19.2"}`
|
||||
|
||||
More info are available on [my blog](https://1technophile.blogspot.fr/2017/11/mi-flora-integration-to-openmqttgateway.html) (especially about how it was implemented with HM10)
|
||||
|
||||
## Setting a white or black list
|
||||
A black list is a list of mac adresses that will never be published by OMG
|
||||
to set black list
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/set -m '{"black-list":["012314551615","4C6577889C79","4C65A6663C79"]}'`
|
||||
|
||||
A white list is a list of mac adresses permitted to be published by OMG
|
||||
to set white list
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/set -m '{"white-list":["012314551615","4C65A5553C79","4C65A6663C79"]}'`
|
||||
|
||||
Note: if you want to filter (white or black list) on BLE sensors that are auto discovered, you need to wait for the discovery before applying the white or black list
|
||||
|
||||
## Setting the time between scans and force a scan
|
||||
|
||||
If you want to change the time between readings you can change the interval by MQTT, if you want the BLE scan every 66seconds:
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/set -m '{"interval":66000}'`
|
||||
|
||||
you can also force a scan to be done by the following command:
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/set -m '{"interval":0}'`
|
||||
|
||||
Once done the previous value of interval will be recovered.
|
||||
|
||||
## Other
|
||||
|
||||
To check your hm10 firmware version upload a serial sketch to the nodemcu (this will enable communication directly with the hm10) and launch the command:
|
||||
`AT+VERR?`
|
||||
|
||||
More info about HM-10 is [available here](http://www.martyncurrey.com/hm-10-bluetooth-4ble-modules/)
|
||||
@@ -0,0 +1,25 @@
|
||||
# GSM 2G gateway
|
||||
## Receiving SMS from 2G
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
`mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your SMS by sending an SMS to the phone number of the A6/A7 SIM card you will see :
|
||||
|
||||
```
|
||||
home/OpenMQTTGateway/2GtoMQTT {"phone":"+33123456789","date":"2018/04/22,16:17:51+02","message":"Hello OpenMQTTGateway"}
|
||||
```
|
||||
|
||||
## Send data by MQTT to send an SMS message with A6/7
|
||||
|
||||
`sudo mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTto2G -m '{"phone":"+33123456789","date":"2018/04/22,16:17:51+02","message":"hello"}'`
|
||||
|
||||
This command will send by SMS the sentence "hello" and use the phone number 0123456789
|
||||
|
||||
Arduino IDE serial data received when publishing data by MQTT
|
||||
|
||||

|
||||
|
||||
Arduino IDE serial data received when receiving SMS
|
||||
|
||||

|
||||
+120
@@ -0,0 +1,120 @@
|
||||
# IR gateway
|
||||
There is two methods for finding the IR codes you want to replicate:
|
||||
1. Point the remote control to an IR receiver see [Receiving data from IR signal](#receiving-data-from-ir-signal) & [Send data by MQTT to convert it on IR signal](#send-data-by-mqtt-to-convert-it-on-ir-signal)
|
||||
2. Find the code corresponding to your devices with IR global cache database https://irdb.globalcache.com/ see [Send data by MQTT from Global cache database to convert it on IR signal](#send-data-by-mqtt-from-global-cach%C3%A9-database-to-convert-it-on-ir-signal)
|
||||
|
||||
Here is the [List of protocols](https://docs.google.com/spreadsheets/d/1rTDZIG8rm0dSf4vP7HdTdM4-aRY1nDWH4jK28_WRwHQ/edit?usp=sharing) supported by OMG, even if your device brand is not in the list you can still use raw IR data or GlobalCache database.
|
||||
|
||||
## Receiving data from IR signal
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
`mosquitto_sub -t +/# -v`
|
||||
And press your IR remote control in front of the receiver led you should see the following messages for example:
|
||||
|
||||
```
|
||||
home/OpenMQTTGateway/IRtoMQTT {"value":875849879,"protocol":7,"bits":32,"raw":"4534,4432,612,518,614,516,616,1618,618,1616,618,512,618,1618,608,524,612,518,616,514,618,512,616,1618,616,1618,618,514,616,1618,616,514,616,514,618,512,616,1618,618,1618,618,514,610,1622,616,514,618,514,614,516,616,1618,618,512,618,512,618,1616,550,580,618,1616,612,1624,618,1616,618"}
|
||||
```
|
||||
|
||||
To receive big dump of raw data you need first to modify the [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L41) and uncomment DumpMode true
|
||||
|
||||
To know the name of the protocol corresponding to the number X (X=7 in our case), go to IRRemote header file definition and go to the protocol number X, RC5 = 1, RC6 = 2...
|
||||
[For ESP8266](https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRremoteESP8266.h)
|
||||
[For Arduino](https://github.com/z3t0/Arduino-IRremote/blob/master/IRremote.h)
|
||||
For number 7 it is samsung protocol
|
||||
|
||||
Unknown protocols are filtered by default, if you want to see the unknown protocols set into [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/master/config_IR.h)
|
||||
`#define pubIRunknownPrtcl true` instead of false
|
||||
|
||||

|
||||
|
||||
You can take this code and try to reproduce it with the gateway either by using [decimal value](#send-data-by-mqtt-to-convert-it-on-ir-signal) or the [raw value](#send-raw-ir-data-by-mqtt).
|
||||
|
||||
## Send data by MQTT to convert it on IR signal
|
||||
With the IR gateway you need to put on the topic the protocol you want to use to send the signal, the different protocols implemented are the following, the MQTT keyword to include is between "":
|
||||
* IR_GC
|
||||
* IR_Sony
|
||||
* IR_COOLIX
|
||||
* IR_Whynter
|
||||
* IR_NEC
|
||||
* IR_DISH
|
||||
* IR_Sharp
|
||||
* IR_SAMSUNG
|
||||
* IR_RC5
|
||||
* IR_RC6 (ESP8266 only)
|
||||
* IR_MITSUBISHI (ESP8266 only)
|
||||
* IR_GICABLE (ESP8266 only)
|
||||
* IR_MITSUBISHI2 (ESP8266 only)
|
||||
* IR_LASERTAG (ESP8266 only)
|
||||
* IR_CARRIER_AC (ESP8266 only)
|
||||
* IR_MIDEA (ESP8266 only)
|
||||
* IR_NIKAI (ESP8266 only)
|
||||
* IR_SHERWOOD (ESP8266 only)
|
||||
* IR_DENON (ESP8266 only)
|
||||
* IR_AIWA_RC_T501 (ESP8266 only)
|
||||
* IR_JVC (ESP8266 only)
|
||||
|
||||
Exhaustive list [here](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1910001295)
|
||||
|
||||
For example if I want to send a command to a sony TV you can use the following command:
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"value":551489775,"protocol_name":"IR_Sony "}'`
|
||||
|
||||
The code after the -m represent the payload you want to send.
|
||||
|
||||
If you don’t want to use special parameters for IR just use value key, the protocol per default is IR_NEC
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"value":551489775}'`
|
||||
|
||||
NOTE: on arduino Uno most of the protocols are not enable per default due to memory constraints (it is not the case for MEGA), to enable them go to [user_config.h](https://github.com/1technophile/OpenMQTTGateway/blob/master/main/User_config.h) and uncomment the #define corresponding the protocols you want:
|
||||
|
||||
```C++
|
||||
//#define IR_COOLIX
|
||||
//#define IR_Whynter
|
||||
//#define IR_LG
|
||||
//#define IR_Sony
|
||||
//#define IR_DISH
|
||||
//#define IR_RC5
|
||||
//#define IR_Sharp
|
||||
#define IR_SAMSUNG
|
||||
```
|
||||
## Send data by MQTT from Global Caché database to convert it on IR signal
|
||||
|
||||
The website https://irdb.globalcache.com/ contains an important database of IR codes of various devices brand. By registering and asking the code you will receive a code as the example below:
|
||||
|
||||
```
|
||||
code1: sendir,1:1,1,38000,1,69,340,169,20,20,20,20,20,64,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,64,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,1544,340,85,20,3663
|
||||
```
|
||||
|
||||
Extract this part of the code:
|
||||
```
|
||||
38000,1,69,340,169,20,20,20,20,20,64,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,64,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,64,20,64,20,64,20,64,20,64,20,64,20,1544,340,85,20,3663
|
||||
```
|
||||
|
||||
and publish it to mqtt with the a subject containing IR_GC:
|
||||
```
|
||||
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"raw":"38000,1,1,171,171,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,64,21,21,21,21,21,21,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,64,21,21,21,21,21,21,21,21,21,64,21,64,21,64,21,21,21,64,21,64,21,64,21,64,21,1114","protocol_name":"IR_GC"}'
|
||||
```
|
||||
|
||||
You should be able to command your devices without having listened with the IR receiver or if your protocol is unknown by the IRremote library
|
||||
|
||||
## Send data by MQTT with advanced IR parameters
|
||||
IR sending support two advanced parameters; bits length and repeat number.
|
||||
|
||||
The example below will send the following advanced parameters bits: 14 and repeat:4 times for a sony protocol:
|
||||
```
|
||||
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"value":551489775,"protocol_name":"IR_NEC","repeat":4,"bits":14}'
|
||||
```
|
||||
|
||||
## Send raw IR data by MQTT
|
||||
|
||||
2) If you use an arduino UNO enable `IR_Raw` by uncommenting the line 129 in user_config.h
|
||||
`#define IR_Raw`
|
||||
If you are using the uno you will have to comment other gateway like ZgatewayRF, ZgatewayBT and ZgatewayIR to keep enough memory
|
||||
|
||||
3) publish your code like below
|
||||
```
|
||||
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"raw":"8850,4450,600,550,550,550,600,1600,600,550,600,500,600,500,600,550,600,500,600,1650,600,1600,600,550,600,1600,600,1650,600,1600,600,1650,600,1600,600,550,600,500,600,550,550,1650,600,500,600,550,600,500,600,550,550,1650,600,1650,550,1650,600,550,550,1650,600,1650,550,1650,600,1650,600","protocol_name":"IR_Raw"}'
|
||||
```
|
||||
|
||||
## Repeat the IR signal OpenMQTTGateway receive
|
||||
So as to repeat the IR signal received by the gateway once set the following parameter to true in [config_IR.h](https://github.com/1technophile/OpenMQTTGateway/blob/091b317660fd201a30e2cd0e15424a13c5a6bd71/config_IR.h#L37)
|
||||
`#define repeatIRwMQTT true`
|
||||
@@ -0,0 +1,36 @@
|
||||
# LORA gateway
|
||||
## Receiving data from LORA signal
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your LORA signals by using another TTGO LORA module, you can flash the sender program from [this repository](https://github.com/LilyGO/TTGO-LORA32-V2.0)
|
||||
|
||||
Once one board flashed with OMG and the other with the sender program you should receive regular packets.
|
||||
|
||||
## Send data by MQTT to convert it on LORA signal
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoLORA -m '{"message":"test8"}'`
|
||||
|
||||
This command will send by LORA the message "test8" and use the default parameters defined in [config_LORA.h](https://github.com/1technophile/OpenMQTTGateway/blob/4b8d28179b63ae3f3d454da57ec8c109c159c386/config_LORA.h#L32)
|
||||
|
||||
If you want to test that your sending works you can use another TTGO LORA module, you can flash the receiver program from [this repository](https://github.com/LilyGO/TTGO-LORA32-V2.0)
|
||||
|
||||
## Send data by MQTT with advanced LORA parameters
|
||||
|
||||
LORA sending support the following parameters that should be specified in the json message;
|
||||
* txpower: 2 to 20
|
||||
* spreadingfactor: 6 to 12. If a spreading factor of 6 is set, implicit header mode must be used to transmit and receive * * packets.
|
||||
* frequency: 433E6, 866E6, 915E6
|
||||
* signalbandwidth: 7.8E3, 10.4E3, 15.6E3, 20.8E3, 31.25E3, 41.7E3, 62.5E3, 125E3, and 250E3
|
||||
* codingrate: 5 to 8
|
||||
* preamblelength: 6 to 65535
|
||||
* syncword: byte
|
||||
* enablecrc: boolean
|
||||
|
||||
More info on where the LORA library is born [@sandeepmistry](https://github.com/sandeepmistry/arduino-LoRa/blob/master/API.md#radio-parameters)
|
||||
|
||||
Example:
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoLORA -m '{"message":"test8","txpower":17,}'`
|
||||
|
||||
will make LORA use the a txpower of 17 when sending the message "test8"
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
|
||||
# RF gateways (433mhz/315mhz)
|
||||
|
||||
Note that for the moment RF, RF2 and Pilight can not be activated on the same boards together.
|
||||
|
||||
## RCSwitch based gateway
|
||||
|
||||
### Receiving data from RF signal
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your RF signals by pressing a remote button or other and you should see :
|
||||
|
||||
`home/OpenMQTTGateway/433toMQTT {"value":1315156,"protocol":1,"length":24,"delay":317}`
|
||||
|
||||
### Send data by MQTT to convert it on RF signal
|
||||
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTto433" -m '{"value":1315156}'`
|
||||
|
||||
This command will send by RF the code 1315156 and use the default parameters (protocol 1, delay 350)
|
||||
|
||||
Arduino IDE serial data received when publishing data by MQTT
|
||||
|
||||

|
||||
|
||||
We see that the Arduino receive the value 1315156 on the MQTT subject "MQTTto433" and send the data by RF
|
||||
|
||||
Arduino IDE serial data received when receiving data by 433Mhz
|
||||
|
||||

|
||||
|
||||
### Send data by MQTT with advanced RF parameters
|
||||
|
||||
RF sending support three advanced parameters; bits length, RF protocol and RF pulselength
|
||||
if you want to use a different RCswitch protocol put inside your payload the protocol number 2, "protocol":2.
|
||||
|
||||
if you want to use a pulselength 315 put inside your topic "delay":315
|
||||
|
||||
if you want to use a bits number different than 24 put inside your topic "length":24 for example
|
||||
|
||||
Example:
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTto433" -m '{"value":1315156,"protocol":2,"length":24,"delay":315}'`
|
||||
will make RCSwitch use the protocol 2 with a pulselength of 315ms and a bits number of 24
|
||||
|
||||
### Repeat the RF signal OpenMQTTGateway receive
|
||||
So as to repeat the RF signal received by the gateway once set the following parameter to true in config_RF.h
|
||||
|
||||
`#define repeatRFwMQTT true`
|
||||
|
||||
### Repeat the RF signal several times
|
||||
You can add a "repeat" key/value to the MQTTto433 JSON message to override the default number of repeats.
|
||||
|
||||
Example:
|
||||
`home/OpenMQTTGateway/commands/MQTTto433 {"value":1315156,"protocol":1,"length":24,"delay":317, "repeat":10}`
|
||||
|
||||
## Pilight gateway
|
||||
|
||||
### Receiving data from RF signal
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your RF signals by pressing a remote button or other and you will see :
|
||||
|
||||

|
||||
|
||||
### Send data by MQTT to convert it on RF signal
|
||||
**ON**
|
||||
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoPilight" -m '{"message":"{\"systemcode\":12,\"unitcode\":22,\"on\":1}","protocol":"elro_400_switch"}'`
|
||||
|
||||
**OFF**
|
||||
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoPilight" -m '{"message":"{\"systemcode\":12,\"unitcode\":22,\"off\":1}","protocol":"elro_400_switch"}'`
|
||||
|
||||
Theses commands will send by RF the signals to actuate an elro_400 switch
|
||||
|
||||
## RF with SONOFF RF BRIDGE
|
||||
### Receiving data from RF signal
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your RF signals by pressing a remote button or other and you will see:
|
||||
```
|
||||
home/OpenMQTTGateway/SRFBtoMQTT {"raw":"2B660186042E00E7E5","value":"59365","delay":"1111","val_Thigh":"390","val_Tlow":"1070"}
|
||||
```
|
||||
|
||||
The first parameter is the raw value extracted from the RF module of the Sonoff bridge. The data are in hexadecimal and correspond to the details below:
|
||||
https://www.itead.cc/wiki/images/5/5e/RF_Universal_Transeceive_Module_Serial_Protocol_v1.0.pdf
|
||||
OpenMQTTGateway process the raw value to extract the other decimal values that can be reused to reproduce a signal (raw value can also be reused).
|
||||
|
||||
NOTE: currently the device doesn't receive correct values from Switches remote control
|
||||
|
||||
### Send data by MQTT to convert it on RF signal
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSRFB" -m '{"value":1315156}'`
|
||||
|
||||
This command will send by RF the code 1315156 and use the default parameters:
|
||||
Repeat = 1
|
||||
Low time= 320
|
||||
High time= 900
|
||||
SYNC = 9500
|
||||
|
||||
### Send data by MQTT with advanced RF parameters
|
||||
|
||||
RF bridge sending support four advanced parameters; Repeat, Low time, High time & Sync
|
||||
if you want to repeat your signal sending put into your json payload "repeat":2, 2 means 2 repetitions of signal
|
||||
|
||||
if you want to use a low time of 315 put inside your json payload "Tlow":315
|
||||
|
||||
if you want to use a high time of 845 put inside your json payload "Thigh":845
|
||||
|
||||
if you want to use a sync time of 9123 put inside your json payload "Tsyn":9123
|
||||
|
||||
Example:
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoSRFB/Tlow_315/Thigh_845/Tsyn_9123 -m '{"value":"33151562","delay":"9123","val_Thigh":"845","val_Tlow":"315"}'`
|
||||
will make RF Bridge send a signal with the use of listed parameters 315, 845, 9123...
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoSRFB/Raw -m '{"raw":"267A013603B6140551"}'`
|
||||
will make RF Bridge send a signal with the use of advanced parameters defined in the raw string
|
||||
|
||||
## RF2 gateway KAKU
|
||||
RF2 gateway enables to send command to RF devices with the KAKU protocol. DIO chacon devices are an example.
|
||||
It uses the same pinout as the RF gateway and both gateways can be used on the same setup.
|
||||
|
||||
Receiving RF codes with the KAKU protocol is not compatible with ZgatewayRF , so as to get the code of your remotes you should comment ZgatewayRF in user_config.h.
|
||||
Transmitting can be done with both ZgatewayRF and ZgatewayRF2
|
||||
|
||||
### Receiving data from KAKU signal
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your RF signals by pressing a remote button or other and you will see :
|
||||
|
||||
`home/OpenMQTTGateway/RF2toMQTT {"unit":0,"groupBit":0,"period":273,"address":8233228,"switchType":0}`
|
||||
|
||||
### Send data by MQTT to convert it on KAKU signal
|
||||
|
||||
Once you get the infos publish the parameters with mqtt like that for off:
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoRF2 -m "{"unit":0,"groupBit":0,"period":273,"address":8233228,"switchType":0}"`
|
||||
|
||||
for on:
|
||||
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoRF2 -m "{"unit":0,"groupBit":0,"period":273,"adress":8233228,"switchType":1}"`
|
||||
@@ -0,0 +1,37 @@
|
||||
# RFM69 gateway
|
||||
|
||||
The RFM69 gateway enables to send and receive signal from/to another RFM69 module. It is based on the work of @bbx10 https://github.com/bbx10/nanohab
|
||||
|
||||
### Receiving data from RFM signal
|
||||
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
Generate your RF signals with an Moteino on other RFM69 based devices, you will receive :
|
||||
|
||||
`home/OpenMQTTGateway/RFM69toMQTT 60,-98,0`
|
||||
|
||||
In this case "60,-98,0" is the signal sent by another RFM69 + a wemos D1 with the sample sketch [rfm69send](https://github.com/1technophile/rfm69send/blob/master/rfm69send.ino) loaded in it.
|
||||
|
||||
### Send data by MQTT to convert it on RFM69 signal
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoPilight" -m '{"data":"test"}'`
|
||||
|
||||
This command will send by RFM69 the string *test* to the default receiver id 99
|
||||
|
||||
### Send data by MQTT with advanced RFM69 parameters
|
||||
|
||||
RFM69 sending support one advanced parameters the target receiver ID.
|
||||
|
||||
Example:
|
||||
SimplePublishing
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoRFM69/RCV_34 -m 33151562`
|
||||
will make the gateway send to the receiver ID 34 (node number) instead of 99
|
||||
|
||||
JsonPublishing
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoRFM69 -m '{"data":1315156,"receiverid":34}'`
|
||||
This command will send by RFM69 the string *test* to the receiver id 34 instead of 99
|
||||
|
||||
### RFM69 acknowledgment
|
||||
Unlike RF or IR RFM69 as a complete acknowledgment mechanism. When a signal is sent the RFM69 can acknowledge the fact that the recipient received the message.
|
||||
In this case the gateway will publish the sent message to the topic defined by subjectGTWRFM69toMQTT macro.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Sensors
|
||||
Subscribe to all the messages with mosquitto or open your MQTT client software:
|
||||
|
||||
` sudo mosquitto_sub -t +/# -v`
|
||||
|
||||
### ADC
|
||||
The value is between 0 and 1024 and is tranmitted via Mqtt when it changes.
|
||||
`home/OpenMQTTGateway/DHTtoMQTT {"value":543}`
|
||||
|
||||
### DHT
|
||||
You will receive every TimeBetweenReadingDHT (set into config_DHT.h) the DHT measurement (30s per default).
|
||||
|
||||
`home/OpenMQTTGateway/DHTtoMQTT {"temp":21,"hum":51}`
|
||||
|
||||
If you want to don't resend value when it is the same you can set dht_always = false in config_DHT.h
|
||||
Reference in new issue
Block a user