Closed Peter2507 closed 1 year ago
Hey your description got removed but I see it in the history
You can easily do this from HA by either creating separate "helper" buttons or toggles and creating an automation that triggers based on those
here are some example YAML you can use to get started. This will holdpress for 5 secs
Using a button
alias: TestHoldPress description: "" trigger: - platform: state entity_id: - input_button.holdpress_5sec condition: [] action: - service: mqtt.publish data: qos: "0" topic: switchbot/esp32/holdPress payload: "{\"id\":\"switchbottwo\", \"hold\":5}" mode: single
Using a toggle
alias: TestHoldToggle description: "" trigger: - platform: state entity_id: - input_boolean.holdpress_5sec_toggle to: "on" condition: [] action: - service: mqtt.publish data: qos: "0" topic: switchbot/esp32/holdPress payload: "{\"id\":\"switchbottwo\", \"hold\":5}" - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.holdpress_5sec_toggle mode: single
Hey your description got removed but I see it in the history
You can easily do this from HA by either creating separate "helper" buttons or toggles and creating an automation that triggers based on those
here are some example YAML you can use to get started. This will holdpress for 5 secs
Using a button
Using a toggle