Commit Graph
305 Commits
Author SHA1 Message Date
Florian ef41546c94 ESP8266: Fix partial erase of connection settings (#1150)
* Fix partial erase of connection settings

#1149

* Update WM version and add disconnect
2022-01-27 15:47:55 -06:00
Florian a9342f743f Change unique id structure for HASS discovery (#1147)
Now:
"uniq_id":"882D777014C-pres"
before it was:
"uniq_id":"882D7770014C-CLEARGRASSTRHKPA-pres"
This will impact BLE and gateways entities
2022-01-27 15:47:29 -06:00
h2zero f8b4b3ca21 Add "mac_type" parameter to BLE connection commands. (#1146)
This allows for connecting to devices that do not use the MAC address type 0.
This also adds the logging of the "mac_type" so it is visible to users trying to connect to broadcasting devices.

Additionally this will allow for future connectable devices using a MAC address type other than 0 to be automatically connected to
when support is added for them, similar to LYWSD03MMC etc..
2022-01-25 06:19:50 -06:00
h2zero e838d3cee0 Remove std::string as the model id and use decoder enum. (#1143)
* Remove std::string as the model id and use decoder enum.

* Update decoder version

* Check model id is in decoder range when launching discovery.

* Add BLEconnect enum MIN/MAX
2022-01-24 20:09:15 -06:00
h2zero 91ab8dcdf1 Fix some incorrect timeouts when taking semaphores. (#1145) 2022-01-24 05:50:14 -06:00
h2zero 5dac1a7035 Add immediate parameter to BLE connection commands. (#1137)
* Add immediate parameter to BLE connection commands.

When sending a command to read/write a characteristic on a BLE server this adds a new parameter to cause the action to be
performed immediately. This will stop the scan in progress to perform the actions queued.

Example use:
```
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{
  "ble_write_address":"AA:BB:CC:DD:EE:FF",
  "ble_write_service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b",
  "ble_write_char":"cba20002-224d-11e6-9fb8-0002a5d5c51b",
  "ble_write_value":"TEST",
  "value_type":"STRING",
  "ttl":4,
  "immediate":true }'
```

Stop BLE processing when immeditate command sent.

* Use a shorter connection timeout.

* Update docs.

* Remove MQTT spam for connection retrys

* Prevent crashing when the normal connection process occurs at the same time as an immediate action.

* Use a semaphore to protect BLE device vector.
2022-01-23 19:47:17 -06:00
h2zero 8b40b68081 Use write with response non-response write is not available. (#1136)
If the BLE characteristic does not have write without response available this will default to using write with response.
2022-01-18 16:52:03 -06:00
Florian 749c1592b4 Add M5Tough board (#1135) 2022-01-17 19:22:26 -06:00
Northern Man 9546f43cd6 Behaviour when MQTT and/or Wifi is not available (#1126)
* Behaviour when MQTT and/or Wifi is not available

I was looking into why all my OpenMQTTGateway devices were not responding after a recent power failure and am speculating that the ESP32 was able to restart faster than my Wifi and MQTT Server was able to restart and resume operations.  And was thinking that a generic ESP.restart may be a reasonable approach with repeated Wifi and/or MQTT connection failures.

As mentioned here https://community.openmqttgateway.com/t/behaviour-when-mqtt-and-or-wifi-is-not-available/1747

Added new variable maxRetryWatchDog, which is the maximum number of mqtt or wifi connection attempts before restarting gateway device.
2022-01-17 16:16:43 -06:00
Florian 149aa40802 Increase MQTT Packet size to enable longer certificates to pass (#1134)
* Increase MQTT Packet size to enable longer certificates to pass

through mqtt for OTA

* Enable to define the mqtt packet size with an external macro
2022-01-17 07:05:02 -06:00
Florian 76b2f0a0e1 fix wifi manager portal missing parameters on esp8266 (#1132)
* fix wifi manager portal missing parameters on esp8266

on esp8266 with ZgatewayBT
Reducing the scope of the parameters on wifi manager for esp8266 to enable to enter properly the configuration
2022-01-15 18:28:11 -06:00
Florian 665078f5f5 Fix ir protocol name not correctly displayed on esp8266 (#1129) 2022-01-14 17:46:19 -06:00
Florian 71d5622a52 Filter discovery messages against HASS classes list (#1127)
* Filter the discovery message content against HASS list of classes
2022-01-11 20:24:09 -06:00
Benoit Courty 892cbc35f5 Fix DS18B20 not working properly (#1121)
* Fix Switch Celcius and Fahrenheit

* Fix overflow issue
2022-01-02 18:15:43 -06:00
Benoit Courty 5c3eccbb18 Adding low_pulse (#1120)
* Adding low_pulse
2022-01-01 19:47:23 -06:00
Florian 66ce0d5a41 Generalize the use of JSON_MSG_BUFFER (#1114)
* Generalize the use of JSON_MSG_BUFFER

instead of calculated buffer
2021-12-20 19:37:06 -06:00
Thomas Kern afd7a96537 only restore an active receiver if it is available (#1115)
* only restore an active receiver if it is available
2021-12-20 19:36:13 -06:00
Florian 00709675bc Correct log display for std::string (#1111) 2021-12-13 18:50:40 -06:00
h2zero 8e6ebe87c9 Use a queue and separate task to process BLE devices. (#1110)
This avoids excess processing in the BLE advertised device callback and prevents overflowing the BLE host stack.
2021-12-13 17:29:44 -06:00
h2zero d590c34c03 Fix memory leak introduced in #1092 (#1109) 2021-12-12 09:41:25 -06:00
Florian 7dc49165a0 Discovery with theengs decoder (#1106)
* Discovery with theengs decoder

* Add devices to doc

* Correct missing suffix for DT24
2021-12-11 11:54:08 -06:00
Florian dcbce352be AWS IOT compatibility
implement compatibility with Amazon Web Services IOT through an MQTT connection with certificates. (#1099)
2021-11-07 07:44:50 -06:00
Alessandro Staniscia 4b53a30af4 Review of data structure (#1096) 2021-11-06 16:00:20 -05:00
Alessandro Staniscia bdda5df839 rationalisation of logs and removal of duplicate codes (it should fix also #931) (#1093)
* Rationalisation of logs and removal of duplicate codes
2021-11-02 16:46:01 -05:00
Florian 10f0d4cff4 Theengs decoder integration (#1092)
* Use Theengs Decoder for BLE device decoding
2021-10-31 16:51:05 -05:00
Thomas KernandKern, Thomas c5f7a3a55e Save currently active receiver and restore on reboot (#1091)
* save active receiver and restore on reboot

Co-authored-by: Kern, Thomas <thomas@kernwelt.de>
2021-10-29 16:53:05 -05:00
Alessandro Staniscia e9ce921717 Add support for discovery device trigger (#1090)
* Add announce of DeviceTrigger +  Update doc
2021-10-24 08:30:36 -05:00
Chris van Marle f84a878400 Configurable amount of RF2 repeats (#990)
* Make number of RF2 repeats configurable

* Reduce number of repeats

Number of repeats in NewRemoteTransmitter is by default 16, which takes
quite some time to send.

It actually runs 2^R repeats, where R is the configured amount.

https://github.com/1technophile/NewRemoteSwitch/blob/86f1c8486c80919ef70e86504e8a9580c34b4fab/NewRemoteTransmitter.cpp#L20
2021-10-20 06:08:58 -05:00
Alessandro Staniscia e14a78e9c0 Support Home Assistant Long-term Statistics #1087 (#1088) 2021-10-14 18:46:13 -05:00
Florian 9a8606bd29 Fix self signed certificate function (#1084)
when using mqttset
and add the macro into a test environment
2021-10-05 17:58:01 -05:00
Florian dbedcf065d Add mqtt_secure connection condition for logging (#1082)
* Add mqtt_secure connection condition

when logging SSL error status
2021-09-21 17:43:18 -05:00
MountComb 36f4f89fbb fix BT not connected issue when using whitelist (#1080) 2021-09-19 09:40:41 -05:00
h2zero ed4949f769 Update to use ArduinoJson 6+ (#1071) 2021-09-01 19:18:19 -05:00
Florian 01301a1485 Change BLE TPMS count to match associated number (#1070)
Currently this count start at 0 whereas it should start at 1
2021-08-28 20:21:20 -05:00
Florian 0ede075843 Add esp32-wt32-eth01 ethernet board (#1064)
* Add esp32-wt32-eth01 ethernet board
2021-08-17 18:48:11 -05:00
Northern Man 94a7792863 Support for BME280 Temperature Correction (#1062)
* Support for BME280 Temperature Correction

The Spark Fun BME 280 library has support for Temperature correction, and this pull request implements the ability to apply a correction via a compiler directive ( BME280Correction ).
2021-08-16 19:35:02 -05:00
h2zeroandFlorian ca616939b8 Add ability to change MQTT topic and or gateway name by MQTT command. (#1053)
* Add ability to change MQTT topic and or gateway name by MQTT command.

This adds new commands to allow changing the MQTT topic and or gateway name from a command.
The new topic/name will be saved in flash memory and used on subsequent reboots.
Either/both parameters can be sent or combined with other commands.

Example use:
```
mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m
'{
  "mqtt_topic": "topic/",
  "gateway_name: "name"
}'
```

* Update example with /

Co-authored-by: Florian <1technophile@users.noreply.github.com>
2021-08-05 05:50:16 -05:00
h2zeroandFlorian 702c4b7fea Allow for hiding mqtt config settings in wifimanager setup. (#1049)
* Allow for hiding mqtt config settings in wifimanager setup.

Adds the macro `WIFIMNG_HIDE_MQTT_CONFIG` that when defined will hide the mqtt configuration in the wifimanager setup.

Co-authored-by: Florian <1technophile@users.noreply.github.com>
2021-08-04 06:12:19 -05:00
Florian a4106cf0e9 MQTT secure improvements (#1047)
* Add SYStoMQTT mqtt secure infos

* BugFix: correct retrieving of mqtt broker secure status and cert from memory
2021-08-01 15:46:14 -05:00
Florian 7f296ff5fa update Ibeacon keys naming (#1045)
lower case as the other json keys
2021-07-31 14:45:31 -05:00
h2zero ad782c4b1f Remove duplicate BLE service data sent over MQTT(#1044)
This will remove the sending of BLE service data when multiple service data attributes are advertised by a broadcasting device.

Instead the data for known device types will be consolidated into a single message to reduce overhead.
2021-07-31 10:08:53 -05:00
h2zero 2dedabc52f Add "server_cert" parameter to firmware_update command. (#1043)
When updating from the MQTT command from a SSL enabled server this adds an option to provide
the server SSL certificate with the command.

This is useful if connecting to different servers or if the configured certificate has expired
and requires updating to not lose the ability to update via OTA.

The certificate provided will be saved to flash memory for use on subsequent restarts.
2021-07-29 16:13:30 -05:00
h2zero a4a85ff14b Bugfix: missing break in BLE connect switch. (#1042)
Fixes #1041, GENERIC device case was falling through to MiFlora.
2021-07-28 16:43:06 -05:00
Florian c2107da1c7 Add BLE TPMS sensors (#1031)
* Add BLE TPMS sensors

tire pressure monitoring system
2021-07-27 06:34:45 -05:00
Florian 72f3960c13 Enable transmit outside of CC1101 (#1039)
See:
https://community.openmqttgateway.com/t/esp32-esp8266-fail-to-send-rf-signal/1618/11
2021-07-27 05:29:15 -05:00
DigiH 2d82cacd05 Suggestion to also allow BLE WRITE procedures for characteristics which are only WriteWithoutResponse (#1037)
While playing with the new BLE READ/WRITE feature for my Playbulb Candles I found that writing was not possible for characteristics which are WriteWithoutResponse only.

I implemented this quick fix which might be useful for others with devices for which they want to write to WriteWithoutResponse characteristics.

Alternatively a more slective option could be possible for a future release, i.e. adding an additional WRITE tag like "ble_write_withoutresponse": true/false
2021-07-26 19:40:37 -05:00
Marc Plano-Lesay 91497da71c Advertise discovery of the battery sensor for MiFlora devices (#1032)
Follow-up on #992, #217
2021-07-21 06:30:45 -05:00
Ray Cielencki 910ff91d08 fix: add code for miscale_v2 lbs (#1029) 2021-07-18 12:53:05 -05:00
Florian ff089923da Deactivate RF switch discovery per default (#1026)
* Deactivate RF switch discovery per default

To prevent creating many switches into Home Assistant
2021-07-17 17:18:53 -05:00
h2zero 379df34701 Set OTA name as Gateway_Short_Name + MAC if using mac as gateway name. (#1023)
* Set OTA name as Gateway_Short_Name + MAC if using mac as gateway name.

This will set the OTA name of the gateway to the *Gateway_Short_Name*_*MAC* when USE_MAC_AS_GATEWAY_NAME is defined in the config.

* Log OTA hostname when using MAC as gateway name.
2021-07-17 07:50:08 -05:00