mitch-dc/volkswagen_we_connect_id

Change sensors to binary_sensor

Opened this issue · 3 comments

please change the sensors to binary_sensor: Then these can be used into correct groups.

  • auto_unlock_plug_when_charged
  • auto_unlock_plug_when_charged_ac
  • bonnet_lock_status as device_class: 'lock'
  • bonnet_open_status as device_class: door
  • door_front_left_lock_status as device_class: 'lock'
  • door_front_left_open_status as device_class: door
  • greyce_right_lock_status as device_class: 'lock'
  • door_front_right_open_status as device_class: door
  • door_rear_left_lock_status as device_class: 'lock'
  • door_rear_left_open_status as device_class: door
  • door_rear_right_lock_status as device_class: 'lock'
  • door_rear_right_open_status as device_class: door
  • trunk_lock_status as device_class: 'lock'
  • trunk_open_status as device_class: door
  • window_front_left_open_status as device_class: window
  • window_front_right_open_status as device_class: window
  • window_rear_left_open_status as device_class: window
  • window_rear_right_open_status as device_class: window
  • door_lock_status as device_class: 'lock'

@mitch-dc what do you think about converting these entities to binary_sensors? I was about to fix that the translations does not work correctly and came across the entities that have a binary state but is stated as regular sensors right now. If we convert them to binary sensors Home Assistant will do the translation automatically and I thought it would be a good time to convert them. But when I had a look at it I see that the WeConnect library have more than two states for example the window open/close state. And I think that this is the reason they are imported as regular sensors?

weconnect/elements/access_status.py
OPEN = 'open'
CLOSED = 'closed'
UNSUPPORTED = 'unsupported'
INVALID = 'invalid'
UNKNOWN = 'unknown open state'

Is it better to leave them as regular sensors and translate all five possible states above or do we want to convert them to binary sensors with device classes for open/closed?

@AgentP38 is it grouping ie all windows that is your reason for converting them to binary sensors or what use cases do you see?

@moorgrove

First of all thanks for the explanation....

Yes I like to group all windows and all doors together...

My mobile dashboard attached...

image