I have a lock, which is a binary sensor, where the reported status is reversed:
When I lock the door, it is reported it as ‘unlocked’ and visa versa.
How can resolve this? Is there a way to invert the reported value?
I have a lock, which is a binary sensor, where the reported status is reversed:
When I lock the door, it is reported it as ‘unlocked’ and visa versa.
How can resolve this? Is there a way to invert the reported value?
A little more detail might help. E.g., what creates the binary_sensor? Can you share any configuration code that is related to this sensor?
The sensor is created by the Fibaro Gateway component.
customize.yaml:
binary_sensor.gang_gang_deurslot:
friendly_name: Gang Deurslot
device_class: lock
Translations (Dutch):
Gang = Hallway
Deurslot = Door lock
Well, I took a quick look through the Fibaro config options, and its code, but I didn’t see any obvious way to do it. Of course it’s a bit complex, and I’m not familiar with the Fibaro component, so unfortunately I don’t have any answers. Sorry I couldn’t help.
Just tried this it creates a binary sensor that is the inverse of the stated binary sensor, maybe this will work ?
- platform: template
sensors:
gang_gang_deurslot_invert:
value_template: >-
{{ is_state('binary_sensor.gang_gang_deurslot', 'off') }}
You’ll need to change the device class too
or just make it into a binary sensor template instead of sensor template
Adding this code to my binary_sensor.yaml works!
- platform: template sensors: gang_deurslot_invert: value_template: >- {{ is_state('binary_sensor.gang_gang_deurslot', 'off') }} friendly_name: Gang Deurslot device_class: lock
Thank you guys!!
Can’t you just switch the + and - wire? That’s what I did when my curtain said it was open when it was closed and visa versa.
No @Slinkos, that’s not possible.
The lock is allright configured in my Fibaro controller gaterway, by Zwave. It was only inverted in Home Assistant.
Thanks for your suggestion!