the button automatically added by the system when i linked the hub, unsure where to find the configuration. There is no reference in the configuration.yaml
try the following:
- id: '1539717711439'
alias: garage wireless button
trigger:
- entity_id: binary_sensor.switch_158d0002132960
state: 'on'
platform: state
action:
- entity_id: switch.garage_door
service: homeassistant.toggle
When you push the button (binary sensor I’m assuming…) then it should toggle the garage switch.
I’m confused, HA / discovery added it automatically as a binary_sensor and called it a switch?
what value can you see for that button in the dev tools?
Can you also give us the output of these commands when you paste them in the template editor in the dev tools?
{{states.binary_sensor.switch_158d0002132960}}
This didn’t work unfortunately.
What do you see in the states page when you push the button?
then press the button and paste that code again to see if the timestamp changes
template is an example file, nothing specific
yeah you need to paste {{states.binary_sensor.switch_158d0002132960}}
instead of the example
I guessed that, no worries. So if you press the button the timestamp changes right?
Are you in any way able to hold the button and refresh the template page (just press enter) and see if the state changes (should show =on; at the end of the first line
what are these 2 buttons? you’re currently trying to use the garage switch but I see you have a garage wireless button…
Garage Switch = Belkin Wemo Maker (opens door)
Garage Wireless button = automation built with GUI (allows an option to turn on and off on main screen)
Thanks. Your garage switch doesn’t appear to change states so you can’t use it to open your door I’m afraid.
It’s either not configured correctly or not working…
i wonder if it needs more configuration, as it showing as pressed in the Mi home app. Home assistant picked it up instantly.
its working… code that works in case anyone has similar need
- id: '1539717711439'
alias: garage wireless button
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0002132960
click_type: single
action:
service: switch.toggle
entity_id: switch.garage_door
checked other forum posts (this one in particular) and this appears to be a working trigger:
- alias: Xiaomi Button
trigger:
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_xxxxxxxxxxxxxxx
click_type: long_click_press
action:
service: light.toggle
data:
entity_id: light.gateway_light_xxxxxxxxxxx