Xiaomi mi wifi plug & air purifier

:slight_smile: iā€™m here to help :slight_smile:

I just released a new version of the xiaomiplug custom component. Please give it a try. It supports multiple devices types now (Xiaomi Plug, Xiaomi Power Strip and the ChuangMi Plug V1):

perfectā€¦ now it works againā€¦ the only remaining problem is the measurement different from the appā€¦ also with ampere to watt conversionā€¦

Yep. This issue is still not solved. I need more data / measurements to calculate a best fit straight line.

iā€™ll try this afternoon to give you datasā€¦

ok this are some readingsā€¦

APP (W) - HA(A)

5.5 - 0.1
56 - 0.31
84 - 0.45
305 - 1.42
512 - 2.28
620 - 2.75
921 - 4.17
1700 - 7.68

2 Likes

Thanks! I created a google sheet to collect some more values to get a clue:

Could you provide your mains voltage again? I donā€™t remember anymore.

Everybody can edit/extend the sheet. Please feel free to improve the collection!

1 Like

220 - 230 volts

Could you check something? There must be a voltage reference somewhere. Please provide the output of:

mirobo --ip your-power-strip-ip --token your-token raw_command get_prop '["voltage", "volts", "volt", "v"]'

I ordered a power strip for some experiments. The shipment will take a while (4 weeks).

This is my output:

ERROR:mirobo.vacuum_cli:Unable to read the stored msgid: [Errno 2] No such file or directory: '/tmp/python-mirobo.seq'
Sending cmd get_prop with params ['voltage', 'volts', 'volt', 'v']
[None, None, None, None]

FYI: mirobo command line says my powerstrip is unsupported when I try to issue a discover to find out the token:

WARNING:mirobo.discovery:Found unsupported device zimi-powerstrip-v2_miio48702550._miio._udp.local. at 192.168.1.62, please report to developers

Thanks for the information. Itā€™s fixed now: Discovery: Device name of the zimi powerstrip v2 fixed by syssi Ā· Pull Request #84 Ā· rytilahti/python-miio Ā· GitHub

Itā€™s too bad. Still no data for proper calculationā€¦ I will capture the traffic between power strip and the mi home app if the device arrives. My hope are new and well formed properties.

1 Like
 mirobo --ip 192.168.1.136 --token *********************** raw_command get_prop '["voltage", "volts", "volt", "v"]'

Sending cmd get_prop with params ['voltage', 'volts', 'volt', 'v']
[None, None, None, None]

tell me if i can do anythingā€¦

Hi @syssi.

Iā€™ve been seeing this error appearing in the logs a lot recently. I have 5 devices, all connected to a Ubiquiti AP, so connectivity shouldnā€™t be an issue. No other devices on my network have this same issue. It appears to happen to all
Xiamoi WiFi switches randomly throughout the day.

Any ideas?

2017-10-01 10:57:54 ERROR (Thread-9) [mirobo.device] Unable to discover a device at address 192.168.1.131
2017-10-01 10:57:54 ERROR (MainThread) [custom_components.switch.xiaomi_plug] Got exception while fetching the state: Unable to discover the device 192.168.1.131

The firmware of the xiaomi plugs isnā€™t very stable. Multiple connections arenā€™t possible and the discover doesnā€™t respond to the discovery message always. The connection will be recovered nevertheless on the second attempt. You can ignore the messages as long the control of the device is possible.

1 Like

iā€™ve tryed sniffing with wireshark the communication with the strip ip addressā€¦ but only mdns message receivedā€¦ can i do anything else?

Where did you capture the traffic? Ethernet traffic is switched/routed. mDNS are broadcast messages an can be seen from every device of the network.

Youā€™re rightā€¦ There is a way to capture all the datas?

I would use tcpdump at the home assistant host.

today arrived my zigbee plugā€¦ i need to use custom_component ?