v3.2 release. I haven’t tried your scripts yet, but I am able to call setHold and immediately after a press command. They will process in order by the esp32
Yes when the switch is in press mode, OFF is disabled/ignored. This is normal. A switch in press mode will always default to state = “OFF”. To do the press action, simply always call the ON command
If you want to manage an ON/OFF switch that controls a press action, you would need to create a separate device. The switchbot has no idea of the ON/OFF state when in press mode
the hold secs value is returned by an automatic requestSettings call that is made right after the hold secs command. You will find the hold secs confirmed value here on the settings topic. HA receiving a message on the settings topic will update the hold secs in HA
- <ESPMQTTTopic>/bot/<name>/settings
Example payloads:
- {"firmware":4.9,"timers":0,"inverted":false,"hold":5}
If you want to manage an ON/OFF switch that controls a press action, you would need to create a separate device. The switchbot has no idea of the ON/OFF state when in press mode
oh. I read some comments about this, but didn’t quite understand.
Control MQTT Received...
Received something on switchbotmqtt/esp32/control
24hr_fan
Processing Control MQTT...
Device: 24hr_fan
Device value: ON
Try to connect. Try a reconnect first...
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
Reconnect failed
Connected
Connected to: fa:b6:25:7b:05:e4
RSSI: -79
Sending command...
subscribed to notify
CUSTOM write service not found.
Sending command...
Attempt to send command. Not connecting. Try connecting...
Try to connect. Try a reconnect first...
Connected
Reconnected client
Connected to: fa:b6:25:7b:05:e4
RSSI: -83
subscribed to notify
Wrote new value to: cba20002-224d-11e6-9fb8-0002a5d5c51b
notifyCB
deviceName: WoHand
Success! Command sent/received to/from SwitchBot
The response value from bot action: 5
Done sendCommand...
I am testing the curtain using the position service now and this is in log. but it seems to be working so far. need to play with it some more though.
Control MQTT Received...
Received something on switchbotmqtt/esp32/control
cr_curtain_lt
Processing Control MQTT...
Device: cr_curtain_lt
Device value: 73
Try to connect. Try a reconnect first...
Connected
Connected to: c5:c6:df:94:48:bc
RSSI: -108
Sending command...
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
CUSTOM notify service not found.
Sending command...
Attempt to send command. Not connecting. Try connecting...
Try to connect. Try a reconnect first...
Connected
Reconnected client
i think you scripts are correct, but it kay be that we have different model bots. I may need to het the correct BLE service value for your models
once the hold time is set, the bot will remember it in its memory. same as setting it through the switchbot app. the following press actions will use the latest hold time in the bot memory
most likely though our bots are different models with that custom writr service bot found error
once the hold time is set, the bot will remember it in its memory. same as setting it through the switchbot app. the following press actions will use the latest hold time in the bot memory
So it doesn’t matter what the settings in the app is at. If you set a hold time, it will that over the app hold time value?
This hold value is not taken from the app correct? It should read 3 if it is.
About the Curtain on V3.2.
It seems to be working find now. I was moving the curtain using only the position and it seems to work. I noticed that the position # in HA and the mobile app is reverse.
Position: 100 in HA shows that the curtain is open.
The mobile app position: 100 shows that the curtain is closed.
This image shows the curtain to be open and the position is 2 which is close to zero.