MQTT-MAC-IP-mDNS (#1245)
This commit is contained in:
1 parent
1c62d74e56
commit
c4300a002f
21 files changed
+100
-100
No files matched your search
@@ -1,8 +1,8 @@
|
||||
# Integrate Home Assistant
|
||||
|
||||
Home Assistant provide the [MQTT integration](https://www.home-assistant.io/integrations/mqtt/) and through this integration it is possible to exploit and manage the messages published by OpenMqttGateway.
|
||||
Home Assistant provide the [MQTT integration](https://www.home-assistant.io/integrations/mqtt/) and through this integration it is possible to exploit and manage the messages published by OpenMQTTGateway.
|
||||
|
||||
Once this integration on home assistant is configured with the same mqtt broker, it is possible to create devices manually or through the autodiscovery function.
|
||||
Once this integration on home assistant is configured with the same MQTT broker, it is possible to create devices manually or through the autodiscovery function.
|
||||
|
||||
|
||||
## Auto discovery
|
||||
@@ -11,7 +11,7 @@ From Home Assistant site
|
||||
|
||||
> The discovery of MQTT devices will enable one to use MQTT devices with only minimal configuration effort on the side of Home Assistant. The configuration is done on the device itself and the topic used by the device.
|
||||
|
||||
On OpenMqttGateway the Home Assistant discovery is enabled by default on all binaries and platformio configurations except for UNO. With Arduino IDE please read the [advanced configuration section](../upload/advanced-configuration#auto-discovery) of the documentation. Here are a few tips for activating discovery on Home Assistant, but for detailed configuration please refer to the Home Assistant website.
|
||||
On OpenMQTTGateway the Home Assistant discovery is enabled by default on all binaries and platformio configurations except for UNO. With Arduino IDE please read the [advanced configuration section](../upload/advanced-configuration#auto-discovery) of the documentation. Here are a few tips for activating discovery on Home Assistant, but for detailed configuration please refer to the Home Assistant website.
|
||||
|
||||
Enable discovery on your MQTT integration in HASS.
|
||||
|
||||
@@ -36,7 +36,7 @@ OMG will use the auto discovery functionality of home assistant to create gatewa
|
||||
|
||||
## MQTT Device Trigger and RF
|
||||
|
||||
With OpenMqttGateway [configured to receive RF signals](./setitup/rf.html) the messages are transmitted as indicated by [RCSwitch based gateway](./use/rf.html#rcswitch-based-gateway), so it is possible to receive a pulse every time the sensor discover a signal.
|
||||
With OpenMQTTGateway [configured to receive RF signals](./setitup/rf.html) the messages are transmitted as indicated by [RCSwitch based gateway](./use/rf.html#rcswitch-based-gateway), so it is possible to receive a pulse every time the sensor discover a signal.
|
||||
|
||||
With autodiscovery enabled, HomeAssistant will discover a [MQTT Device Trigger](https://www.home-assistant.io/integrations/device_trigger.mqtt/) identified by the value field given in the mqtt argument.
|
||||
|
||||
@@ -163,14 +163,14 @@ Sensor:
|
||||
sensor:
|
||||
- platform: mqtt
|
||||
name: "Weight"
|
||||
state_topic: "home/OpenMQTTGateway/BTtoMQTT/AAAAAAAAAAAA" # replace your mqtt topic here
|
||||
state_topic: "home/OpenMQTTGateway/BTtoMQTT/AAAAAAAAAAAA" # replace your MQTT topic here
|
||||
value_template: '{{ value_json["weight"] }}'
|
||||
unit_of_measurement: "kg"
|
||||
icon: mdi:weight-kilogram
|
||||
|
||||
- platform: mqtt
|
||||
name: "Impedance"
|
||||
state_topic: "home/OpenMQTTGateway/BTtoMQTT/AAAAAAAAAAAA" # replace your mqtt topic here also
|
||||
state_topic: "home/OpenMQTTGateway/BTtoMQTT/AAAAAAAAAAAA" # replace your MQTT topic here also
|
||||
value_template: '{{ value_json["impedance"] }}'
|
||||
unit_of_measurement: "Ohm"
|
||||
icon: mdi:omega
|
||||
|
||||
@@ -18,7 +18,7 @@ The things will appear in the inbox of the paperUI, add them and links the chann
|
||||

|
||||
|
||||
## MQTT 2 manual setup >=Openhab2.4
|
||||
You should have a mqtt broker installed (either mosquitto or the OpenHAB2 embedded one)
|
||||
You should have an MQTT broker installed (either mosquitto or the OpenHAB2 embedded one)
|
||||
|
||||
In paper UI
|
||||
* In bindings add the MQTT Things binding
|
||||
@@ -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 refering 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 refering to your MQTT thing channel:
|
||||
|
||||
`Switch OMGSwitch "Prise 1" <poweroutlet> {channel="mqtt:topic:08998877:Power1"}`
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Added to that it retrieves the measures from the devices below. By default the d
|
||||
|Devices|Model|Measurements|
|
||||
|-|:-:|:-:|
|
||||
| ATorch Battery Capacity Monitor (c)|DT24|volt/amp/watt|
|
||||
| BLE watches with fixed mac||rssi for presence detection|
|
||||
| BLE watches with fixed MAC||rssi for presence detection|
|
||||
| BLE beacons keychains||rssi for presence detection|
|
||||
| BlueMaestro|TempoDisc|temperature/humidity/duepoint/voltage|
|
||||
| ClearGrass |CGG1|temperature/humidity/battery|
|
||||
|
||||
@@ -15,7 +15,7 @@ You are using ESP8266 or ESP32, for other boards TLS is not supported.
|
||||
### Configure secure connection in the gateway
|
||||
To enable the secure connection and use TLS set the `#define MQTT_DEFAULT_SECURE` to true.
|
||||
Set `MQTT_SERVER` to the Common Name (CN) of the certificate of the broker.
|
||||
This can be the hostname or the ip of the broker.
|
||||
This can be the hostname or the IP of the broker.
|
||||
|
||||
The CA certificate should be in PEM ascii format.
|
||||
If your CA certificate is not in the correct format or you don't know the format, use `openssl` to convert the certificate to the correct format.
|
||||
|
||||
@@ -78,8 +78,8 @@ https://github.com/marcelstoer/nodemcu-pyflasher/releases
|
||||
* Click on *FlashNodeMCU*
|
||||
The upload details appears.
|
||||
|
||||
With an ESP if you did not set your network and mqtt parameters manually you can now open the [web portal configuration](portal.md).
|
||||
With an ESP if you did not set your network and MQTT parameters manually you can now open the [web portal configuration](portal.md).
|
||||
|
||||
Note that to reset the wifi and mqtt settings you can check *yes, wipes all data*
|
||||
Note that to reset the wifi and MQTT settings you can check *yes, wipes all data*
|
||||
|
||||
[](https://hits.seeyoufarm.com)
|
||||
@@ -220,7 +220,7 @@ upload_flags =
|
||||
* Upload ➡️
|
||||
* You should see the logs in the serial monitor
|
||||
|
||||
With an ESP if you did not set your network and mqtt parameters manually you can now open the [web portal configuration](portal.md).
|
||||
With an ESP if you did not set your network and MQTT parameters manually you can now open the [web portal configuration](portal.md).
|
||||
|
||||
## API
|
||||
With the V0.9 we added the support of json for receiving and publishing.
|
||||
@@ -259,7 +259,7 @@ If you want to use HASS MQTT discovery you need to have
|
||||
uncommented.
|
||||
Added to that auto discovery box should be selected into your Home Assistant MQTT integration configuration.
|
||||
|
||||
With an ESP if you did not set your network and mqtt parameters manually you can now open the [web portal configuration](portal.md).
|
||||
With an ESP if you did not set your network and MQTT parameters manually you can now open the [web portal configuration](portal.md).
|
||||
|
||||
::: warning Note
|
||||
simpleReceiving on Arduino boards doesn't accept 64 bits MQTT values, you can only send 32bits values from the MQTT broker.
|
||||
|
||||
@@ -23,9 +23,9 @@ More info on [this topic](https://community.openmqttgateway.com/t/esp32-compilat
|
||||
|
||||
→ Verify your wiring
|
||||
|
||||
→ To eliminate issues of OpenMqttGateway or you home controller try uploading basic examples from the libraries directly (like [SendDemo](https://github.com/sui77/rc-switch/tree/master/examples/SendDemo) for RF or IRSendDemo for IR) and execute them. If it doesn't work this means that you have mostly an issue related with your hardware or due to IDE/library version used.
|
||||
→ To eliminate issues of OpenMQTTGateway or you home controller try uploading basic examples from the libraries directly (like [SendDemo](https://github.com/sui77/rc-switch/tree/master/examples/SendDemo) for RF or IRSendDemo for IR) and execute them. If it doesn't work this means that you have mostly an issue related with your hardware or due to IDE/library version used.
|
||||
|
||||
Regarding the IR led emitter you can replace it with a normal led and see if it light on when you send an mqtt command
|
||||
Regarding the IR led emitter you can replace it with a normal led and see if it lights up when you send an MQTT command
|
||||
|
||||
→ If you are only unable to receive RF on nodemcu (or if it only works when a serial connection is active):
|
||||
|
||||
@@ -49,7 +49,7 @@ Exception (2):
|
||||
Most probably a network issue, don't use a guest network and if going through a firewall check its rules. To put aside gateway issue, try to connect to a local broker on the same network.
|
||||
|
||||
## You don't see the messages appearing on your broker but they appears on the serial monitor
|
||||
This is due to a too small mqtt packet size, open User_config.h and set:
|
||||
This is due to a too small MQTT packet size, open User_config.h and set:
|
||||
`#define mqtt_max_packet_size 1024`
|
||||
|
||||
## Your Arduino with w5100 Ethernet shield does not connect to network until you press Reset button
|
||||
|
||||
+4
-4
@@ -29,7 +29,7 @@ Consider the distance as a beta feature as currently we are not retrieving the e
|
||||
|
||||
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.
|
||||
iOS version >=10 devices advertise without an extra app 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 from BLE devices Mi Flora, Mi jia, LYWDS02, LYWSD03MMC, ClearGrass, Mi scale and [many more](https://compatible.openmqttgateway.com/index.php/devices/ble-devices/)
|
||||
@@ -67,11 +67,11 @@ OpenMQTTGateway publish the servicedata field of your BLE devices, with HM10 thi
|
||||
:::
|
||||
|
||||
## Setting a white or black list
|
||||
A black list is a list of mac addresses that will never be published by OMG
|
||||
A black list is a list of MAC addresses that will never be published by OMG
|
||||
to set black list
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"black-list":["01:23:14:55:16:15","4C:65:77:88:9C:79","4C:65:A6:66:3C:79"]}'`
|
||||
|
||||
A white list is a list of mac addresses permitted to be published by OMG
|
||||
A white list is a list of MAC addresses permitted to be published by OMG
|
||||
to set white list
|
||||
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"white-list":["01:23:14:55:16:15","4C:65:77:88:9C:79","4C:65:A6:66:3C:79"]}'`
|
||||
|
||||
@@ -167,7 +167,7 @@ The gateway can read and write BLE characteristics from devices and provide the
|
||||
These actions will be taken on the next BLE connection, which occurs after scanning and after the scan count is reached, [see above to set this.](#setting-the-number-of-scans-between-connection-attempts)
|
||||
This can be overridden by providing an (optional) parameter `"immediate": true` within the command. This will cause the BLE scan to stop if currently in progress, allowing the command to be immediately processed. All other connection commands in queue will also be processed for the same device, commands for other devices will be deferred until the next normally scheduled connection.
|
||||
|
||||
**Note** Some devices need to have the mac address type specified. You can find this type by checking the log/mqtt data and looking for "mac_type". By default the type is 0 but some devices use different type values. You must specify the correct type to connect successfully.
|
||||
**Note** Some devices need to have the MAC address type specified. You can find this type by checking the log/MQTT data and looking for "mac_type". By default the type is 0 but some devices use different type values. You must specify the correct type to connect successfully.
|
||||
To specify the MAC address type add the parameter `"mac_type"` to the command. For example `"mac_type": 1` to connect with a device with the MAC address type of 1.
|
||||
:::
|
||||
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ 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:
|
||||
and publish it to MQTT with the 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":"GC"}'
|
||||
```
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ Generate your RF signals by pressing a remote button or other and you will see :
|
||||
|
||||
### Send data by MQTT to convert it on KAKU signal
|
||||
|
||||
Once you get the infos publish the parameters with mqtt like that for off:
|
||||
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}"`
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ 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 transmitted via Mqtt when it changes.
|
||||
The value is between 0 and 1024 and is transmitted via MQTT when it changes.
|
||||
`home/OpenMQTTGateway/ADCtoMQTT {"value":543}`
|
||||
|
||||
### DHT
|
||||
|
||||
+7
-7
@@ -50,7 +50,7 @@
|
||||
*/
|
||||
/*-------------DEFINE GATEWAY NAME BELOW IT CAN ALSO BE DEFINED IN platformio.ini----------------*/
|
||||
|
||||
// Uncomment to use the mac address in the format of 112233445566 as the gateway name
|
||||
// Uncomment to use the MAC address in the format of 112233445566 as the gateway name
|
||||
// Any definition of Gateway_Name will be ignored. The Gateway_Short_name _ MAC will be used as the access point name.
|
||||
//#define USE_MAC_AS_GATEWAY_NAME
|
||||
#ifndef Gateway_Name
|
||||
@@ -69,7 +69,7 @@
|
||||
//#define NetworkAdvancedSetup true //uncomment if you want to set advanced network parameters, not uncommented you can set the IP and mac only
|
||||
#ifdef NetworkAdvancedSetup
|
||||
# if defined(ESP8266) || defined(ESP32)
|
||||
const byte ip[] = {192, 168, 1, 99}; //ip adress of the gateway, already defined for arduino below
|
||||
const byte ip[] = {192, 168, 1, 99}; //IP address of the gateway, already defined for arduino below
|
||||
# endif
|
||||
const byte gateway[] = {0, 0, 0, 0};
|
||||
const byte Dns[] = {0, 0, 0, 0};
|
||||
@@ -80,7 +80,7 @@ const byte subnet[] = {255, 255, 255, 0};
|
||||
//# define ESPWifiManualSetup true //uncomment you don't want to use wifimanager for your credential settings on ESP
|
||||
#else // for arduino boards
|
||||
const byte ip[] = {192, 168, 1, 99};
|
||||
const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield mac adress
|
||||
const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield MAC address
|
||||
#endif
|
||||
|
||||
//#define ESP32_ETHERNET=true // Uncomment to use Ethernet module on ESP32 Ethernet gateway and adapt the settings to your board below, the default parameter are for OLIMEX ESP32 Gateway
|
||||
@@ -132,10 +132,10 @@ const byte mac[] = {0xDE, 0xED, 0xBA, 0xFE, 0x54, 0x95}; //W5100 ethernet shield
|
||||
//#define WIFIMNG_HIDE_MQTT_CONFIG //Uncomment so as to hide MQTT setting from Wifi manager page
|
||||
|
||||
/*-------------DEFINE YOUR ADVANCED NETWORK PARAMETERS BELOW----------------*/
|
||||
//#define MDNS_SD //uncomment if you want to use mdns for discovering automatically your ip server, please note that MDNS with ESP32 can cause the BLE to not work
|
||||
//#define MDNS_SD //uncomment if you want to use mDNS for discovering automatically your IP server, please note that mDNS with ESP32 can cause the BLE to not work
|
||||
#define maxConnectionRetry 10 //maximum MQTT connection attempts before going to wifimanager setup if never connected once
|
||||
#define maxConnectionRetryWifi 5 //maximum Wifi connection attempts with existing credential at start (used to bypass ESP32 issue on wifi connect)
|
||||
#define maxRetryWatchDog 11 //maximum Wifi or mqtt re-connection attempts before restarting
|
||||
#define maxRetryWatchDog 11 //maximum Wifi or MQTT re-connection attempts before restarting
|
||||
|
||||
//set minimum quality of signal so it ignores AP's under that quality
|
||||
#define MinimumWifiSignalQuality 8
|
||||
@@ -199,7 +199,7 @@ const char* certificate PROGMEM = R"EOF("
|
||||
# define AWS_IOT false
|
||||
# endif
|
||||
|
||||
//# define MQTT_HTTPS_FW_UPDATE //uncomment to enable updating via mqtt message.
|
||||
//# define MQTT_HTTPS_FW_UPDATE //uncomment to enable updating via MQTT message.
|
||||
|
||||
# ifdef MQTT_HTTPS_FW_UPDATE
|
||||
// If used, this should be set to the root CA certificate of the server hosting the firmware.
|
||||
@@ -480,7 +480,7 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
|
||||
#if defined(ZgatewayRF) || defined(ZgatewayIR) || defined(ZgatewaySRFB) || defined(ZgatewayWeatherStation)
|
||||
// variable to avoid duplicates
|
||||
# ifndef time_avoid_duplicate
|
||||
# define time_avoid_duplicate 3000 // if you want to avoid duplicate mqtt message received set this to > 0, the value is the time in milliseconds during which we don't publish duplicates
|
||||
# define time_avoid_duplicate 3000 // if you want to avoid duplicate MQTT message received set this to > 0, the value is the time in milliseconds during which we don't publish duplicates
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
+5
-5
@@ -96,7 +96,7 @@ int minRssi = abs(MinimumRSSI); //minimum rssi value
|
||||
void pubBTMainCore(JsonObject& data, bool haPresenceEnabled = true) {
|
||||
if (abs((int)data["rssi"] | 0) < minRssi && data.containsKey("id")) {
|
||||
String topic = data["id"].as<const char*>();
|
||||
topic.replace(":", ""); // Initially publish topic ends with mac address
|
||||
topic.replace(":", ""); // Initially publish topic ends with MAC address
|
||||
# if useBeaconUuidForTopic
|
||||
if (data.containsKey("model_id") && data["model_id"].as<String>() == "IBEACON")
|
||||
topic = data["uuid"].as<const char*>(); // If model_id is IBEACON, use uuid as topic
|
||||
@@ -454,7 +454,7 @@ void procBLETask(void* pvParameters) {
|
||||
}
|
||||
# endif
|
||||
|
||||
if ((!oneWhite || isWhite(device)) && !isBlack(device)) { //if not black listed mac we go AND if we have no white mac or this mac is white we go out
|
||||
if ((!oneWhite || isWhite(device)) && !isBlack(device)) { //if not black listed MAC we go AND if we have no white MAC or this MAC is white we go out
|
||||
if (advertisedDevice->haveName())
|
||||
BLEdata["name"] = (char*)advertisedDevice->getName().c_str();
|
||||
if (advertisedDevice->haveManufacturerData()) {
|
||||
@@ -487,7 +487,7 @@ void procBLETask(void* pvParameters) {
|
||||
PublishDeviceData(BLEdata); // PublishDeviceData has its own logic whether it needs to publish the json or not
|
||||
}
|
||||
} else {
|
||||
Log.trace(F("Filtered mac device" CR));
|
||||
Log.trace(F("Filtered MAC device" CR));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -827,9 +827,9 @@ bool BTtoMQTT() {
|
||||
BLEdevice* device = getDeviceByMac((char*)mac.c_str());
|
||||
|
||||
if (isBlack(device))
|
||||
return false; //if black listed mac we go out
|
||||
return false; //if black listed MAC we go out
|
||||
if (oneWhite && !isWhite(device))
|
||||
return false; //if we have at least one white mac and this mac is not white we go out
|
||||
return false; //if we have at least one white MAC and this MAC is not white we go out
|
||||
|
||||
BLEdata["rssi"] = (int)rssi;
|
||||
if (!publishOnlySensors && hassPresence)
|
||||
|
||||
+46
-46
@@ -4,7 +4,7 @@
|
||||
Act as a wifi or ethernet gateway between your 433mhz/infrared IR signal and a MQTT broker
|
||||
Send and receiving command by MQTT
|
||||
|
||||
This is the Home Assistant mqtt Discovery addon.
|
||||
This is the Home Assistant MQTT Discovery addon.
|
||||
|
||||
Copyright: (c) Rafal Herok
|
||||
|
||||
@@ -51,7 +51,7 @@ String getUniqueId(String name, String sufix) {
|
||||
/**
|
||||
* Create a discover messages form a list of attribute
|
||||
*
|
||||
* @param mac the mac adres
|
||||
* @param mac the MAC address
|
||||
* @param sensorList[][0] = component type
|
||||
* @param sensorList[][1] = name
|
||||
* @param sensorList[][2] = availability topic
|
||||
@@ -189,7 +189,7 @@ void announceDeviceTrigger(bool use_gateway_info, char* topic, char* type, char*
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Generate message and publish it on an mqtt discovery exploiter. For HA @see https://www.home-assistant.io/docs/mqtt/discovery/
|
||||
* @brief Generate message and publish it on an MQTT discovery exploiter. For HA @see https://www.home-assistant.io/docs/mqtt/discovery/
|
||||
*
|
||||
* @param sensor_type the Type
|
||||
* @param st_topic set state topic,
|
||||
@@ -209,7 +209,7 @@ void announceDeviceTrigger(bool use_gateway_info, char* topic, char* type, char*
|
||||
* @param device_name set device name,
|
||||
* @param device_manufacturer set device manufacturer,
|
||||
* @param device_model set device model,
|
||||
* @param device_mac set device mac,
|
||||
* @param device_mac set device MAC,
|
||||
* @param retainCmd set retain
|
||||
* @param state_class set state class
|
||||
*
|
||||
@@ -354,7 +354,7 @@ void pubMqttDiscovery() {
|
||||
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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("sensor", //set Type
|
||||
@@ -363,7 +363,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
|
||||
@@ -374,7 +374,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("sensor", //set Type
|
||||
@@ -383,7 +383,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# ifndef ESP32_ETHERNET
|
||||
@@ -393,7 +393,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -405,7 +405,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# if defined(ZboardM5STICKC) || defined(ZboardM5STICKCP) || defined(ZboardM5TOUGH)
|
||||
@@ -415,7 +415,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("sensor", //set Type
|
||||
@@ -424,7 +424,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("sensor", //set Type
|
||||
@@ -433,7 +433,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("sensor", //set Type
|
||||
@@ -442,7 +442,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -453,7 +453,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "%", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("binary_sensor", //set Type
|
||||
@@ -462,7 +462,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "%", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("binary_sensor", //set Type
|
||||
@@ -471,7 +471,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "%", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -482,7 +482,7 @@ void pubMqttDiscovery() {
|
||||
"{\"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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
@@ -491,7 +491,7 @@ void pubMqttDiscovery() {
|
||||
"{\"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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
@@ -500,7 +500,7 @@ void pubMqttDiscovery() {
|
||||
"{\"discovery\":true}", "{\"discovery\":false}", "", //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
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device mac, retain,
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain,
|
||||
stateClassNone //State Class
|
||||
);
|
||||
|
||||
@@ -523,7 +523,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, BMEsensor[i][3], BMEsensor[i][4],
|
||||
BMEsensor[i][5], BMEsensor[i][6], BMEsensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -545,7 +545,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, HTUsensor[i][3], HTUsensor[i][4],
|
||||
HTUsensor[i][5], HTUsensor[i][6], HTUsensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -566,7 +566,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, AHTsensor[i][3], AHTsensor[i][4],
|
||||
AHTsensor[i][5], AHTsensor[i][6], AHTsensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -588,7 +588,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, DHTsensor[i][3], DHTsensor[i][4],
|
||||
DHTsensor[i][5], DHTsensor[i][6], DHTsensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -605,7 +605,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, ADCsensor[3], ADCsensor[4],
|
||||
ADCsensor[5], ADCsensor[6], ADCsensor[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -627,7 +627,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, BH1750sensor[i][3], BH1750sensor[i][4],
|
||||
BH1750sensor[i][5], BH1750sensor[i][6], BH1750sensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -650,7 +650,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, TSL2561sensor[i][3], TSL2561sensor[i][4],
|
||||
TSL2561sensor[i][5], TSL2561sensor[i][6], TSL2561sensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -667,7 +667,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, HCSR501sensor[3], HCSR501sensor[4],
|
||||
HCSR501sensor[5], HCSR501sensor[6], HCSR501sensor[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -683,7 +683,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, GPIOInputsensor[3], GPIOInputsensor[4],
|
||||
GPIOInputsensor[5], GPIOInputsensor[6], GPIOInputsensor[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -705,7 +705,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, INA226sensor[i][3], INA226sensor[i][4],
|
||||
INA226sensor[i][5], INA226sensor[i][6], INA226sensor[i][7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
}
|
||||
@@ -727,7 +727,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, actuatorONOFF[3], actuatorONOFF[4],
|
||||
actuatorONOFF[5], actuatorONOFF[6], actuatorONOFF[7],
|
||||
0, "", "", true, subjectMQTTtoONOFF,
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -744,7 +744,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewayRF[3], gatewayRF[4],
|
||||
gatewayRF[5], gatewayRF[6], gatewayRF[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
|
||||
@@ -762,7 +762,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewayRF2[3], gatewayRF2[4],
|
||||
gatewayRF2[5], gatewayRF2[6], gatewayRF2[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -779,7 +779,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewayRFM69[3], gatewayRFM69[4],
|
||||
gatewayRFM69[5], gatewayRFM69[6], gatewayRFM69[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -796,7 +796,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewayLORA[3], gatewayLORA[4],
|
||||
gatewayLORA[5], gatewayLORA[6], gatewayLORA[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -813,7 +813,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewaySRFB[3], gatewaySRFB[4],
|
||||
gatewaySRFB[5], gatewaySRFB[6], gatewaySRFB[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -830,7 +830,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewayPilight[3], gatewayPilight[4],
|
||||
gatewayPilight[5], gatewayPilight[6], gatewayPilight[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -847,7 +847,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gatewayIR[3], gatewayIR[4],
|
||||
gatewayIR[5], gatewayIR[6], gatewayIR[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -864,7 +864,7 @@ void pubMqttDiscovery() {
|
||||
will_Topic, gateway2G[3], gateway2G[4],
|
||||
gateway2G[5], gateway2G[6], gateway2G[7],
|
||||
0, "", "", true, "",
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
@@ -876,7 +876,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "ms", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain,
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain,
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("sensor", //set Type
|
||||
@@ -885,7 +885,7 @@ void pubMqttDiscovery() {
|
||||
"", "", "", //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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
@@ -894,7 +894,7 @@ void pubMqttDiscovery() {
|
||||
"{\"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
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", false, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
@@ -903,7 +903,7 @@ void pubMqttDiscovery() {
|
||||
"{\"onlysensors\":true}", "{\"onlysensors\":false}", "", //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
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
@@ -912,7 +912,7 @@ void pubMqttDiscovery() {
|
||||
"{\"hasspresence\":true}", "{\"hasspresence\":false}", "", //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
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# ifdef ESP32
|
||||
@@ -922,7 +922,7 @@ void pubMqttDiscovery() {
|
||||
"{\"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, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
createDiscovery("switch", //set Type
|
||||
@@ -931,7 +931,7 @@ void pubMqttDiscovery() {
|
||||
"{\"bleconnect\":true}", "{\"bleconnect\":false}", "", //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
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device mac, retain
|
||||
"", "", "", "", true, // device name, device manufacturer, device model, device MAC, retain
|
||||
stateClassNone //State Class
|
||||
);
|
||||
# endif
|
||||
|
||||
+2
-2
@@ -128,14 +128,14 @@ bool hassPresence = HassPresence;
|
||||
#endif
|
||||
|
||||
#ifndef useBeaconUuidForTopic
|
||||
# define useBeaconUuidForTopic false // define true to use iBeacon UUID as topic, instead of sender (random) mac address
|
||||
# define useBeaconUuidForTopic false // define true to use iBeacon UUID as topic, instead of sender (random) MAC address
|
||||
#endif
|
||||
|
||||
/*-------------------HOME ASSISTANT ROOM PRESENCE ----------------------*/
|
||||
#define subjectHomePresence "presence/" // will send Home Assistant room presence message to this topic (first part is same for all rooms, second is room name)
|
||||
|
||||
#ifndef useBeaconUuidForPresence
|
||||
# define useBeaconUuidForPresence false // //define true to use iBeacon UUID as for presence, instead of sender mac (random) address
|
||||
# define useBeaconUuidForPresence false // //define true to use iBeacon UUID as for presence, instead of sender MAC (random) address
|
||||
#endif
|
||||
|
||||
/*-------------------PIN DEFINITIONS----------------------*/
|
||||
|
||||
+2
-2
@@ -41,13 +41,13 @@ extern void MQTTtoIR(char* topicOri, JsonObject& RFdata);
|
||||
#define subjectMultiGTWIR "+/+/IRtoMQTT"
|
||||
#define IRbitsKey "IRBITS_" // bits will be defined if a subject contains IRbitsKey followed by a value of 2 digits
|
||||
#define IRRptKey "RPT_" // repeats will be defined if a subject contains IRRptKey followed by a value of 1 digit
|
||||
#define repeatIRwMQTT false // do we repeat a received signal by using mqtt, we send a command signal to subjectForwardMQTTtoIR
|
||||
#define repeatIRwMQTT false // do we repeat a received signal by using MQTT, we send a command signal to subjectForwardMQTTtoIR
|
||||
#define repeatIRwNumber 0 // default repeat of the signal
|
||||
//#define RawDirectForward false // direct repeat of IR signal with raw data
|
||||
#define RawFrequency 38 // raw frequency sending
|
||||
//#define DumpMode true // uncomment so as to see big dumps of IR codes
|
||||
|
||||
#define pubIRunknownPrtcl false // key to avoid mqtt publication of unknown IR protocol (set to true if you want to publish unknown protocol)
|
||||
#define pubIRunknownPrtcl false // key to avoid MQTT publication of unknown IR protocol (set to true if you want to publish unknown protocol)
|
||||
#define PanasonicAddress 0x4004 // Panasonic address (Pre data)
|
||||
|
||||
#if defined(ESP8266) || defined(ESP32) //IR supported protocols on ESP8266, all supported per default
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ int minimumRssi = 0;
|
||||
#define subjectMQTTtoPilightProtocol "/commands/MQTTtoPilight/protocols"
|
||||
#define subjectPilighttoMQTT "/PilighttoMQTT"
|
||||
#define subjectGTWPilighttoMQTT "/PilighttoMQTT"
|
||||
#define repeatPilightwMQTT false // do we repeat a received signal by using mqtt with Pilight gateway
|
||||
#define repeatPilightwMQTT false // do we repeat a received signal by using MQTT with Pilight gateway
|
||||
|
||||
/*-------------------RTL_433 topics & parameters----------------------*/
|
||||
//433Mhz RTL_433 MQTT Subjects and keys
|
||||
|
||||
@@ -33,7 +33,7 @@ extern void pubMqttDiscovery();
|
||||
/**
|
||||
* Create a discover messages form a list of attribute
|
||||
*
|
||||
* @param mac the mac adres
|
||||
* @param mac the MAC address
|
||||
* @param sensorList[][0] = component type
|
||||
* @param sensorList[][1] = name
|
||||
* @param sensorList[][2] = availability topic
|
||||
@@ -56,7 +56,7 @@ extern void createDiscoveryFromList(const char* mac,
|
||||
const char* device_model);
|
||||
|
||||
/**
|
||||
* @brief Generate message and publish it on an mqtt discovery exploiter. For HA @see https://www.home-assistant.io/docs/mqtt/discovery/
|
||||
* @brief Generate message and publish it on an MQTT discovery exploiter. For HA @see https://www.home-assistant.io/docs/mqtt/discovery/
|
||||
*
|
||||
* @param sensor_type the Type
|
||||
* @param st_topic set state topic,
|
||||
@@ -76,7 +76,7 @@ extern void createDiscoveryFromList(const char* mac,
|
||||
* @param device_name set device name,
|
||||
* @param device_manufacturer set device manufacturer,
|
||||
* @param device_model set device model,
|
||||
* @param device_mac set device mac,
|
||||
* @param device_mac set device MAC,
|
||||
* @param retainCmd set retain
|
||||
* @param state_class set state class
|
||||
*
|
||||
|
||||
+6
-6
@@ -239,7 +239,7 @@ ESP8266WiFiMulti wifiMulti;
|
||||
#define convertTemp_CtoF(c) ((c * 1.8) + 32)
|
||||
#define convertTemp_FtoC(f) ((f - 32) * 5 / 9)
|
||||
|
||||
// client link to pubsub mqtt
|
||||
// client link to pubsub MQTT
|
||||
PubSubClient client;
|
||||
|
||||
void revert_hex_data(const char* in, char* out, int l) {
|
||||
@@ -666,7 +666,7 @@ void setup() {
|
||||
client.setClient(*(Client*)eClient);
|
||||
|
||||
#if defined(MDNS_SD) && (defined(ESP8266) || defined(ESP32))
|
||||
Log.trace(F("Connecting to MQTT by mDNS without mqtt hostname" CR));
|
||||
Log.trace(F("Connecting to MQTT by mDNS without MQTT hostname" CR));
|
||||
connectMQTTmdns();
|
||||
#else
|
||||
uint16_t port = strtol(mqtt_port, NULL, 10);
|
||||
@@ -1013,7 +1013,7 @@ WiFiManager wifiManager;
|
||||
|
||||
//flag for saving data
|
||||
bool shouldSaveConfig = false;
|
||||
//do we have been connected once to mqtt
|
||||
//do we have been connected once to MQTT
|
||||
|
||||
//callback notifying us of the need to save config
|
||||
void saveConfigCallback() {
|
||||
@@ -1172,7 +1172,7 @@ void setup_wifimanager(bool reset_settings) {
|
||||
//set config save notify callback
|
||||
wifiManager.setSaveConfigCallback(saveConfigCallback);
|
||||
|
||||
//set static ip
|
||||
//set static IP
|
||||
# ifdef NetworkAdvancedSetup
|
||||
Log.trace(F("Adv wifi cfg" CR));
|
||||
IPAddress gateway_adress(gateway);
|
||||
@@ -1293,8 +1293,8 @@ void WiFiEvent(WiFiEvent_t event) {
|
||||
Log.notice(F("Ethernet Connected" CR));
|
||||
break;
|
||||
case SYSTEM_EVENT_ETH_GOT_IP:
|
||||
Log.trace(F("OpenMQTTGateway mac: %s" CR), ETH.macAddress().c_str());
|
||||
Log.trace(F("OpenMQTTGateway ip: %s" CR), ETH.localIP().toString().c_str());
|
||||
Log.trace(F("OpenMQTTGateway MAC: %s" CR), ETH.macAddress().c_str());
|
||||
Log.trace(F("OpenMQTTGateway IP: %s" CR), ETH.localIP().toString().c_str());
|
||||
Log.trace(F("OpenMQTTGateway link speed: %d Mbps" CR), ETH.linkSpeed());
|
||||
esp32EthConnected = true;
|
||||
break;
|
||||
|
||||
+2
-2
@@ -740,7 +740,7 @@ build_flags =
|
||||
'-DZradioCC1101="CC1101"'
|
||||
'-DZgatewayRTL_433="rtl_433"'
|
||||
'-DGateway_Name="OpenMQTTGateway_rtl_433_ESP"'
|
||||
'-DvalueAsASubject=true' ; mqtt topic includes model and device
|
||||
'-DvalueAsASubject=true' ; MQTT topic includes model and device
|
||||
; '-DPUBLISH_UNPARSED=true' ; Publish details of undecoded signals
|
||||
; '-DRTL_DEBUG=4' ; enable rtl_433 verbose device decode
|
||||
|
||||
@@ -764,7 +764,7 @@ build_flags =
|
||||
'-DZgatewayPilight="Pilight"'
|
||||
'-DZradioCC1101="CC1101"'
|
||||
'-DGateway_Name="OpenMQTTGateway_multi_receiver"'
|
||||
'-DvalueAsASubject=true' ; mqtt topic includes model and device (rtl_433) or protocol and id ( RF and PiLight )
|
||||
'-DvalueAsASubject=true' ; MQTT topic includes model and device (rtl_433) or protocol and id ( RF and PiLight )
|
||||
; '-DDEFAULT_RECEIVER=1' ; Default receiver to enable on startup
|
||||
|
||||
[env:tinypico-ble]
|
||||
|
||||
@@ -102,7 +102,7 @@ board_build.ldscript = eagle.flash.1m64.ld ;this frees more space for firmware u
|
||||
;hacked Sonoff RF-Bridge OTA flash
|
||||
[env:sonoff-rfbridge-hacked-ota]
|
||||
upload_protocol = espota
|
||||
upload_port = <ip> ;change this to the ip address of you SRFB
|
||||
upload_port = <ip> ;change this to the IP address of you SRFB
|
||||
upload_speed = 512000
|
||||
upload_flags =
|
||||
--auth=OTAPASSWORD
|
||||
|
||||
Reference in new issue
Block a user