Typo fixes (#1381)

This commit is contained in:
DigiH authored and GitHub committed 2023-01-08 07:43:15 -06:00
1 parent 16815f51da
commit 8a767cf4b8
13 files changed
+53 -53

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ The gateway will need an MQTT username and password, you have to create a new us
The max size of the username is 30 and 60 for the password.
:::
OMG will use the auto discovery functionality of home assistant to create gateway and sensors into your HASS instance automaticaly.
OMG will use the auto discovery functionality of home assistant to create gateway and sensors into your HASS instance automatically.
![](../img/OpenMQTTGateway_auto_discovery_Gateway_Home_Assistant.gif)
+2 -2
View File
@@ -2,7 +2,7 @@
Jeedom is free open-source software. [Jeedom Core](https://doc.jeedom.com/en_US/presentation/index) has multiple functionalities: scenario management, historic visualization, curves/graphics generation, text/speech-based interactions… The clear and intuitive interface allows you to set up a complete solution without development knowledge. And using widgets, views and designs, you can build your own interface.
As a modular system, Jeedom provides a Market where "plugins" are available to handle numerous home automation protocols, answer to specific use cases and provide a higher level of integration between the heterogenous device ecosystem.
As a modular system, Jeedom provides a Market where "plugins" are available to handle numerous home automation protocols, answer to specific use cases and provide a higher level of integration between the heterogeneous device ecosystem.
To be able to use MQTT protocol into Jeedom and decode json payloads, [plugin jMQTT](https://domochip.github.io/jMQTT/) is needed first. Then an OMG device will be integrated, as a Jeedom equipment, and finally a BT device will be integrated, also as an equipment.
@@ -175,4 +175,4 @@ For example:
This has be made using Open MQTT Gateway v0.9.13, Jeedom Core v4.2.20 and jMQTT plugin v2022-07-25.
The original discution is available on [Jeedom Community](https://community.jeedom.com/t/antenne-bluetooth-avec-un-esp32-open-mqtt-gateway-et-jmqtt/87407) (in French).
The original discussion is available on [Jeedom Community](https://community.jeedom.com/t/antenne-bluetooth-avec-un-esp32-open-mqtt-gateway-et-jmqtt/87407) (in French).
+4 -4
View File
@@ -22,8 +22,8 @@ You should have an MQTT broker installed (either mosquitto or the OpenHAB2 embed
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)
* Inbox > MQTT Things binding > Add manually >MQTT Broker : configure your broker
* Inbox > MQTT Things binding > Add manually >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:
@@ -42,7 +42,7 @@ In paper UI
* 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:
* Define your items in an item file like this by referring to your MQTT things channels:
For a mi flora and mi jia
```java
@@ -80,7 +80,7 @@ Number lux_P "Luminiosité plante[%.1f lux]" {channel="mqtt:topic:
* 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:
* Define your items in an item file like this by referring to your MQTT thing channel:
`Switch OMGSwitch "Prise 1" <poweroutlet> {channel="mqtt:topic:08998877:Power1"}`
+1 -1
View File
@@ -1,6 +1,6 @@
# Integrate OPENHAB3
This tutorial will show how to integrate the BLE gateway to OpenHAB3 leveraging the auto discovery functionnality.
This tutorial will show how to integrate the BLE gateway to OpenHAB3 leveraging the auto discovery functionality.
After this tutorial, you should see your Bluetooth Low Energy devices in OpenHAB3 without any file based manual configuration.
## Prerequisites
+1 -1
View File
@@ -3,7 +3,7 @@ The broker will act as an intermediary between OpenMQTTGateway and your [control
All the events or commands could pass by the broker.
There is many choice of brokers, here is some of the most populars:
There are many choices of brokers, here are some of the most popular:
* [Mosquitto](https://mosquitto.org/) (Open source)
* [Moquette](https://moquette-io.github.io/moquette/) (Open source)
* [HiveMQ](https://www.hivemq.com/hivemq/features/)
+1 -1
View File
@@ -2,7 +2,7 @@
## Compatible parts
|Module|Purpose|Where to Buy|
|-|-|-|
|TTL to RS232 module|Transcieving|-|
|TTL to RS232 module|Transceiving|-|
Any module using a MAX232 chip will work. Don't pay extra to get all the signals, we're only using RX and TX.
+1 -1
View File
@@ -134,7 +134,7 @@ If you want to change this characteristic:
With Home Assistant, this command is directly available through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.
:::
The gateway will publish only the detected sensors like Mi Flora, Mi jia, LYWSD03MMC... and not the other BLE devices. This is usefull if you don't use the gateway for presence detection but only to retrieve sensors data.
The gateway will publish only the detected sensors like Mi Flora, Mi jia, LYWSD03MMC... and not the other BLE devices. This is useful if you don't use the gateway for presence detection but only to retrieve sensors data.
## Setting if the gateway use active or passive scanning
+2 -2
View File
@@ -53,7 +53,7 @@ The same behaviour apply to M5StickC and M5StickC Plus
### Setting the log output
Per default the log of the M5 boards is going to the LCD display with Errors and Warnings only, if you want to change the ouput at build time you can do it in [config_M5.h](https://github.com/1technophile/OpenMQTTGateway/blob/development/main/config_M5.h).
Per default the log of the M5 boards is going to the LCD display with Errors and Warnings only, if you want to change the output at build time you can do it in [config_M5.h](https://github.com/1technophile/OpenMQTTGateway/blob/development/main/config_M5.h).
You can also change it by MQTT. For example if you want to set to LCD
@@ -85,7 +85,7 @@ If you are already in low power mode 1 or 2 with M5Stack you can wake up the boa
### Setting the log output
Per default the log of the SSD1306 Display boards is going to the LCD display with Errors and Warnings only, if you want to change the ouput at build time you can do it with the compiler directive `-DLOG_LEVEL_LCD=LOG_LEVEL_NOTICE`.
Per default the log of the SSD1306 Display boards is going to the LCD display with Errors and Warnings only, if you want to change the output at build time you can do it with the compiler directive `-DLOG_LEVEL_LCD=LOG_LEVEL_NOTICE`.
You can also change it by MQTT. For example if you want to set to LCD
+2 -2
View File
@@ -116,7 +116,7 @@ void BTConfig_update(JsonObject& data, const char* key, T& var) {
}
void BTConfig_fromJson(JsonObject& BTdata, bool startup = false) {
// Attempts to connect to elligible devices or not
// Attempts to connect to eligible devices or not
BTConfig_update(BTdata, "bleconnect", BTConfig.bleConnect);
// Scan interval set
if (BTdata.containsKey("interval") && BTdata["interval"] != 0)
@@ -221,7 +221,7 @@ void BTConfig_load() {
return;
}
JsonObject jo = jsonBuffer.as<JsonObject>();
BTConfig_fromJson(jo, true); // Never send mqtt message with config
BTConfig_fromJson(jo, true); // Never send MQTT message with config
Log.notice(F("BT config loaded" CR));
}
+3 -3
View File
@@ -147,7 +147,7 @@ void launchRTL_433Discovery(bool overrideDiscovery) {
"", "", (char*)value_template.c_str(), //set availability_topic,device_class,value_template,
"1", "0", parameters[i][2], //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", false, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", false, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
(char*)idWoKey.c_str(), "", pdevice->modelName, (char*)idWoKey.c_str(), false, // device name, device manufacturer, device model, device ID, retain
"" //State Class
);
@@ -157,7 +157,7 @@ void launchRTL_433Discovery(bool overrideDiscovery) {
"", "", (char*)value_template.c_str(), //set availability_topic,device_class,value_template,
"1", "0", parameters[i][2], //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", false, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", false, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
(char*)idWoKey.c_str(), "", pdevice->modelName, (char*)idWoKey.c_str(), false, // device name, device manufacturer, device model, device ID, retain
stateClassTotalIncreasing //State Class
);
@@ -167,7 +167,7 @@ void launchRTL_433Discovery(bool overrideDiscovery) {
"", "", (char*)value_template.c_str(), //set availability_topic,device_class,value_template,
"", "", parameters[i][2], //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", false, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", false, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
(char*)idWoKey.c_str(), "", pdevice->modelName, (char*)idWoKey.c_str(), false, // device name, device manufacturer, device model, device ID, retain
stateClassMeasurement //State Class
);
+30 -30
View File
@@ -198,7 +198,7 @@ void announceDeviceTrigger(bool use_gateway_info, char* topic, char* type, char*
* @param sensor_type the Type
* @param st_topic set state topic,
* @param s_name set name,
* @param unique_id set niqueId
* @param unique_id set uniqueId
* @param availability_topic set availability_topic,
* @param device_class set device_class,
* @param value_template set value_template,
@@ -206,8 +206,8 @@ void announceDeviceTrigger(bool use_gateway_info, char* topic, char* type, char*
* @param payload_off set payload_off,
* @param unit_of_meas set unit_of_meas,
* @param off_delay set off_delay
* @param payload_available set payload_avalaible,
* @param payload_not_avalaible set payload_not_avalaible
* @param payload_available set payload_available,
* @param payload_not_available set payload_not_available
* @param gateway_entity set is a gateway entity,
* @param cmd_topic set command topic
* @param device_name set device name,
@@ -223,7 +223,7 @@ void createDiscovery(const char* sensor_type,
const char* availability_topic, const char* device_class, const char* value_template,
const char* payload_on, const char* payload_off, const char* unit_of_meas,
int off_delay,
const char* payload_available, const char* payload_not_avalaible, bool gateway_entity, const char* cmd_topic,
const char* payload_available, const char* payload_not_available, bool gateway_entity, const char* cmd_topic,
const char* device_name, const char* device_manufacturer, const char* device_model, const char* device_id, bool retainCmd,
const char* state_class, const char* state_off, const char* state_on) {
StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer;
@@ -289,8 +289,8 @@ void createDiscovery(const char* sensor_type,
sensor["off_delay"] = off_delay; //off_delay
if (payload_available[0])
sensor["pl_avail"] = payload_available; // payload_on
if (payload_not_avalaible[0])
sensor["pl_not_avail"] = payload_not_avalaible; //payload_off
if (payload_not_available[0])
sensor["pl_not_avail"] = payload_not_available; //payload_off
if (state_class[0])
sensor["state_class"] = state_class; //add the state class on the sensors ( https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes )
if (state_on != nullptr)
@@ -376,7 +376,7 @@ void pubMqttDiscovery() {
will_Topic, "connectivity", "", //set availability_topic,device_class,value_template,
Gateway_AnnouncementMsg, will_Message, "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -385,7 +385,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.uptime }}", //set availability_topic,device_class,value_template,
"", "", "s", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -395,7 +395,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.freemem }}", //set availability_topic,device_class,value_template,
"", "", "B", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -404,7 +404,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.ip }}", //set availability_topic,device_class,value_template,
"", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -414,7 +414,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.rssi }}", //set availability_topic,device_class,value_template,
"", "", "dB", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -427,7 +427,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.lowpowermode }}", //set availability_topic,device_class,value_template,
"", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID
stateClassNone //State Class
);
@@ -438,7 +438,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.m5batvoltage }}", //set availability_topic,device_class,value_template,
"", "", "V", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -447,7 +447,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.m5batcurrent }}", //set availability_topic,device_class,value_template,
"", "", "A", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -456,7 +456,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.m5vinvoltage }}", //set availability_topic,device_class,value_template,
"", "", "V", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -465,7 +465,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.m5vincurrent }}", //set availability_topic,device_class,value_template,
"", "", "A", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -476,7 +476,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.m5battlevel }}", //set availability_topic,device_class,value_template,
"", "", "%", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -485,7 +485,7 @@ void pubMqttDiscovery() {
"", "{{ value_json.m5ischarging }}", "", //set availability_topic,device_class,value_template,
"", "", "%", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -494,7 +494,7 @@ void pubMqttDiscovery() {
"", "{{ value_json.m5ischargefull }}", "", //set availability_topic,device_class,value_template,
"", "", "%", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, "", //set,payload_avalaible,payload_not avalaible ,is a child device, command topic
"", "", true, "", //set,payload_available,payload_not available ,is a child device, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -505,7 +505,7 @@ void pubMqttDiscovery() {
will_Topic, "", "", //set availability_topic,device_class,value_template,
"{\"cmd\":\"restart\"}", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -514,7 +514,7 @@ void pubMqttDiscovery() {
will_Topic, "", "", //set availability_topic,device_class,value_template,
"{\"cmd\":\"erase\"}", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoSYSset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -927,7 +927,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.interval/1000 }}", //set availability_topic,device_class,value_template,
"{\"interval\":{{value*1000}},\"save\":true}", "", "s", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
"", "", true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain,
stateClassNone //State Class
);
@@ -936,7 +936,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.scanbcnct }}", //set availability_topic,device_class,value_template,
"{\"scanbcnct\":{{value}},\"save\":true}", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible,is a gateway entity, command topic
"", "", true, subjectMQTTtoBTset, //set,payload_available,payload_not available,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -945,7 +945,7 @@ void pubMqttDiscovery() {
will_Topic, "", "", //set availability_topic,device_class,value_template,
"{\"interval\":0}", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device ID, retain
stateClassNone //State Class
);
@@ -954,7 +954,7 @@ void pubMqttDiscovery() {
will_Topic, "", "", //set availability_topic,device_class,value_template,
"{\"erase\":true}", "", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
stateClassNone //State Class
);
@@ -963,7 +963,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.onlysensors }}", //set availability_topic,device_class,value_template,
"{\"onlysensors\":true,\"save\":true}", "{\"onlysensors\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
stateClassNone, //State Class
"false", "true" //state_off, state_on
@@ -973,7 +973,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.activescan }}", //set availability_topic,device_class,value_template,
"{\"activescan\":true,\"save\":true}", "{\"activescan\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
stateClassNone, //State Class
"false", "true" //state_off, state_on
@@ -983,7 +983,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.hasspresence }}", //set availability_topic,device_class,value_template,
"{\"hasspresence\":true,\"save\":true}", "{\"hasspresence\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
stateClassNone, //State Class
"false", "true" //state_off, state_on
@@ -993,7 +993,7 @@ void pubMqttDiscovery() {
"", "", "{{ value_json.bleconnect }}", //set availability_topic,device_class,value_template,
"{\"bleconnect\":true,\"save\":true}", "{\"bleconnect\":false,\"save\":true}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible ,is a gateway entity, command topic
Gateway_AnnouncementMsg, will_Message, true, subjectMQTTtoBTset, //set,payload_available,payload_not available ,is a gateway entity, command topic
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
stateClassNone, //State Class
"false", "true" //state_off, state_on
@@ -1003,7 +1003,7 @@ void pubMqttDiscovery() {
"", "", "", //set availability_topic,device_class,value_template,
"{\"lowpowermode\":2}", "{\"lowpowermode\":0}", "", //set,payload_on,payload_off,unit_of_meas,
0, //set off_delay
"", "", true, subjectMQTTtoBTset, //set,payload_avalaible,payload_not avalaible,is a gateway entity, command topic
"", "", true, subjectMQTTtoBTset, //set,payload_available,payload_not available,is a gateway entity, command topic
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain
stateClassNone //State Class
);
+1 -1
View File
@@ -86,7 +86,7 @@ extern void createDiscovery(const char* sensor_type,
const char* availability_topic, const char* device_class, const char* value_template,
const char* payload_on, const char* payload_off, const char* unit_of_meas,
int off_delay,
const char* payload_available, const char* payload_not_avalaible, bool gateway_entity, const char* command_topic,
const char* payload_available, const char* payload_not_available, bool gateway_entity, const char* command_topic,
const char* device_name, const char* device_manufacturer, const char* device_model, const char* device_mac, bool retainCmd,
const char* state_class, const char* state_off = nullptr, const char* state_on = nullptr);
+4 -4
View File
@@ -334,7 +334,7 @@ void pub(const char* topicori, const char* payload, bool retainFlag) {
* @brief Publish the payload on default MQTT topic
*
* @param topicori suffix to add on default MQTT Topic
* @param data The Json Object that rapresent the message
* @param data The Json Object that represents the message
*/
void pub(const char* topicori, JsonObject& data) {
String dataAsString = "";
@@ -397,10 +397,10 @@ void pub(const char* topicori, const char* payload) {
}
/**
* @brief Publish the payload on the topic with a retantion
* @brief Publish the payload on the topic with a retention
*
* @param topic The topic where to publish
* @param data The Json Object that rapresent the message
* @param data The Json Object that represents the message
* @param retain true if you what a retain
*/
void pub_custom_topic(const char* topic, JsonObject& data, boolean retain) {
@@ -633,7 +633,7 @@ void connectMQTT() {
// Callback function, when the gateway receive an MQTT value on the topics subscribed this function is called
void callback(char* topic, byte* payload, unsigned int length) {
// In order to republish this payload, a copy must be made
// as the orignal payload buffer will be overwritten whilst
// as the original payload buffer will be overwritten whilst
// constructing the PUBLISH packet.
Log.trace(F("Hey I got a callback %s" CR), topic);
// Allocate the correct amount of memory for the payload copy