Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for binary_sensor #15

Open
ruimarinho opened this issue Mar 17, 2018 · 3 comments
Open

Add support for binary_sensor #15

ruimarinho opened this issue Mar 17, 2018 · 3 comments

Comments

@ruimarinho
Copy link

I think ideally the Xiaomi Door Sensor should behave as a binary_sensor instead of the suggested config as a switch as there is no action available - it would either report as open or closed.

@elric91
Copy link
Owner

elric91 commented Mar 17, 2018

Yes I'm thinking about it
You can already configure it as one, but you loose all the advantages related to the switch behavior and representation

@Neraud
Copy link

Neraud commented Mar 17, 2018

A binary_sensor can be typed to represent a door using a device_class : https://home-assistant.io/components/binary_sensor/

@ruimarinho
Copy link
Author

I'm using this as an alternative:

- platform: template
  sensors:
    main_door_binary_sensor:
      value_template: "{{ is_state('sensor.main_door', 'on-press') }}"
      device_class: door
      entity_id: sensor.main_door

I don't think it would work out of the box, would it?

- platform: zigate
  sensors:
    main_door_binary_sensor:
      device_class: door
      entity_id: sensor.main_door

@elric91 - thanks for the great work on this component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants