I’d like to create an automation for switchbot to keep pushing for a certain amount of time like 10sec or so.
How can I achieve this?
Switchbot Bot without Hub through BT to HA on RasPi4
I’d like to create an automation for switchbot to keep pushing for a certain amount of time like 10sec or so.
How can I achieve this?
Switchbot Bot without Hub through BT to HA on RasPi4
I know that you can set it up in the app for one timing and I thought it’s something like a baseline.
I would want to set 3 different timings.
I do not use the native HA bt, but this integration and it does support long presses. While the current code still works, the project has not been updated for quite sometime. You will need to have a esp32 device handy.
This is my code to control my bathroom fan. It needs a long press to turn off.
switch:
- platform: template
switches:
24hr_fan:
friendly_name: '24hr Fan'
value_template: "{{ states('input_boolean.washroom_fan') }}"
turn_on:
- service: script.holdpress_bot
data:
bot: '24hr_fan'
press: 0
- service: input_boolean.turn_on
entity_id: input_boolean.washroom_fan
turn_off:
- service: script.holdpress_bot
data:
bot: '24hr_fan'
press: 3
- service: input_boolean.turn_off
entity_id: input_boolean.washroom_fan
icon_template: >-
{% if is_state('input_boolean.washroom_fan', 'on') %}
mdi:fan
{% else %}
mdi:fan-off
{% endif %}
Hi CrysKilljoy,
The switchbot app has different modes for the little robots, Look there to change the mode of the switch.
Only press and switch, nothing helpful there
Looks promising, I’ll take a look at it
I know the ones I set up I needed a press, hold, and release and could set that up in the app, and then that’s the mode it was in for HA. I used a 4 second hold to do the thing I needed.