-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support get_properties by piid and max_properties count for miot devices #6
Comments
Could somebody here @lovelylain @w27 provide some testing? I don't own any miot device for tests. |
Currently I have a smart plug https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:outlet:0000A002:chuangmi-212a01:1 Now if the configuration like this:
then the sensor will be if the configuration like this:
then the sensor is avaliable with wifi RSSI as its value,and
as its attributes, but nothing more. And as for switch,
doesn't work at all. The switch is always For the result of miiocli please refer to #7 . |
I didn't change anything right now. I justed asked for support. ;-) I will provide a feature branch implementing the MiotDevice support soon. There will be a configuration option which needs to be enabled to use the MiotDevice class instead the (Miio)Device class. |
@syssi Thanks a lot. I would be glad to provide testing. |
Hi All, Could somebody give me a hint or paste some example code on how to activate a miot module? I have the miio.curtain_youpin module and I am trying it to connect to home assistant. What do I have to change in the code to be able to activate the miot module? Help would be greatly appreciated! |
Glad to test miot devices here. I have 114 xiaomi devices including some miot devices such as : #!/usr/bin/python3
from miio import miot_device as miot
ip = '192.168.1.12'
token='XXX'
mos_mapping = {
"status": {
"siid": 6,
"piid": 1
},
"workmode": {
"siid": 6,
"piid": 2
},
"schedules": {
"siid": 6,
"piid": 3
},
"modeparam": {
"siid": 6,
"piid": 4
},
"liquid": {
"siid": 5,
"piid": 1
},
"event_button_pressed_on": {
"siid": 6,
"eiid": 1
},
"event_button_pressed_off": {
"siid": 6,
"eiid": 2
},
"event_schedule_on": {
"siid": 6,
"eiid": 3
},
"event_schedule_off": {
"siid": 6,
"eiid": 4
},
"action_time_clear": {
"siid": 5,
"aiid": 1
}
};
d = miot.MiotDevice(ip=ip,token=token,mapping=mos_mapping)
#d.get_properties_for_mapping()
d.set_property("status",1)#turn on
#d.set_property("status",0)#turn off |
hi, I am wondering when will you implement the MiotDevice support? Great job done! : D |
It looks like this what I am looking for. Please please add support for siid / piid. |
I've merged @lovelylain pull request. Great work! Thanks for your support and contribution to this custom component. The sensor entity supports the retrieval of miot properties now. Please give it a try. I've added loveylain's example to the README.md. |
Some new devices only support get_properties by piid, and properties count not greater than 10.
The text was updated successfully, but these errors were encountered: