Request: SOMA Smart Shades support
Closed this issue · 31 comments
It would be super peachy keen if you added support for SOMA Smart Shades. A bunch of work has been done in this Homebridge plugin that can hopefully be leveraged: https://github.com/ebaauw/homebridge-soma/blob/main/lib/SomaClient.js
Hi!
it is difficult to create the connector from the first try without the device itself. So it requires debug work on your side.
I tried to implement MVP in the branch, you can install it from github:
pip3 install -U https://github.com/devbis/ble2mqtt/archive/refs/heads/soma-shades.zip --no-cache-dir --force-reinstall
The device type in config is soma_shades
. Run it in console and there will be some logs to the output when it fails on connect or reading/writing data. It can help me to fix the connector.
Will do, thanks!
It finds the shade and it can send open/close commands, but it's not returning the correct values for the battery level or shade position:
INFO:ble2mqtt.__main__:Starting BLE2MQTT version 0.1.0a45
INFO:ble2mqtt.ble2mqtt:Connected to 192.168.254.70
INFO:ble2mqtt.devices.base:Connected to cd:78:8d:2c:c7:d8
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade name: bytearray(b'S'), version: bytearray(b'v2.2.10')
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.OPEN: 'open'>, target_position=100)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "CLOSE"
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] Maximum position reached. Set to OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.OPEN: 'open'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "STOP"
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.STOPPED: 'stopped'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "CLOSE"
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] Maximum position reached. Set to OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.OPEN: 'open'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "STOP"
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.STOPPED: 'stopped'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "CLOSE"
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] Maximum position reached. Set to OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=0, position=100, illuminance=0, run_state=<CoverRunState.OPEN: 'open'>, target_position=0)
This was after hitting "down" and "stop" a few times, then just letting it close. I believe the shade sends its current position as part of its BLE announcement, so that could be used instead of polling. At the moment, the battery and shade position are not being updated.
Obviously, it didn't work from the first try. :-D
I'll add more debug output to the connector.
What was the initial state of shades? Were they open?
Yes, they were open. And it worked better than I expected for the first try. :)
btw, the folks at SOMA are willing to provide test units for developers: home-assistant/core#50782 (comment)
Hey @Djelibeybi I added more debug logs and fixed an issue with incorrect switching between run states. Can you please reinstall (with the command above) and run it once again.
I had to make this small fix to get it to connect:
--- a/ble2mqtt/protocols/soma.py
+++ b/ble2mqtt/protocols/soma.py
@@ -90,7 +90,7 @@ class SomaProtocol(BLEQueueMixin, BaseDevice, abc.ABC):
cmd = bytes([
ConfigCommandCodes.QUERY.value,
0x01, # length
- ConfigCommandCodes.MOTOR_SPEED,
+ ConfigCommandCodes.MOTOR_SPEED.value,
])
await self.client.write_gatt_char(
self.CONFIG_CHAR,
@@ -98,7 +98,7 @@ class SomaProtocol(BLEQueueMixin, BaseDevice, abc.ABC):
response=True,
)
ble_notification = await self.ble_get_notification(timeout=10)
- if ble_notification[1][0] != ConfigCommandCodes.MOTOR_SPEED:
+ if ble_notification[1][0] != ConfigCommandCodes.MOTOR_SPEED.value:
return None
return ble_notification[1][2]
It looks like it's not getting the position correctly. This is the output of me manually hitting the down button from Lovelace on an open shade:
INFO:ble2mqtt.__main__:Starting BLE2MQTT version 0.1.0a45
INFO:ble2mqtt.ble2mqtt:Connected to 192.168.254.70
INFO:ble2mqtt.devices.base:Connected to cd:78:8d:2c:c7:d8
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade name: bytearray(b'S'), version: bytearray(b'v2.2.10')
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_battery: [43]
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_target_position: [00]
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:charging_notification: 66: 71 00 45 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_light_and_panel: [71 00 45 00]
INFO:ble2mqtt.protocols.soma:generic notification: 71: ff 03 01 01 64
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_battery: [43]
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_target_position: [00]
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:charging_notification: 66: 71 00 45 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_light_and_panel: [71 00 45 00]
INFO:ble2mqtt.protocols.soma:generic notification: 71: ff 03 01 01 64
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.OPEN: 'open'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "open", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: CLOSE
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "CLOSE"
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _set_position: 100
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 96
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: STOP
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "STOP"
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 03
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _stop: None
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.STOPPED: 'stopped'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "stopped", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 00
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: CLOSE
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "CLOSE"
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _set_position: 100
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 96
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [0b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: STOP
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "STOP"
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _stop: None
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.STOPPED: 'stopped'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "stopped", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 03
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 2f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 00
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: CLOSE
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] set mode cover to "CLOSE"
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _set_position: 100
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 96
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [58 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 03
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:generic notification: 71: 01 01 00
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=89, position=100, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closing", "position": 100, "battery": 89, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
^CINFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=offline
INFO:ble2mqtt.__main__:Bye.
If I restart ble2mqtt
then the entity gets the correct position value of 0 (fully closed):
INFO:ble2mqtt.__main__:Starting BLE2MQTT version 0.1.0a45
INFO:ble2mqtt.ble2mqtt:Connected to 192.168.254.70
INFO:ble2mqtt.devices.base:Connected to cd:78:8d:2c:c7:d8
INFO:ble2mqtt.devices.blinds_soma:Soma_S_SOMA_Test_Shade name: bytearray(b'S'), version: bytearray(b'v2.2.10')
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_battery: [42]
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_target_position: [64]
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:charging_notification: 66: 73 00 73 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_light_and_panel: [73 00 73 00]
INFO:ble2mqtt.protocols.soma:generic notification: 71: ff 03 01 01 64
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_battery: [42]
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_target_position: [64]
INFO:ble2mqtt.devices.blinds_soma:position_notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:charging_notification: 66: 71 00 49 00
INFO:ble2mqtt.protocols.soma:Soma_S_SOMA_Test_Shade _get_light_and_panel: [71 00 49 00]
INFO:ble2mqtt.protocols.soma:generic notification: 71: ff 03 01 01 64
INFO:ble2mqtt.devices.blinds_soma:[Soma_S_SOMA_Test_Shade] send state=SomaState(battery=88, position=0, illuminance=113, motor_speed=None, run_state=<CoverRunState.CLOSED: 'closed'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"linkquality": null, "state": "closed", "position": 0, "battery": 88, "illuminance": 113}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
Same thing happens from closed, i.e. if I open the shade the position isn't updated. It also happens if I use the slider to set a particular target position or just the arrows and stop button.
Tried to fix the issue with the reading of the current position. Also, motor speed reading is fixed.
Can you please try the updated version?
It works! Position is updated within 1-2 seconds after the blind stops moving for both manual control and when I set a target position.
I also noticed that the battery level is correct in the attributes of the cover entity, but the sensor.battery_soma_test_shade
entity says "Unknown". Would be awesome to get an illuminance sensor too. :)
Position is updated within 1-2 seconds after the blind stops
Does that mean that shades don't update their position while moving? Is the state (opening, closing, closed) correct?
BTW, I exposed battery and illuminance sensors. I don't know the exact factor to convert values from the light sensor to luxes. I saw 113 in your log and decided to display them as (value * 10) lx
.
If the factor is incorrect and should be fixed, let me know.
It may be a Lovelace/display thing, but the position of the blind in the interface didn't change until the blind stopped.
And does the position change in console logs while moving?
No, the position doens't update in the console logs either.
Could you post more logs here from shades moving? I removed direct position querying to handle notifications and I can't understand, is it incorrect notification parsing or I still need to poll the position.
And check the new version please, are battery and illuminance sensors in place?
Battery and illuminance sensors are in place and working. :)
Here's the log from me opening the blind (from closed) then closing to 75:
INFO:ble2mqtt.__main__:Starting BLE2MQTT version 0.1.0a45
INFO:ble2mqtt.ble2mqtt:Connected to 192.168.254.70
INFO:ble2mqtt.devices.base:Connected to cd:78:8d:2c:c7:d8
INFO:ble2mqtt.devices.blinds_soma:Soma_Avi's_Office0___SOMA_Test_Shade name: bytearray(b"Avi\'s Office0 \x00"), version: bytearray(b'v2.2.10')
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_battery: [3e]
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_target_position: [64]
INFO:ble2mqtt.protocols.soma:Notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.protocols.soma:Notification: 66: 71 00 71 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_light_and_panel: [71 00 71 00]
INFO:ble2mqtt.protocols.soma:Notification: 71: ff 03 01 01 64
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_battery: [3e]
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_target_position: [64]
INFO:ble2mqtt.protocols.soma:Notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.protocols.soma:Notification: 66: 71 00 71 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _get_light_and_panel: [71 00 71 00]
INFO:ble2mqtt.protocols.soma:Notification: 71: ff 03 01 01 64
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1130, motor_speed=None, run_state=<CoverRunState.CLOSED: 'closed'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1130}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closed", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 66: 70 00 71 00
INFO:ble2mqtt.devices.blinds_soma:Soma_Avi's_Office0___SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] set mode cover to "OPEN"
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _set_position: 0
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 69
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 03
INFO:ble2mqtt.protocols.soma:Notification: 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 00
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] Maximum position reached. Set to OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=100, illuminance=1120, motor_speed=None, run_state=<CoverRunState.OPEN: 'open'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1120}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "open", "position": 100}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 66: 6d 00 6e 00
INFO:ble2mqtt.devices.blinds_soma:Soma_Avi's_Office0___SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set_position: 75
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] set position cover to "75"
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0___SOMA_Test_Shade _set_position: 25
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 96
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=100, illuminance=1090, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=75)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1090}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closing", "position": 100}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=100, illuminance=1090, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=75)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1090}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closing", "position": 100}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=100, illuminance=1090, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=75)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1090}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closing", "position": 100}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 03
INFO:ble2mqtt.protocols.soma:Notification: 32: 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 00
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=75, illuminance=1090, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=75)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1090}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closing", "position": 75}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0___SOMA_Test_Shade] send state=SomaState(battery=82, position=75, illuminance=1090, motor_speed=None, run_state=<CoverRunState.CLOSING: 'closing'>, target_position=75)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 1090}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closing", "position": 75}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
^CINFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=offline
INFO:ble2mqtt.__main__:Bye.
Looks like it sends position on stop only. A returned polling for position while moving.
Also, None in motor_speed is weird. I added more logs around it. Can you please collect logs from the latest version on moving?
Ok, so the most recent update fixed the position issue: it's now reporting its position as its moving. Here are the logs from open to close:
I'm going offline now, but will check back in tomorrow morning (I'm in AU) if there are more things you need me to do.
INFO:ble2mqtt.__main__:Starting BLE2MQTT version 0.1.0a45
INFO:ble2mqtt.ble2mqtt:Connected to 192.168.254.70
INFO:ble2mqtt.devices.base:Connected to cd:78:8d:2c:c7:d8
INFO:ble2mqtt.devices.blinds_soma:Soma_Avi's_Office0_SOMA_Test_Shade name: bytearray(b"Avi\'s Office0 \x00"), version: bytearray(b'v2.2.10')
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_battery: [3e]
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_target_position: [64]
INFO:ble2mqtt.protocols.soma:Notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.protocols.soma:Notification: 66: 3a 00 3a 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_light_and_panel: [3a 00 3a 00]
INFO:ble2mqtt.protocols.soma:Notification: 71: ff 03 01 01 64
INFO:ble2mqtt.protocols.soma:_motor_speed (71, bytearray(b'\xff\x03\x01\x01d'))
INFO:ble2mqtt.protocols.soma:_motor_speed parsed {<ConfigCommandCodes.QUERY: 255>: bytearray(b'\x01\x01d')}
INFO:ble2mqtt.protocols.soma:Notification: 66: 3a 00 3a 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_battery: [3e]
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_target_position: [64]
INFO:ble2mqtt.protocols.soma:Notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.protocols.soma:Notification: 66: 3a 00 3a 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_light_and_panel: [3a 00 3a 00]
INFO:ble2mqtt.protocols.soma:Notification: 71: ff 03 01 01 64
INFO:ble2mqtt.protocols.soma:_motor_speed (71, bytearray(b'\xff\x03\x01\x01d'))
INFO:ble2mqtt.protocols.soma:_motor_speed parsed {<ConfigCommandCodes.QUERY: 255>: bytearray(b'\x01\x01d')}
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=580, motor_speed=None, run_state=<CoverRunState.CLOSED: 'closed'>, target_position=0)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "closed", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.devices.blinds_soma:Soma_Avi's_Office0_SOMA_Test_Shade receiving 0xcd788d2cc7d8/cover/set: OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] set mode cover to "OPEN"
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _set_position: 0
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 69
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 32: 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=0, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 0}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 32: 53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [53 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=17, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 17}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 32: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=36, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 36}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 32: 2c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [2c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=56, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 56}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 32: 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=78, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 78}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 32: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=99, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPENING: 'opening'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "opening", "position": 99}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 03
INFO:ble2mqtt.protocols.soma:Notification: 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Notification: 71: 01 01 00
INFO:ble2mqtt.protocols.soma:Notification: 32: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:ble2mqtt.protocols.soma:Soma_Avi's_Office0_SOMA_Test_Shade _get_position: [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00]
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] Maximum position reached. Set to OPEN
INFO:ble2mqtt.devices.blinds_soma:[Soma_Avi's_Office0_SOMA_Test_Shade] send state=SomaState(battery=82, position=100, illuminance=580, motor_speed=None, run_state=<CoverRunState.OPEN: 'open'>, target_position=100)
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8 value={"linkquality": null, "battery": 82, "illuminance": 580}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/cover value={"state": "open", "position": 100}
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=online
INFO:ble2mqtt.ble2mqtt:call publish callback topic=0xcd788d2cc7d8/availability value=offline
INFO:ble2mqtt.__main__:Bye.
Thanks for the logs, it helped a lot. I fixed the motor speed issue. Though, IDK what is this value for.
You can change the motor speed to make it quieter. SOMA call it "morning mode"
But it is not a fixed value, it changes over time. And I wonder, can I use it as a motion sign. And setting the speed is setting the max value? Have no idea what is the correct usage for it. :)
Yeah, I don't know either. :) I know that @ratsept from SOMA offered to help developers by providing more details on the Bluetooth protocol so perhaps they can help?
Hi guys,
So cool to see people working on this. I can provide help with the BLE protocol and with hardware if needed. I just now saw this issue here (probably because of the username mention). It is super late already so I just had a quick look at what is written here in this issue. And I haven't really touched the firmware for shades and especially this old motion protocol for a while now. But if I remember correctly the shade should send position updates in notifications if you enable that for the position endpoint. Also the position is updated in the ADV packet periodically.
If you need me to send you the BLE server specs I would prefer to do that in a private channel as I don't want to publish that to publicly. It's not that I want to hide it I just don't want too many things to depend on BLE protocol as it is kind of a mess and I don't want to have to support that too much. At the moment I do have a document with most of the BLE protocol descriptions that I have tried to keep up to date. If you have any specific questions like the ones about position updates then I cananswer those here in this issue publicly.
Hi @ratsept
Thanks for your readiness for help, but I think the connector is almost ready at the moment. I'm not sure will it work with another product for blinds, but there are not many testers for it. :)
I have some quick questions about ranges:
- What is the range for motor speed? It seems that the max value is 100, but what are the possible values?
- What is the factor to convert charge units into luxes? I guess there is no direct mapping but maybe we can assume that max value is ~1000-2000 lx depending on the sun direction.
Motor speed can be anything from 0..100. But since that is not really "speed" but more of a "drive strength" value lower values will fail to actually move the motor. Especially with heavy shades. Basically the value set here is used to limit the maximum the motor drive PWM can reach. So if set to 100 at full speed the motor will see pretty much the full battery voltage (minus any voltage drop over the driving electronics). At speed 50 the full speed voltage will be limited to half battery voltage. But motor speed also depends on the current battery voltage, applied load and even temperature somewhat.
Morning mode is a bit different - in morning mode actual speed feedback is used. We do that to make moving at very close to stall speed possible. But due to poor encoder choices made years ago the resolution of the encoder is only 4 pulses per revolution of the output shaft. And that makes the PID regulator very difficult to tune so morning mode is sometimes a bit ... "weird".
The charge units are actually millivolts on the new charger version(the one with the matte black solar panel). On older versions it was a voltage measured after the MPTT boost controller which had a very nonlinear range. The new version still has a little step in the voltage whenever the charger kicks in and starts pulling current from the panel (as current drops panel voltage a bit). But overall the new charger version seems to have a pretty good relationship between the amount of light on the panel and the voltage we measure. Unfortunately I don't have a good way of measuring/controlling a light source to map the actual lux value to voltage readings. I know how to do it but I just don't have the equipment nor the time right now. Also I'm not really sure why a straight lux value would even be needed. Maybe if you wanted to integrate an external system and use this lux reading there, Internally the light level trigger works well even on the voltage value.
@ratsept Thanks for the explanation. I think speed setting is not needed right now, it can work at max. And what about morning mode? How I can enable/disable and read it via GATT characteristics? It looks to be a useful feature. Github examples lack this setting.
Unfortunately I don't have a good way of measuring/controlling a light source to map the actual lux value to voltage readings.
I don't think the best precision is needed here. A 10% accuracy is still good enough, nobody checks it anyway IRL. :)
So if 200 mV is the highest value on the sun, the coefficient x10 is quite good.
@Djelibeybi Can you please check the version from another branch? I refactored a little bit and unified shades motor devices.
Just to be sure that it is not broken before the release.
pip3 install -U https://github.com/devbis/ble2mqtt/archive/refs/heads/refactoring.zip --no-cache-dir --force-reinstall
@Djelibeybi Can you please check the version from another branch? I refactored a little bit and unified shades motor devices. Just to be sure that it is not broken before the release.
This works great. I tested both manual adjustment as well as calling cover.close
, cover.open
and cover.set_position
. Awesome work.
I released a new version with the Soma shades included.
Feel free to update to the version from pip.
pip3 install -U "ble2mqtt>=0.1.0a47"
I'm closing the issue. If @ratsept
would post new information about enabling and reading status of morning mode, I'll add it as a switch to the device in Home Assistant