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: Add new cube model (sensor_cube.aqgl01) #14393

Merged

Conversation

Projects
None yet
10 participants
@syssi
Copy link
Member

commented May 11, 2018

No description provided.

@Danielhiversen

This comment has been minimized.

Copy link
Member

commented May 11, 2018

🎉

@Danielhiversen Danielhiversen merged commit d6b81fb into home-assistant:dev May 11, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.975%
Details
@MQ6

This comment has been minimized.

Copy link

commented May 26, 2018

I think some more changes are required to get the new cube (sensor_cube.aqgl01) working. This change has made the cube discoverable by Homeassistant, but no 'events' are seen by Homeassistant (i.e. there is no data in 'last action', and I am unable to trigger automations with the cube).

There is some discussion about this issue over here: (https://community.home-assistant.io/t/aqara-cube/54010/2)

I have set the logging for the xiaomi_aqara component to 'debug' and the only cube related entries I have seen (over a period of a few days) are battery related (despite intermittently trying to trigger all of its functions; flip90 rotate etc.) - here is excerpt from my log file:

2018-05-26 02:57:44 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Cube_158d00024a4b84: off>: {'voltage': 2985}

2018-05-26 15:48:03 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Cube_158d00024a4b84: off>: {'voltage': 2975}

Note the 'voltage' value is changing with time, so I believe it is reporting correctly from the device.

@MQ6

This comment has been minimized.

Copy link

commented May 26, 2018

An update: I have done a packet capture of the network traffic from the Xiaomi gateway; I can see all of the expected traffic for the motion sensors, door sensors, buttons etc. (plus the occasional 'gateway heartbeat') Example:

Example of a 'Heartbeat' from the Gateway:
{"cmd":"heartbeat","model":"gateway","sid":"redacted","short_id":"0","token":"redacted","data":"{\"ip\":\"10.0.1.80\"}"}

Example of when a Motion Sensor detects motion:
{"cmd":"report","model":"sensor_motion.aq2","sid":"158d0001e54190","short_id":22614,"data":"{\"status\":\"motion\"}"}

But I do not get any traffic at all when cube events are triggered (although I do see the event in the device's log in the Mi Home App on my Phone).

I suspect that this is an issue in the Gateway firmware (I am running 1.4.1_155.0143 which is apparently the latest version), as cube events are not getting 'broadcast' as part of the 'LUMI Hub Lan Communication Protocol' and are only working 'locally' on the Hub itself. Worth noting that I have two gateways, and have had the same result with both (and both are running the same firmware revision).

@1981nick1982

This comment has been minimized.

Copy link

commented May 27, 2018

Think indeed that it is the gateway that does not forward the information. I'm now looking at the zigbee2MQTT solution so that the xiaomi gateway is no longer needed.

@balloob balloob referenced this pull request May 28, 2018

Merged

0.70.0 #14657

@jedmeng

This comment has been minimized.

Copy link
Contributor

commented May 28, 2018

new cube(sensor_cube.aqgl01) use a new Gateway LAN communication protocol V2.0 which is incompatible with the protocol V1.0. Currently only Air Conditioning Controller implement the protocol V2.0 among all the gateway devices.
I captured the event packets when I bought an Air Conditioning Controller and connect the new cube to it.
What's more, since the format of the data packets is changed, binary_sensor.xiaomi_aqara also need to be updated.

@1981nick1982

This comment has been minimized.

Copy link

commented May 28, 2018

Will the cube work with alternatives on the gateway such as zigbee2mqtt, zigate and ZHA?

@syssi

This comment has been minimized.

Copy link
Member Author

commented May 28, 2018

@jedmeng Could you provide some event examples?

@jedmeng

This comment has been minimized.

Copy link
Contributor

commented May 29, 2018

@syssi Don't know why they just delete the English version of the protocol, but the Chinese version is still there link.

rotate action:

{
    "cmd":"report",
    "model":"sensor_cube.aqgl01",
    "sid":"158d0000123456",
    "params":[{"cube_status":"rotate"},{"rotate_degree":-90},{"detect_time ":500}]
}

other actions (flip90/flip180/move/tap_twice/shake_air/swing/alert/free_fall):

{
    "cmd":"report",
    "model":"sensor_cube.aqgl01",
    "sid":"158d0000123456",
    "params":[{"cube_status":"flip90"}]
}
@1981nick1982

This comment has been minimized.

@LordSpectre

This comment has been minimized.

Copy link

commented Jun 2, 2018

Hello, what's the changes state? I can see the magic cube in HA, but still no action at all (using latest xiaomi_aqara.py files)

@sirs2k

This comment has been minimized.

Copy link

commented Jun 6, 2018

I just got my cube model MFKZQ01LM which is supposed to be supported.
the cube is getting detected by HA, I can see the cube's battery percentage but no actions from the cube are getting sent to HA

Edit:
So I just went to "hub info" in the app and it said something about "lumi.sensor_cube.aqgl01

@jedmeng are these the parameters you'd put into the automation and just change the "sid" to "lumi" number found in the app?
@Danielhiversen @syssi Any update on a fix guys?

@ewanrw

This comment has been minimized.

Copy link

commented Jun 14, 2018

I can do debugging or testing if that's helpful. Hassbian v71 dev 0 with the Aqara cube and lumi v3

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Jun 14, 2018

Please keep the discussion in the forum or chat. This PR is merged, and we don't want ongoing discussion in merged PRs.

If you suspect a bug, you're welcome to open an issue in the issue tracker and link to this PR.

@home-assistant home-assistant locked and limited conversation to collaborators Jun 14, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.