Commit Graph

9 Commits

Author SHA1 Message Date
Florian
04c3e7ef95 Add Switchbot Blind Tilt control (#2002)
close_up, close_down, open, and percentage command
Add auto-discovery with HA and cover component
2024-08-14 14:55:15 -05:00
Florian
029409c0c3 [SYS] Implement a central queue (#1767)
to avoid concurrency issues when modules or/and gateways want to publish data
2023-11-08 07:26:21 -06:00
Florian
f35baa9da0 [BT] Add BM2 voltage (#1495)
* [BT] Add BM2 voltage

Voltage retrieval through a BLE connection, frequency of the BLE connection is defined by `intervalcnct`

* Add doc

Credits to https://github.com/KrystianD/bm2-battery-monitor
2023-03-02 11:02:03 -06: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
Amy Nagle
257b39da81 Add support for XMWSDJ04MMC (#1162) 2022-02-09 16:16:41 -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
Florian
90f42990df Add miflora battery (#992) 2021-06-24 20:11:50 -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
h2zero
792807e6e5 Create BLE connect class and add derivatives (#979) 2021-06-17 16:52:03 -05:00