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

Xiaomi Aqara window sensors stuck in off state #14775

Closed
trisk opened this issue Jun 2, 2018 · 4 comments
Closed

Xiaomi Aqara window sensors stuck in off state #14775

trisk opened this issue Jun 2, 2018 · 4 comments
Assignees

Comments

@trisk
Copy link
Contributor

trisk commented Jun 2, 2018

Home Assistant release with the issue:
0.70.1

Last working Home Assistant release (if known):
N/A

Operating environment (Hass.io/Docker/Windows/etc.):
Any

Component/platform:
binary_sensor.xiaomi_aqara

Description of problem:
User reported their sensor_magnet.aq2 devices created binary_sensor.xiaomi_aqara entities stuck in off state, despite push events from the Xiaomi gateway for open and close.

The log shows:

2018-06-02 17:55:50 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'sensor_magnet.aq2', 'cmd': 'report', 'sid': '158d000205b435', 'params': [{'window_status': 'close'}]}
2018-06-02 17:55:50 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d000205b435: off>: {'raw_data': [{'window_status': 'close'}], 'window_status': 'close'}
2018-06-02 17:55:52 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'sensor_magnet.aq2', 'cmd': 'report', 'sid': '158d000205b435', 'params': [{'window_status': 'open'}]}
2018-06-02 17:55:52 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d000205b435: off>: {'raw_data': [{'window_status': 'open'}], 'window_status': 'open'}

The problem is that the XiaomiDoorSensor class expects the property to be named status rather than window_status. I'm not sure if this is because of some configuration in the gateway, but the class should handle both.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

xiaomi_aqara:
  gateways:
    - key: ***
@syssi
Copy link
Member

syssi commented Jun 2, 2018

Could you tell me the model name of your Xiaomi Gateway? It's a Aqara AC Partner V3, right?

@syssi syssi self-assigned this Jun 2, 2018
@trisk
Copy link
Contributor Author

trisk commented Jun 2, 2018

I am not the original reporter but according to their logs is is an AC Partner V3 running firmware 1.4.1_149.0149.

@syssi
Copy link
Member

syssi commented Jun 2, 2018

I've proposed a fix (#14777). Could you instruct the original reporter to test this change?

@syssi
Copy link
Member

syssi commented Jun 3, 2018

I'm pretty sure this code change is fine. Just for reference a event of the V1 protocol:

2018-06-03 21:37:16 DEBUG (Thread-24) [xiaomi_gateway] MCAST (report) << {'model': 'sensor_magnet.aq2', 'short_id': 59547, 'sid': '158d0001e489ce', 'cmd': 'report', 'data': '{"status":"close"}'}
2018-06-03 21:37:16 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d0001e489ce: on>: {'status': 'close'}

vs. the V2 protocol:

2018-06-02 17:55:50 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'sensor_magnet.aq2', 'cmd': 'report', 'sid': '158d000205b435', 'params': [{'window_status': 'close'}]}
2018-06-02 17:55:50 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d000205b435: off>: {'raw_data': [{'window_status': 'close'}], 'window_status': 'close'}

@balloob balloob mentioned this issue Jun 22, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants