t0bst4r / matterbridge-home-assistant

Apache License 2.0
111 stars 14 forks source link

[Bug]: door contact works opposite #145

Closed tammeryousef1006 closed 4 months ago

tammeryousef1006 commented 4 months ago

What happened?

i shared a door contact from xiaomi integration to matterbridge that paired to smartthings , the status works in opposite way , if the door were actually opened then at smartthings its appeared closed , if I close the door then at the app it shows that the door were opened , also battery still not exposed .

Your configuration

offical home assistant addon

Relevant log output

No response

Version

1.5.2-73

tammeryousef1006 commented 4 months ago

Screenshot_20240702_175654_Home Assistant Screenshot_20240702_175626_SmartThings

t0bst4r commented 4 months ago

@bassrock have you already seen that before? Do you know if that’s default behavior in HA? I could easily invert that by default, but I’m a bit afraid of breaking things for others 😅

tammeryousef1006 commented 4 months ago

i never seen that before , is it how to connect off to closed and on to open ?

t0bst4r commented 4 months ago

The binary sensor just reports "on" or "off". The use case (in your case "door") gives it a meaning. Our current implementation says „if it is not off, the contact sensor is true“.

But maybe this is wrong for contact sensors? Could you provide the exact state value of your sensor (go to developer tools in HA, then to "states" and search the sensor by entity id) when the door is open and closed? Maybe also the entity id and attributes (also from the dev tools).

tammeryousef1006 commented 4 months ago

closed off door

when its off it means closed , on is opened , its door contact from xiaomi based on bluetooth

tammeryousef1006 commented 4 months ago

false

tammeryousef1006 commented 4 months ago

now here is when its opened

mb opened opened xiaomi opened

t0bst4r commented 4 months ago

Okay. As of now we have:

Door is open:

Door is closed:

Semantically speaking I’d say it would be correct to have contact: true when the door is closed. So inverting the condition would be correct.

But I’d like to verify that somehow - if that is the specified on/off behavior in HA as well. I’ll spent some time searching the HA docs tomorrow, and then fix it 👍

tammeryousef1006 commented 4 months ago

Screenshot_20240702_233936_Home Screenshot_20240702_233920_SmartThings

At both smartthings and google home appears open while its closed

tammeryousef1006 commented 4 months ago

just me only reported this ? i feel something wrong , can anyone else test his door contacts and give feedback

t0bst4r commented 4 months ago

Someone reported the same in #144

Ultra-bob commented 4 months ago

My issue is slightly different, I have door open in home assistant (on state), but contact true in matterbridge, which would be closed, and is displayed by Google Home as such

I didn't fully read it, this is the same issue

t0bst4r commented 4 months ago

I just found this: https://www.home-assistant.io/integrations/binary_sensor/#device-class

So Austin with door, I’ll add all these one by one.

github-actions[bot] commented 4 months ago

:tada: This issue has been resolved in version 1.5.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: