custom-components / zaptec

zaptec charger custom component for home assistant
MIT License
67 stars 20 forks source link

Cable Lock binary sensor has inverted value #95

Closed NorseJedi closed 7 months ago

NorseJedi commented 9 months ago

It appears that the dedicated binary sensor binary_sensor.(name)_permanent_cable_lock is inverted, and is always the opposite of the corresponding value in binary_sensor.(name)_charger attribute permanent_cable_lock.

In other words, when the attribute on the charger sensor is true the dedicated cable lock sensor is "off", and when the attribute on the charger is false the dedicated cable lock sensor is "on".

The charger attribute matches the setting in the Zaptec mobile app, while the dedicated sensor does not.

sveinse commented 9 months ago

This is due that the entity use the HA predefined setup for lock where the signal needs to be inverted. It use the device class BinarySensorDeviceClass.LOCK where On (true) means open (unlocked), Off (false) means closed (locked). The icons will be wrong if they are inverted.

sveinse commented 7 months ago

Any updates @NorseJedi ? I'd like to close the issue if this answer was sufficient.

NorseJedi commented 7 months ago

My apologies, I didn't think you were expecting an update from me since this is the expected behaviour and not a bug, so yes, you can close the issue. Thank you :)