Aqara wall switch "zero line" power report

Hello community!

I own some aqara wall switches “zero line” (with neutral). They work really good but they do not report the power consumption in HA as opposed to the mi home app. Is there any possible solution?

Some info about these switches:

@syssi :four_leaf_clover:

As first step please enable the debug mode of the xiaomi aqara component:

logger:
  default: warn
  logs:
    xiaomi_gateway: debug
    homeassistant.components.xiaomi_aqara: debug

Restart Home Assistant and check your homeassistant.log. You can see the traffic (messages) between Home Assistant and your Xiaomi Gateway now. It looks like this:

2017-08-05 10:21:33 DEBUG (Thread-12) [homeassistant.components.xiaomi] PUSH >> <Entity Motion Sensor_158d000113e31f: off>: {'status': 'motion'}
2017-08-05 10:21:58 DEBUG (Thread-3) [homeassistant.components.binary_sensor.xiaomi] Updating xiaomi sensor 158d000113e31f by polling. Current state is "on".
2017-08-05 10:21:58 DEBUG (Thread-3) [homeassistant.components.xiaomi] PUSH >> <Entity Motion Sensor_158d000113e31f: on>: {'status': 'motion', 'voltage': 3075}
2017-08-05 10:22:29 DEBUG (Thread-6) [homeassistant.components.binary_sensor.xiaomi] Updating xiaomi sensor 158d000113e31f by polling. Current state is "on".
2017-08-05 10:22:29 DEBUG (Thread-6) [homeassistant.components.xiaomi] PUSH >> <Entity Motion Sensor_158d000113e31f: on>: {'status': 'motion', 'voltage': 3075}
2017-08-05 10:23:00 DEBUG (Thread-12) [homeassistant.components.binary_sensor.xiaomi] Updating xiaomi sensor 158d000113e31f by polling. Current state is "on".
2017-08-05 10:23:00 DEBUG (Thread-12) [homeassistant.components.xiaomi] PUSH >> <Entity Motion Sensor_158d000113e31f: on>: {'status': 'no_motion', 'voltage': 3075}

Try to identify your the SID (sub device id = 158d000113e31f, example above) of your wall switch and provide some messages of this SID here. In the best case these messages contain some new fields (power_load f.e.) which can be evalutated and integrated into the Home Assistant component later on.

2018-04-10 16:37:32 DEBUG (Thread-2) [xiaomi_gateway] _send_cmd >> b'{"cmd":"read","sid":"158d00022bXXXX"}'
2018-04-10 16:37:32 DEBUG (Thread-2) [xiaomi_gateway] _send_cmd resp << {'model': 'ctrl_ln2.aq1', 'short_id': 30336, 'sid': '158d00022bXXXX', 'cmd': 'read_ack', 'data': '{"voltage":3600}'}
2018-04-10 16:37:32 DEBUG (Thread-2) [xiaomi_gateway] Registering device 158d00022bXXXX, ctrl_ln2.aq1 as: switch

2018-04-10 16:38:07 DEBUG (Thread-23) [xiaomi_gateway] MCAST (heartbeat) << {'model': 'ctrl_ln2.aq1', 'short_id': 30336, 'sid': '158d00022bXXXX', 'cmd': 'heartbeat', 'data': '{"voltage":3600}'}
2018-04-10 16:38:07 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch LN Left_158d00022bXXXX: off>: {'voltage': 3600}
2018-04-10 16:38:07 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch LN Right_158d00022bXXXX: off>: {'voltage': 3600}

2018-04-10 16:39:42 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'ctrl_ln2.aq1', 'short_id': 30336, 'sid': '158d00022bXXXX', 'cmd': 'report', 'data': '{"channel_0":"on"}'}
2018-04-10 16:39:42 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch LN Left_158d00022bXXXX: off>: {'channel_0': 'on'}
2018-04-10 16:39:42 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch LN Right_158d00022bXXXX: off>: {'channel_0': 'on'}

Bad news: The gateway doesn’t expose the power consumption with the current firmware.

Hi, Does it also not expose current switch state? it is always ‘off’ after HASS restart.

You could check it on your own if you own the device with the steps above.

It looks like the heartbeat (= periodical (5min) published state of the device) doesn’t contain the state unfortunately. If you control the device the new state is published once. In case of an HA restart this doesn’t help. We need an improved gateway firmware here.

I did check, sorry, forgot to post link to my original post with details: Aqara/Xiaomi double wall switch (with neutral) state lost after HA restart

Just needed confirmation :slight_smile:

Thank you!!!

I think they are successful at getting the power consumption. Is it possible to have this in homeassistant too?

1 Like