Commit Graph

54 Commits

Author SHA1 Message Date
Florian
779cdba711 [BT] Off timer add for binary sensors 2023-12-04 18:07:19 -06:00
Florian
7f9f042f7c [BT] Add gateway deactivation/activation command (#1821) 2023-12-04 12:20:10 -06:00
DigiH
5421f0e995 [DOCS] typo fixes (#1816) 2023-11-26 13:07:18 -06:00
Florian
e576b26b8c [BT] Fix HA discovery for motion and door sensor (#1798)
* [BT] Fix HA discovery for motion sensor

* Add status binary sensor and text sensor
2023-11-13 17:14:21 -06:00
DigiH
45bd18b03c [BT] BM2 Tracker addition and Discovery adjustment (#1765)
* BM2 as Tracker additions

* BM2 discovery update
2023-10-12 15:29:20 -05:00
Florian
3470882da0 [DISC] Add BT scan duration parameter auto discovery (#1762)
* [DISC] Add BT scan duration parameter auto discovery

* Add doc
2023-09-30 07:26:57 -05:00
Florian
7a2bb04a1b [DOCS] Theengs Plug highlight and SEO improvements (#1730)
* [DOCS] Theengs Plug highlight

* Add alt content for images and description
2023-08-11 13:04:52 -05:00
Florian
5ff086a296 [BT] Fix BLE MQTT command trigger a reset (#1698)
Problem introduced with the bump of ESP32 platform from 3.5.0 to 6.1.0
2023-06-26 05:13:41 -05:00
DigiH
561de90c94 [DOCS] Typo fixes (#1688) 2023-06-16 20:45:31 +02:00
DigiH
7df72f6983 [DOCS] formatting fix (#1651) 2023-05-22 14:52:05 -05:00
Florian
b1667190d5 [BLE] Add moving beacon detection (#1636) 2023-05-11 07:42:52 -05:00
Florian
b806ea9354 [DOCS] Fix tip note for switchbot (#1577) 2023-03-26 10:29:23 -05:00
Florian
404b224871 [DOCS] Update presence detection docs (#1575) 2023-03-24 19:54:21 -05:00
Florian
85650a6204 [BT] Device tracker presence detection (#1548)
Add device tracker detection and automatic creation following HA discovery convention
So as to trigger the away state, add an offline status to the identified BLE trackers
2023-03-20 07:31:00 -05:00
Florian
3ceb19f7be [DOCS] Improbe BLE gateway guide (#1530)
Add images, intro and reorganize sections
2023-03-13 19:28:32 -05:00
DigiH
c7547044fe Scan_Duration as MQTT command (#1516)
Scan_Duration as runtime MQTT command 'scanduration'
2023-03-10 15:12:08 -06:00
DigiH
95b749833c [BT] Known Random MAC address filtering (#1514)
* [BT] Random MAC address filtering

Random MAC address filter with runtime boolean setting
randommacs

* APPLE_CONT added to discovery and data process
2023-03-09 09:35:16 -06:00
DigiH
bc9311828a [DOCS] Adaptive scanning addition (#1468) 2023-02-22 07:13:50 -06:00
Florian
7c0fafd48e [BT] Continuous active scanning when adaptive scanning is false (#1448)
Set `interval` and `intervalacts` to the minimum when adaptive scanning is deactivated. When the user encounters a situation on which a device is not detected due to adaptive scanning, we set the gateway to continuous active to maximize the chance to detect the device.
2023-02-10 17:05:52 -06:00
Florian
f283327998 [BT] - Adaptive scan (#1440)
* [BT] Adaptive scan

Add adaptive scan to avoid users setting parameters and deduct automatically the scan requirements from the list of devices

---------
Co-authored-by: DigiH <github@digih.net>
2023-02-07 17:36:18 -06:00
DigiH
05f83c5f80 Active Scan Interval (#1433) 2023-02-07 12:25:40 -06:00
DigiH
bd9dcf1ec8 Tag properties visibility (#1432)
Tag properties visibility to be included with "pubadvdata" setting
2023-02-01 19:41:01 -06:00
Florian
4e885a7cd0 [BT] Regular BT connect based on time (#1423)
instead of number of scans, as users changing the interval to continuous scanning may have connect attempts to frequently
2023-01-26 09:28:16 -06:00
Florian
a3603c6a78 [BLE] Simplify the publication of advertisement data (#1408)
With only one control that enables the publication of all the advertisement data, default: false
Note that if the sensor is not recognized, we will no longer publish its advertisement data unless the control is true. This is for the sake of traffic reduction.
2023-01-20 14:30:11 -06:00
DigiH
8a767cf4b8 Typo fixes (#1381) 2023-01-08 07:43:15 -06:00
Florian
8dde777fb7 [BLE] Add dynamic active scan runtime setting (#1360)
This commit add the capability to set passive scanning during runtime, versus buildtime before, so as to improve energy consumption of sensors when they don't require active scanning
2022-12-14 17:03:34 -06:00
Florian
bf38bb52f6 Remove HM10 support (#1282)
Removing HM10 support as announced in the forum
2022-10-10 20:34:12 -05:00
Bad
312ef858c1 Modify new BT config using MQTT (#1259)
* Move BTConfig_default to ZgatewayBT.ino as BTConfig_init()

* Remove unused function declaration & typo

* Move bleconnect outside of ifdef ESP32

* Add new parameters to json payload on MQTTtoBT/config
And move them to function BTConfig_fromJson()

new parameters: [presenceEnable, presenceTopic, presenceUseBeaconUuid, extDecoderEnable,
extDecoderTopic, filterConnectable, pubKnownServiceData,
pubUnknownServiceData, pubKnownManufData, pubUnknownManufData,
pubServiceDataUUID, pubBeaconUuidForTopic]

* Add ignoreWBlist as new configuration parameter

* Keep hasspresence keyword (do not use presenceEnable)

* Documentation

* Typos & Optimizations arround RemoveJsonPropertyIf

* Template for BT config update

* Ensure BTConfig.minRssi sign does not matter

* Report configuration change on topic /commands/BTtoMQTT/config

# Conflicts:
#	main/ZgatewayBT.ino

* Add BT config bool commands (init, load, erase & save) to persist config parameters

* Documentation

* Fix pre-compilation issue

* Fix Code Format

* Use Preference only for ESP32

* Update Doc
2022-09-03 15:08:07 -05:00
DigiH
c4300a002f MQTT-MAC-IP-mDNS (#1245) 2022-07-19 12:10:51 -05:00
DigiH
1c62d74e56 Typo-fixes (#1244) 2022-07-19 07:53:38 +02:00
DigiH
0f57eddb01 typo fixes (#1243) 2022-07-18 11:30:37 -05:00
h2zero
8d6acbee12 Add Switchbot support and discovery. (#995)
* Use a task to process immediate BLE actions to prevent MQTT disconnection if the action takes too long to complete.

* Add state_on and state_off parameters to createDiscovery
2022-04-30 09:16:06 -05: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
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
Stephen Littman
7c5538be65 Doc spelling typo (#1104)
Fixed typo
2021-12-04 13:48:15 -06:00
Florian
c06a6c9ceb [DOCS] Add new devices, parameters and LORA tutorial (#1028)
* Add new devices and parameters
* Update readme and lora use
2021-07-18 14:18:40 -05:00
Florian
bce9bf3e00 Minor readme update (#1025)
* readme and BLE update
2021-07-16 20:09:47 -05:00
h2zero
7cfbd3d050 Ble read/write characteristics over MQTT. (#988)
* EXPERIMENTAL: Ble read/write characteristics over MQTT.

Uses #979

This allows reading and writing BLE characteristics from an MQTT message.

Example format:
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", "ttl":4 }'
mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"ble_read_address":"30:AE:A4:7C:3C:A6", "ble_read_service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b", "ble_read_char":"cba20002-224d-11e6-9fb8-0002a5d5c51b", "ttl": 2 }'
The ttl parameter is the number of calls to connect (defaults to 1), which occur after the BLE scan completes.

A response is provided over MQTT in the format:
write : {"id":"30:AE:A4:7C:3C:A6","service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b","characteristic":"cba20002-224d-11e6-9fb8-0002a5d5c51b","write":"TEST","success":true}
read : {"id":"30:AE:A4:7C:3C:A6","service":"cba20d00-224d-11e6-9fb8-0002a5d5c51b","characteristic":"cba20002-224d-11e6-9fb8-0002a5d5c51b","read":"TEST","success":true}

* Add generic BLE connect class and read data as hex.

* Add value_type parameter and document usage

* Add note to docs
2021-06-21 20:27:06 -05:00
Florian
e1aef48296 [Breaking] Deactivate Home Assistant presence per default (#915)
And enable to activate it by MQTT
2021-04-04 19:34:36 -05:00
Florian
8afb1c5223 Enable deactivation of BLE connect (#895)
Useful if you want to scan continuously for BLE device, in this case you should deactivate the BLE connect to avoid concurrency between scan and connect
2021-03-14 12:53:26 -05:00
Florian
a6fb17595e [BREAKING] remove tem key (#883)
* [BREAKING] remove tem key

we rely now on tempc and tempf only
2021-03-03 18:38:37 -06:00
Florian
39568d8288 [DOC] Tip correction 2021-01-29 17:23:29 -06:00
Leon Kiefer
a83f725bad Npm docs setup (#834)
* added vuepress to package json
* use vuepress from package json
2020-12-13 12:49:13 -06:00
Florian
9a66c9ef09 HASS gateway Discovery improvements (#792)
* MQTT discovery improvements

-remove gatewayBT
-remove device class formaldehyde (not existing in HASS)
-add SYStoMQTT new parameters
-attach connectivity parameter to the device
-add BT gateway infos and switches
-refactor modules storage and publication
2020-11-04 11:53:55 -06:00
Florian
4b265384b2 DOCS improvements 2020-09-17 13:43:05 -05:00
Florian
5e2d86e963 Add publish only BLE sensors function (#741)
don't publish the non identified BLE devices when requested (at build or by MQTT setting)
2020-08-26 17:24:23 -05:00
Florian
d6d42bfce5 BLE sensors data through a connect, LYWSD03MMC and MHO-C401 add (#736)
* Add LYWSD03MMC and MHO-C401 device
and an associated BLE connect mechanism as these devices advertise only encrypted data
-free manufacturer data
-update library

* Implement scans number before connect
-Add the possibility to do a connect every X scan
-Rename variables for consistency
-Some refactoring for improved code reading
2020-08-18 12:28:45 -05:00
Florian
8d79bebab8 [breaking] Refactor the BLE devices identification (#720)
* [breaking] Refactor the BLE devices identification

generalize the use of the mac address with : for the lists, white, black and internal identification
Move structures from config_BT.h to ZgatewayBT.ino
update doc

* Move minRssi to INO and optimizations

change Minrssi name to match other variable convention
Optimize the add of : to mac address
Reduce the use of abs()

Note: I cannot move BLEinterval to the ZgatewayBT.ino due to its use on main.ino
2020-08-04 12:03:22 -05:00
Leon Kiefer
b5527d2e7b added support for secure TLS connections (#699)
* added support for secure TLS connections
on ESP32 and ESP8266 close #101

* added TLS test builds

* added documentation for TLS
fixed some some issues in the documentation

* added documentation for error code=54
2020-08-02 11:29:28 -05:00
Florian
661ef9c55e Refactor BLE gateways (#617)
* Refactor BLE gateways:
-merge HM10 and ESP32 code
-publish sensor values with the other BLE device parameters to avoid MQTT multiple publication
-make uniform the case of mac adress id between HM10 and ESP32
-add the possibility to remove service data publishing either when sensors is recognised or not
-correct manufacturing data display
-merge process cleargrass methods
-check service data validity before processing
2020-06-05 08:09:49 -05:00