Docs vuepress (#476)

Convert docs to vuepress
This commit is contained in:
Florian authored and GitHub committed 2019-10-30 22:15:40 +01:00
1 parent 1fa5d48e74
commit aa263dc559
114 files changed
+1739 -64

No files matched your search

+32 -15
View File
@@ -23,21 +23,38 @@
#
# Template #1: General project. Test it using existing `platformio.ini`.
#
matrix:
include:
- language: python
python: 2.7
language: python
python:
- "2.7"
sudo: false
cache:
directories:
- "~/.platformio"
sudo: false
cache:
directories:
- "~/.platformio"
install:
- pip install -U platformio
- platformio update
- rm /home/travis/build/1technophile/OpenMQTTGateway/main//User_config.h
- cp /home/travis/build/1technophile/OpenMQTTGateway/test/Test_config.h /home/travis/build/1technophile/OpenMQTTGateway/main//User_config.h
install:
- pip install -U platformio
- platformio update
- rm /home/travis/build/1technophile/OpenMQTTGateway/main//User_config.h
- cp /home/travis/build/1technophile/OpenMQTTGateway/test/Test_config.h /home/travis/build/1technophile/OpenMQTTGateway/main//User_config.h
script:
- platformio run
script:
- platformio run
- language: node_js
node_js:
- lts/*
install:
- npm install -g vuepress
script:
- npm run docs:build
before_deploy: echo "docs.openmqttgateway.com" >> docs/.vuepress/dist/CNAME
deploy:
provider: pages
skip-cleanup: true
local_dir: docs/.vuepress/dist
github-token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository
keep-history: true
on:
branch: development
+91
View File
@@ -0,0 +1,91 @@
module.exports = {
markdown: {
lineNumbers: true
},
title: 'OpenMQTTGateway',
description: 'One gateway, many technologies',
themeConfig: {
smoothScroll: true,
repo: '1technophile/OpenMQTTGateway',
docsDir: 'docs',
docsBranch: 'development',
lastUpdated: 'Last Updated',
editLinks: true,
nav: [
{ text: 'Blog', link: 'https://1technophile.blogspot.com'},
{ text: 'Docs', link: '/'},
{ text: 'Community', link: 'https://community.openmqttgateway.com', target:'_self', rel:''},
{ text: 'Devices', link: 'https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=2126158079'}
],
sidebar: [
['/','0 - What is it for 🏠'],
{
title: '1 - Prerequisites🧭', // required
path: '/prerequisites/devices/', // optional, which should be a absolute path.
//collapsable: true, // optional, defaults to true
sidebarDepth: 1, // optional, defaults to 1
children: [
'prerequisites/devices',
'prerequisites/board',
'prerequisites/broker',
'prerequisites/controller']
},
{
title: '2 - Set it up 🔨', // required
path: '/setitup/rf', // optional, which should be a absolute path.
sidebarDepth: 1, // optional, defaults to 1
children: [
'setitup/rf',
'setitup/ble',
'setitup/ir',
'setitup/lora',
'setitup/gsm',
'setitup/sensors',
'setitup/actuators'
]
},
{
title: '3 - Upload ➡️', // required
path: '/upload/binaries', // optional, which should be a absolute path.
sidebarDepth: 1, // optional, defaults to 1
children: [
'upload/binaries',
'upload/pio'
]
},
{
title: '4 - Use ✈️', // required
path: '/use/rf', // optional, which should be a absolute path.
sidebarDepth: 1, // optional, defaults to 1
children: [
'use/rf',
'use/ble',
'use/ir',
'use/lora',
'use/gsm',
'use/rfm69',
'use/sensors',
'use/actuators'
]
},
{
title: '5 - Integrate 🎉', // required
path: '/integrate/openhab2/', // optional, which should be a absolute path.
sidebarDepth: 1, // optional, defaults to 1
children: [
'integrate/openhab2',
'integrate/home_assistant',
'integrate/node_red'
]
},
{
title: '6 - Participate 💻', // required
sidebarDepth: 1, // optional, defaults to 1
children: [
'CONTRIBUTING',
['https://github.com/1technophile/OpenMQTTGateway/blob/development/LICENSE.txt','License']
]
}
]
}
}
+37
View File
@@ -0,0 +1,37 @@
# Contributing
I like pull requests from everyone. By participating in this project, you
agree to follow the code of conduct below
[code of conduct]: https://github.com/1technophile/OpenMQTTGateway/blob/master/CODE_OF_CONDUCT.md
Fork the [development branch](https://github.com/1technophile/OpenMQTTGateway/tree/development), then clone the repo
Make your modification,
* If you want to add a new gateway, name it `ZgatewayXXX`, `XXX` replaced by your gateway communication type, can be more than three letters
* If you want to add a new sensor, name it `ZsensorYYY`, `YYY` replaced by your sensor type, can be more than three letters
* If you want to add a new actuator, name it `ZactuatorZZZ`, `ZZZ` replaced by your actuator type, can be more than three letters
Review your code, compile it for Arduino Uno and ESP8266
Test it localy on your hardware config
If you modify `User_config.h` during your developments you need to report your modifications into Test_config.h
https://github.com/1technophile/OpenMQTTGateway/blob/master/tests/Test_config.h
Indeed during the continuous integration process `User_config.h` is replaced by `Test_config.h`.
`Test_config.h` as much more gateway/sensors enabled for the test than the default `User_config.h`
Emit a pull request
Verify the travis CI compilation results
Request for review
I may suggest some changes or improvements or alternatives.
Some things that will increase the chance that your pull request is accepted:
* Comment your code
* Ask eventually for design guidelines
* Write a [good commit message][commit].
[commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
+28 -48
View File
@@ -1,55 +1,35 @@
# OpenMQTTGateway
OpenMQTTGateway project goal is to concentrate in one gateway different technologies, decreasing by the way the number of proprietary gateways needed and hiding the different technologies singularity behind a simple & wide spread communication protocol; [MQTT](http://mqtt.org/).
## Overview
![Overview](./img/OpenMQTTGateway.png)
OpenMQTTGateway act as a WIFI or Ethernet gateway between your 433mhz/315mhz/Infrared/BLE/GSM/GPRS devices and a MQTT broker.
OpenMQTTGateway support very mature technologies like basic 433mhz/315mhz protocols & infrared so as to make your old dumb devices "smart" and avoid you to throw then away. These devices have also the advantages of having a lower cost compared to Zwave or more sophisticated protocols.
And support also up to date technologies like Bluetooth Low Energy or LORA.
The MQTT broker can be connected to your favorite home automation controller (Home Assistant, Openhab, Domoticz) or NodeRED, as long as it supports MQTT, the system can talk to the gateway and by the way your different devices on both directions.
To have an overview of the supported PIR, door, water, smoke sensors, sirens, rings, beacons, switchs & weather stations you can take a look to the
[compatible devices list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=2126158079)
[![](https://github.com/1technophile/OpenMQTTGateway/blob/master/img/OpenMQTTGateway.jpg)](https://github.com/1technophile/OpenMQTTGateway/wiki)
With MQTT you can connect the compatible software you want, it can be an home automation controller (OpenHAB, Home Assistant, Jeedom, FHEM, Domoticz...) or another software like Node-Red.
It can be installed on:
* Arduino uno(limited)/mega(advised) + W5100
* ESP8266: NodeMCU V1.0 NodeMCU V2.0, NodeMCU V3.0, ESP8266 12F and Wemos D1
* ESP32
* Sonoff RF bridge.
It enables to:
* Send RF signals corresponding to received MQTT data (MQTT->RF)
* Publish MQTT data related to a received 433Mhz signal (RF-->MQTT)
* Send RFM69 signals corresponding to received MQTT data (MQTT->RFM69)
* Publish MQTT data related to a received RFM69 signal (RFM69-->MQTT)
* Send IR signal corresponding to received MQTT data (MQTT->IR)
* Publish MQTT data related to received IR signal (IR-->MQTT)
* Publish MQTT data related to BLE beacons or Mi flora(BT-->MQTT)
* Publish MQTT data related to received SMS (2G-->MQTT)
* Send SMS corresponding to received MQTT data (MQTT->2G)
# Use cases
With OpenMQTTGateway and a controller you can for example:
* Monitor your garden with a Mi Flora sensor and control an irrigation valve depending on the soil moisture,
* Trigger a fan depending on the temperature and humidity thanks to a Mi Jia sensor,
* Alert yourself by a controller notification if the temperature of your fridge is too high,
* Detect your beacon/smartwatch so as to trigger a special scenario when you come home,
* Detect opened door or windows and alert yourself when leaving home
* Detect water leakage or smoke
* Actionate a siren if something is going wrong
The limit is your imagination 😀
It supports also sensors; DHT, HC SR501, ADC, I2C bus, INA226, TSL2561
Or can actutate a relay.
# Functions
Behind the scene you will find functionnalities dedicated to gateways like:
* Deduplication
* Simple and lite API
* Strong integrations with libraries used
* Signal forward/repeat
* First configuration with web portal
* Whitelist & Blacklist management
## Functions:
* Bidirectional, the gateway can send and receive signals, for example if you have RF wall plug you can either control them with your home automation software (MQTT-->RF) or the physical remote control. When you press a button on the physical remote the wall plug will switch ON and the button in your home automation software (RF-->MQTT) will be updated.
* Signal duplicate removal, with RF of IR we get a lot of duplication, to avoid this the gateway is able to filter the number of code sent to the MQTT broker during a defined time `time_avoid_duplicate`.
* BLE beacons detection, the gateway publish the beacons detected thanks to an HM-10 module and publish the signal strength of each module address. By this way you can easily address presence detection of people, animals or things.
* Addons possibility, you could add directly to the gateway any sensor you want, just create a new `Z<addon> .ino` file into the gateway folder with your code and call it after `client.loop();` into `OpenMQTTGateway.ino`. The program is provided with a DHT sensor addon implementation (`ZaddonDHT.ino`)
* Advanced signal details publication, so as to know the details of what the gateway receive it publish by MQTT to `subject433toMQTTAdvanced` for RF and `subjectIRtoMQTTAdvanced `for IR the details of the signal received (this signal has to be compatible with RCSwitch and IRRemote libraries to be read).
* Acknowledgement, to be sure that the gateway received the payload from MQTT it sends an acknowledgement on a `user_defined` topic, `subjectGTWRFtoMQTT` for RF or `subjectGTWIRtoMQTT` for IR enabling to update the state of your switch or other component into your home automation.
* Multi boards compatibility, the gateway has been currently tested with **ESP8266 12F**, **NodeMCU V1**, **NodeMCU V2**, **Wemos D1 mini**, **Arduino Uno**, **ESP32** (RF and BLE gateways) and the **Arduino Mega**.
* Multi protocols handling, the gateway is based on RCSwitch, NewRemoteSwitch, RFM69, A6lib and IRRemote libraries, you can define the protocol you want to use.
* Configuration by web portal with **ESP8266** based boards
See the [wiki](https://github.com/1technophile/OpenMQTTGateway/wiki) for more information:
https://github.com/1technophile/OpenMQTTGateway/wiki
Download OpenMQTTGateway from the [releases page](https://github.com/1technophile/OpenMQTTGateway/releases)
The reference sheet, with the list of all functions, pinouts is [here](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=0)
A list of supported 433mhz devices (and others) is available [here](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=2126158079), door/window sensors, PIR sensors, smoke detectors, weather stations...
A list of compatible components to build your gateway is available [here](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277), nodemcu, esp32, emitters and receivers...
If you want to buy a coffee or other beverage so as to give me some support, here is a way to do it :
<a href="https://www.buymeacoffee.com/1technophile" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
::: warning Note
The material and information contained in this documentation is for general information purposes only. You should not rely upon the material or information on this documentation as a basis for making any business, legal or any other decisions. There is no warranty given on this documentation content. If you decide to follow the informations and materials given it is at your own risk.I will not be liable for any false, inaccurate, inappropriate or incomplete information presented on this website.
:::
-1
View File
@@ -1 +0,0 @@
theme: jekyll-theme-cayman
File renamed without changes.

Before

Width:  |  Height:  |  Size: 386 KiB

After

Width:  |  Height:  |  Size: 386 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 268 KiB

After

Width:  |  Height:  |  Size: 268 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 252 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 131 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 462 KiB

After

Width:  |  Height:  |  Size: 462 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 239 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 226 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 180 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 225 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 427 KiB

After

Width:  |  Height:  |  Size: 427 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 127 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 383 KiB

After

Width:  |  Height:  |  Size: 383 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 140 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 415 KiB

After

Width:  |  Height:  |  Size: 415 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 458 KiB

After

Width:  |  Height:  |  Size: 458 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

+98
View File
@@ -0,0 +1,98 @@
# Integrate Home Assistant
## Auto discovery
So as to enable HASS auto discovery with MQTT you have to uncomment [ZmqttDiscovery](https://github.com/1technophile/OpenMQTTGateway/blob/0180a0dbd55ed8e0799e30ee84f68070a6f478fa/User_config.h#L99) in user_config.h
And enable discovery on your MQTT integration definition in HASS.
OMG will use the auto discovery functionality of home assistant to create sensors and gateways into your HASS instance automaticaly.
## Manual integration examples
From @123, @finity,@denniz03
### Door sensor
```yaml
binary_sensor:
- platform: mqtt
name: "test"
state_topic: "home/OpenMQTTGateway/433toMQTT"
value_template: >-
{% if value_json.value == '7821834' %}
{{'ON'}}
{% elif value_json.value == '7821838' %}
{{'OFF'}}
{% else %}
{{states('binary_sensor.test') | upper}}
{% endif %}
qos: 0
device_class: opening
```
```yaml
binary_sensor:
- platform: mqtt
name: doorbell
state_topic: 'home/OpenMQTTGateway/SRFBtoMQTT'
#value_template: "{{ value_json.raw }}"
value_template: >-
{% if value_json.value == '14163857' %}
{{'ON'}}
{% else %}
{{states('binary_sensor.doorbell') | upper}}
{% endif %}
off_delay: 30
device_class: 'sound'
- binary_sensor:
platform: mqtt
name: light_back_sensor
state_topic: 'home/OpenMQTTGateway/SRFBtoMQTT'
#value_template: '{{ value_jason.value }}'
value_template: >-
{% if value_json.value == '1213858' %}
{{'ON'}}
{% else %}
{{states('binary_sensor.light_back_sensor') | upper}}
{% endif %}
off_delay: 5
- binary_sensor:
platform: mqtt
name: rf_outlet_sensor
state_topic: 'home/OpenMQTTGateway/SRFBtoMQTT'
value_template: >-
{% if value_json.value == '16766303' %}
{{'ON'}}
{% else %}
{{states('binary_sensor.rf_outlet_sensor') | upper}}
{% endif %}
```
### Motion sensor
```yaml
binary_sensor:
- platform: mqtt
name: "Bewegung_Schlafzimmer"
#device_class: motion
state_topic: "home/OpenMQTTGateway1/HCSR501toMQTT"
value_template: '{{ value_json["hcsr501"] }}'
payload_on: "true"
payload_off: "false"
```
### Switches
```yaml
#switches
switch:
- platform: mqtt
name: kaku_a2
state_topic: "home/OpenMQTTGateway/commands/MQTTto433"
command_topic: "home/OpenMQTTGateway/commands/MQTTto433"
payload_on: "16405"
payload_off: "16404"
qos: "0"
retain: true
#pushbullet
notify:
- platform: pushbullet
name: hassio
api_key: <api_key>
```
+246
View File
@@ -0,0 +1,246 @@
# Integrate Node Red
Here is a simple set of flows for integrating OpenMQTTGateway with NodeRED via an ESP8266 module.
In this example I have used a Wemos D1 Mini with some cheap RF modules.
![](https://i.imgur.com/z2RFvUw.jpg)
A flow to receive 433MHz signals into NodeRED (you will need to update the IP address of your broker)
![](https://i.imgur.com/2UWYzHg.jpg)
```json
[
{
"id": "6d1b2915.7ce798",
"type": "mqtt in",
"z": "a9a9b76b.e69998",
"name": "433MQTT",
"topic": "home/OpenMQTTGateway/433toMQTT",
"qos": "2",
"broker": "4572f098.cc1",
"x": 80,
"y": 740,
"wires": [
[
"fe53b819.4f9568"
]
]
},
{
"id": "fe53b819.4f9568",
"type": "debug",
"z": "a9a9b76b.e69998",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"x": 290,
"y": 740,
"wires": []
},
{
"id": "4572f098.cc1",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "192.168.0.56",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": ""
}
]
```
A flow to send 433MHz signals from NodeRED
![](https://i.imgur.com/PMlWyii.jpg)
```json
[
{
"id": "ff924d56.459d6",
"type": "mqtt out",
"z": "a9a9b76b.e69998",
"name": "MQTTto433",
"topic": "home/OpenMQTTGateway/commands/MQTTto433",
"qos": "",
"retain": "",
"broker": "4572f098.cc1",
"x": 610,
"y": 860,
"wires": []
},
{
"id": "6c25a2d4.6c733c",
"type": "inject",
"z": "a9a9b76b.e69998",
"name": "",
"topic": "",
"payload": "On",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 90,
"y": 840,
"wires": [
[
"7689fe88.45679"
]
]
},
{
"id": "a76d2f03.5f3",
"type": "change",
"z": "a9a9b76b.e69998",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "5510487",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 840,
"wires": [
[
"ff924d56.459d6"
]
]
},
{
"id": "7689fe88.45679",
"type": "switch",
"z": "a9a9b76b.e69998",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "On",
"vt": "str"
},
{
"t": "eq",
"v": "Off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 210,
"y": 860,
"wires": [
[
"a76d2f03.5f3"
],
[
"6a7c2c3a.567794"
]
]
},
{
"id": "7e52ec9.00dde14",
"type": "inject",
"z": "a9a9b76b.e69998",
"name": "",
"topic": "",
"payload": "Off",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 90,
"y": 880,
"wires": [
[
"7689fe88.45679"
]
]
},
{
"id": "6a7c2c3a.567794",
"type": "change",
"z": "a9a9b76b.e69998",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "4527444",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 380,
"y": 880,
"wires": [
[
"ff924d56.459d6"
]
]
},
{
"id": "20991aea.cca8a6",
"type": "comment",
"z": "a9a9b76b.e69998",
"name": "Set you RF codes here.",
"info": "",
"x": 380,
"y": 800,
"wires": []
},
{
"id": "4572f098.cc1",
"type": "mqtt-broker",
"z": "",
"name": "",
"broker": "192.168.0.56",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": ""
}
]
```
+103
View File
@@ -0,0 +1,103 @@
# Integrate OPENHAB2
## MQTT 2 manual setup >=Openhab2.4
You should have a mqtt broker installed (either mosquitto or the OpenHAB2 embedded one)
In paper UI
* In bindings add the MQTT Things binding
* Inbox > MQTT Things binding > Add manualy >MQTT Broker : configure your borker
* Inbox > MQTT Things binding > Add manualy >Generic MQTT Thing : select your previously configured broker as a bridge and enter your thing definition (example RF plug, weather station, PIR sensor)
* Configuration > Things > "Your thing" : click on + and add one channel for each thing parameter (example for a weather station, you will have one channel for the temperature, one channel for the humidity etc..)
* For a state channel define the MQTT topic like this:
## For a mi flora or mi jia temperature :
`home/+/BTtoMQTT/C47C9999D1B8`
* Click on show more
* And add in "Incoming values transformation"
`JSONPATH:$.tem`
* Click on Save
* Repeat for each channels and each things
* Configuration > Things > "Your thing" : click on a channel and add 1 or several items per channel defining what you want to display in the sitemap
or
* Define your items in an item file like this by refering to your mqtt things channels:
For a mi flora and mi jia
```java
// MI JIA
Number humidity "Humidité air[%.1f %%]" <water> {channel="mqtt:topic:dc2222e6:humidite-mijia"}
Number temperature "Température[%.1f °C]" <temperature> {channel="mqtt:topic:dc2222e6:temperature-mijia"}
Number battery "Batterie capteur[%.1f %]"<volt> {channel="mqtt:topic:dc2222e6:batterie-mijia"}
// MI FLORA
Number humidity_P "Hygrométrie plante[%.1f %%]" <water> {channel="mqtt:topic:1fb33334:humidite-miflora"}
Number temperature_P "Température plante[%.1f °C]" <temperature> {channel="mqtt:topic:1fb33334:temperature-miflora"}
Number fertility_P "Fertilité plante[%.1f uS/cm]" {channel="mqtt:topic:1fb33334:fertilite-miflora"}
Number lux_P "Luminiosité plante[%.1f lux]" {channel="mqtt:topic:1fb33334:lux-miflora"}
```
## For a switch channel, add a channel by choosing the type "On/Off switch"
define the MQTT state topic like this:
`home/+/433toMQTT`
* Click on show more
* add in "Incoming values transformation"
`JSONPATH:$.value`
* define the command topic like this:
`home/+/commands/MQTTto433`
* add the value corresponding to ON state and to OFF state
1312081
1312084
* Click on Save
* Repeat for each channels and each things
* Configuration > Things > "Your thing" : click on a channel and add 1 or several switch per channel
or
* Define your items in an item file like this by refering to your mqtt thing channel:
`Switch OMGSwitch "Prise 1" <poweroutlet> {channel="mqtt:topic:08998877:Power1"}`
# Presence detection (from @rickitaly)
in thing file:
```java
Thing mqtt:topic:omgentrance (mqtt:broker:localBroker) {
Channels:
Type string : blepresence "People Presence" [ stateTopic="home/home_presence/OpenMQTTGatewayEntrance"]
}
```
in item file
```java
String OMG_BLE_Entrance "BLE Entrance Detector" { channel="mqtt:topic:omgentrance:blepresence" }
Switch Presence_Keys_Rick "Rick's Keys" <keyring> (People, gKeys) {expire="240s,OFF"}
```
In rule file:
```java
rule "BLE Presence Detector"
when
Item OMG_BLE_Entrance received update
then
val String msg = (OMG_BLE_Entrance.state as StringType).toString
val String id = transform("JSONPATH", "$.id", msg).toString
if(id == "xx:xx:xx:xx:xx:xx")
Presence_Keys_Rick.postUpdate(ON)
end
```
+37
View File
@@ -0,0 +1,37 @@
# Board
OpenMQTTGateway is not closed to one board or type of board, by using the power of the Arduino framework and libraries that are cross compatibles it let you many choice of hardware, from an Arduino UNO to an ESP32.
You can take a look to the components sheet to have a view of [supported boards and components](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)
Moreover it supports also sensors; DHT, HC SR501, ADC, I2C bus, INA226, TSL2561
Or can actutate things (LED chipsets, relays).
Here is some information to find the board suitable for your need, you have the choice between wifi, ethernet and off the shelves devices:
Off the shelves wifi
* SONOFF RF Bridge
* Sonoff RFR3
* Sonoff Basic
* Wifi RF Gateway
![boards](../img/OpenMQTTGateway_boards_sonoff.png)
Wifi/Ethernet:
* ESP8266
* ESP32
* Arduino Mega with an ethernet shield
* Arduino Uno with an ethernet shield
![boards](../img/OpenMQTTGateway_boards.png)
Arduino + ethernet shields enables faster responsiveness of the gateway and a reliable connection.
The ESP platform is more flexible in term of installation (no need of an ethernet cable) but is less reliable in term of communication. Thanks to its higher memory and processing power it has more modules or possibilities compared to arduino Uno & Mega.
Choosing your board depends heavily on the technologies you want to use with it.
To have a good overview of the compatibilities per board you can refer to [this sheet](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1098440301).
The choice between these boards will depend on your knowledge and your requirements in terms of reliability, situation, modules wanted and devices you already have.
+20
View File
@@ -0,0 +1,20 @@
# Broker
The broker will act as an intermediary between OpenMQTTGateway and your [controller](/prerequisites/controller), it can be seen as a centralized hub at the heart of your automation system. It carry on messages following a publish / subscribe mechanism.
All the events or commands could pass by the broker.
There is many choice of brokers, here is some of the most populars:
* [Mosquitto](https://mosquitto.org/) (Open source)
* [Moquette](https://moquette-io.github.io/moquette/) (Open source)
* [HiveMQ](https://www.hivemq.com/hivemq/features/)
* Embedded MQTT brokers (Home Assistant and OpenHAB)
This [wikipedia list](https://en.wikipedia.org/wiki/Comparison_of_MQTT_implementations) gives you more details about the different choices you have.
This [github list](https://github.com/mqtt/mqtt.github.io/wiki/libraries) seems to be the most exhaustive ones.
Here is also some [idea of criterias](https://www.hivemq.com/blog/top-10-mqtt-broker-criteria/) from HiveMQ.
Once your broker installed it can be interesting to see the traffic passing to it and to publish data, so as to do that there is several tools available:
* [MQTT Explorer](http://mqtt-explorer.com/)
* [HIVE MQ Web client](https://github.com/hivemq/hivemq-mqtt-web-client)
* [MQTT FX](https://mqttfx.jensd.de/)
+15
View File
@@ -0,0 +1,15 @@
# Controller
MQTT enables you to connect easily a controller so as to monitor, control and automate scenarios.
The following controllers (and many other software) are compatible with MQTT:
![controllers](../img/OpenMQTTGateway_controllers.png)
OpenMQTTGateway is independant from these projets, you have the liberty of choice among all the compatibles software.
* [OpenHAB2](https://www.openhab.org)
* [Home Assistant](https://www.home-assistant.io)
* [Domoticz](https://www.domoticz.com)
* [Jeedom](https://www.jeedom.com)
* [Node Red](https://nodered.org)
* [FHEM](https://fhem.de)
+22
View File
@@ -0,0 +1,22 @@
# Devices
A list of verified compatible devices is maintained [here](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit?usp=sharing).
Added to that is an overview of devices supported by OpenMQTTGateway:
* For radio frequency devices OpenMQTTGateway can support a wide range of 433mhz/315mhz devices, all the ones with SC5262 / SC5272, HX2262 / HX2272, PT2262 / PT2272, EV1527, RT1527, FP1527, HS1527 chipset are supported by the RF gateway. Added to that RF2 support Kaku and Pilight an [huge list](https://wiki.pilight.org/devices). Note that for the moment RF, RF2 and Pilight can not be activated on the same boards together.
![boards](../img/OpenMQTTGateway_devices_rf1.png ':size=250%')
![boards](../img/OpenMQTTGateway_devices_rf2.png ':size=250%')
![boards](../img/OpenMQTTGateway_devices_rf3.png ':size=250%')
* For BLE devices OpenMQTTGateway is able to scan all the BLE devices that advertise their data so as to do presence detection. Added to that it reads values coming from :
** Mi Flora (temperature/moisture/luminance/fertility)
** Mi Jia (temperature/humidity)
** Clear Grass (temperature/humidity)
** LYWDS02 Clock (temperature/humidity)
** Mi Scale (weight)
![boards](../img/OpenMQTTGateway_devices_ble.png ':size=250%')
* For infrared IR devices the list of supported brand is [here](https://github.com/1technophile/OpenMQTTGateway/blob/d2dd6138558909b71cc44f69665340247bd5f356/main/config_IR.h#L52), as there is also the possibility of using raw and global caché sending the possibilities of this gateway is huge!
* LORA is more dedicated at this moment for tinkering and DIY and there is no Off the shelves devices compatible to my knowledge with this gateway.
+17
View File
@@ -0,0 +1,17 @@
# Actuators
## Compatible parts
|Module|Purpose|Where to Buy|
|-|-|-|
|LED|Basic led|[parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|FASTLED|RGB Leds management|[parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|BUZZER|-|[parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|RELAY|Switch power circuit|[parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
## Pinout
|Module| Boards|
|-|-|
|RELAY|all output compatible pins|
|FASTLED|all output compatible pins|
Vcc pin of the board and the Module to a 5V supply source
Ground pins of the board and the Module to the ground of the supply source.
+27
View File
@@ -0,0 +1,27 @@
# BLE gateway
## Compatible parts
The ESP32 has an integrated BLE module, with this board the BLE gateway don't need any additional hardware. Making it the **advised board for BLE**.
For Arduino and ESP8266 you can use an HM10 or HM11 below.
|Module|Purpose|Where to Buy|
|-|-|-|
|HM 10 Keyes bluetooth module|Bluetooth|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
## Pinout
|Module Pin|Board RX Pin|Board TX Pin|
|-|:-:|:-:|
|Arduino|D6 to HM10 TX|D5 to HM10 RX|
|ESP8266|D6 to HM10 TX|D7 to HM10 RX|
Vcc pin of the board and the HM10 Module to a 5V supply source.
Ground pins of the board and the HM10 Module to the ground of the supply source.
The HM10/11 firmware version must be >= v601.
The baud rate of the HM10/11 module must be set to 9600 bauds.
## Arduino Hardware setup
![BLE Arduino](../img/OpenMQTTgateway_Arduino_Addon_BT.png)
## ESP8266 Hardware setup
![BLE ESP8266](../img/OpenMQTTgateway_ESP8266_Addon_BT.png)
+24
View File
@@ -0,0 +1,24 @@
# GSM 2G gateway
## Compatible parts
|Module|Purpose|Where to Buy|
|-|-|-|
|A6|GSM GPRS module|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|A7|GSM GPRS module with GPS|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
## Hardware setup
|Module Pin|NodeMCU / ESP8266 Pin|
|-|:-:|
|H_RXD|D6|
|H_TXD|D7|
|GND|GND|
|VCC5|MOSFET driven by D5|
For VCC5 you can power it directly all the time with an USB cable or use a MOSFET like [here](https://gitlab.com/stavros/A6-ESP8266-breakout/raw/master/images/schematic.png)
Don't use the nodemcu/wemos 5V pin for the A6/7 power, use a dedicated power supply for both or dedicated to the A6/7 with at least 2 amps ability.
So as to start your A6/7 module press the red button for 4 seconds, or link the PWR_KEY pin to VCC5.0 for the same time.
![Addon_2G](../img/OpenMQTTgateway_ESP8266_Addon_2G.png)
+29
View File
@@ -0,0 +1,29 @@
# IR gateway
## Compatible parts
|Module|Purpose|Where to Buy|
|-|-|-|
|IR diode|Emitting|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|IR receiver|Receiving|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|transistor 2N2222|Amplify uC signal for the IR diode|-|
|330 ohms resistor|-|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
|220 ohms resistor|limit current to LED|[compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)|
The IR setup can work with bc547 and a 4x3 LED-Matrix.
## Pinout
|Board| Receiver Pin| Emitter Pin|
|-|:-:|:-:|
|Arduino UNO|D2|D9|
|ESP8266|D4|D0|
|ESP32|27/**26**|14|
Connect the Emitter and Receiver to a 5V supply source, and the ground of your supply source to the ground of your board.
## Arduino Hardware setup
![IR](../img/OpenMQTTgateway_Arduino_Addon_IR.png)
## ESP8266 Hardware setup
![IR](../img/OpenMQTTgateway_ESP8266_Addon_IR.png)
## ESP32 Hardware setup
![IR](../img/OpenMQTTgateway_ESP32_Addon_IR.png)
+6
View File
@@ -0,0 +1,6 @@
# LORA gateway
## Compatible parts
An ESP32 board with a LORA module.
Idealy a TTGO board with LORA module included see [compatible parts list](https://docs.google.com/spreadsheets/d/1_5fQjAixzRtepkykmL-3uN3G5bLfQ0zMajM9OBZ1bx0/edit#gid=1323184277)
With this kind of board there is no hadware modification needed.
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff. Show more