python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

Unable to get motion, door and switch sensor record

Open SheltonXiao opened this issue 1 year ago • 0 comments

Describe the bug When I use miio to connect to the gateway, I am able to get readings from the weather sensors connected to the gateway. But I am not able to get the readings of the motion sensor, the door sensor, and the switch sensor. I found that according to the webpage, the sensors I used were not fully supported yet. Please add readout support for motion sensors, door sensors, and switch sensors.

Version information (please complete the following information):

  • OS: Windows 10
  • python-miio: 0.5.12

Device information:

  • Model: lumi.acpartner.v3 KTBL11LM (gateway), lumi.sensor_motion.aq2 RTCGQ11LM (motion sensor), lumi.sensor_switch.aq3 WXKG12LM (switch sensor), lumi.sensor_magnet.aq2 MCCGQ11LM (door sensor)
  • Hardware version: Unknown
  • Firmware version: 1.4.1_164.0149

To Reproduce Steps to reproduce the behavior:

  1. connect the Aqara motion sensor, door sensor, and switch sensor to an Aqara gateway.
  2. use miio to connect the gateway and read the subdevice status.
from miio.gateway import Gateway
gateway = Gateway(ip, token)
subdevice = gateway.discover_devices()
d1 = subdevice[DID] # the DID of the sensor
d1.update()
print(d1.status)

Expected behavior Get the records of the sensors. For example, when I press the switch sensor (Button), I should get

{'last_press': 'click_ch0'}

Console output An example of the current output of a switch sensor.

{'last_press': 'none'}

Neither can I get the voltage of the sensor.

SheltonXiao avatar Jul 28 '23 09:07 SheltonXiao