Xiaomi Cube rotate
Posted: Friday 04 October 2019 19:31
Hello I have some logs from Xiaomi Cube like this:
2019-10-04 19:20:12.562 (Conbee) onMessage called
2019-10-04 19:20:12.562 (Conbee) ### WebSocket Data : {'state': {'buttonevent': 7000, 'gesture': 0, 'lastupdated': '2019-10-04T17:20:12'}, 'r': 'sensors', 'uniqueid': '00:15:8d:00:02:9b:f6:2a-02-0012', 'e': 'changed', 'id': '3', 't': 'event'}
2019-10-04 19:20:12.563 (Conbee) ### Update device (Cube) : {'sValue': '20', 'nValue': 20}
2019-10-04 19:20:12.918 (Conbee) onHeartbeat called
2019-10-04 19:20:12.918 (Conbee) ### Update device (Cube) : {'sValue': 'Off', 'nValue': 0}
2019-10-04 19:20:13.074 (Conbee) onMessage called
2019-10-04 19:20:13.074 (Conbee) ### WebSocket Data : {'state': {'buttonevent': -4782, 'gesture': 8, 'lastupdated': '2019-10-04T17:20:13'}, 'r': 'sensors', 'uniqueid': '00:15:8d:00:02:9b:f6:2a-03-000c', 'e': 'changed', 'id': '4', 't': 'event'}
2019-10-04 19:20:13.074 (Conbee) ### Update device (Conbee - lumi.sensor_cube.aqgl01 4) : {'sValue': '-4782', 'nValue': -4782}
2019-10-04 19:20:22.902 (Conbee) onHeartbeat called
2019-10-04 19:20:22.902 (Conbee) ### Update device (Conbee - lumi.sensor_cube.aqgl01 4) : {'sValue': 'Off', 'nValue': 0}
And variable:
local Cube_angle = 'Cube'
how to assign to variable angle from logs? I know that is nValue, or {'state': {'buttonevent': -4782. but have to aby idea how to her this.
It should be somethink like that :
(Cube_angle).stare.buttonevent ??
2019-10-04 19:20:12.562 (Conbee) onMessage called
2019-10-04 19:20:12.562 (Conbee) ### WebSocket Data : {'state': {'buttonevent': 7000, 'gesture': 0, 'lastupdated': '2019-10-04T17:20:12'}, 'r': 'sensors', 'uniqueid': '00:15:8d:00:02:9b:f6:2a-02-0012', 'e': 'changed', 'id': '3', 't': 'event'}
2019-10-04 19:20:12.563 (Conbee) ### Update device (Cube) : {'sValue': '20', 'nValue': 20}
2019-10-04 19:20:12.918 (Conbee) onHeartbeat called
2019-10-04 19:20:12.918 (Conbee) ### Update device (Cube) : {'sValue': 'Off', 'nValue': 0}
2019-10-04 19:20:13.074 (Conbee) onMessage called
2019-10-04 19:20:13.074 (Conbee) ### WebSocket Data : {'state': {'buttonevent': -4782, 'gesture': 8, 'lastupdated': '2019-10-04T17:20:13'}, 'r': 'sensors', 'uniqueid': '00:15:8d:00:02:9b:f6:2a-03-000c', 'e': 'changed', 'id': '4', 't': 'event'}
2019-10-04 19:20:13.074 (Conbee) ### Update device (Conbee - lumi.sensor_cube.aqgl01 4) : {'sValue': '-4782', 'nValue': -4782}
2019-10-04 19:20:22.902 (Conbee) onHeartbeat called
2019-10-04 19:20:22.902 (Conbee) ### Update device (Conbee - lumi.sensor_cube.aqgl01 4) : {'sValue': 'Off', 'nValue': 0}
And variable:
local Cube_angle = 'Cube'
how to assign to variable angle from logs? I know that is nValue, or {'state': {'buttonevent': -4782. but have to aby idea how to her this.
It should be somethink like that :
(Cube_angle).stare.buttonevent ??