-
Notifications
You must be signed in to change notification settings - Fork 482
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 smart plug #153
Comments
Yes we can add it to the API as |
That would be great! Technically it's not a light. It's a plug, there could be anything connected to those plugs. Under 0053 -> 0055 is another field. I'm not sure, but I'm pretty sure this is the (total) consumed energy. So if this can be added as well. |
Voltage is one thing; I would really be interested in the power consumption. I think it should be a
I assume that's attribute 0x0055 of the Analog Input cluster (0x000c)? Which endpoint, 02, 03, or both? Any idea what the Binary Input cluster (0x000f) on endpoint 4 is used for? On the ubisys D1, power consumption is reported on endpoint 04, cluster 0x0b04 (Electrical Management), attribute 0x050b (Active Power) in W (int16). It's value ranges from 0 when the connected lights are off to 251 when they're at
The OSRAM plug provides the same cluster and attribute, but on the 03 ZLL endpoint that also holds the On/Off, Groups, and Scenes clusters. However, it's broken: it reports 28000 when the plug is off and 400 when it's on, regardless whether something it actually consuming power (or even plugged into the plug). I'm not sure if this is a physical or firmware-related problem. I have another OSRAM plug that is physically broken (after pairing, it keeps on clicking/swiching on and off). The plug is at V1.03.21. The lightify app reports the latest firmware for the plug is 01020315 - could be the same version (0x15 = 21). One of my OSRAM E14 bulbs (the one with the older firmware V1.03.20) also has this cluster and attribute. It reports value 400 when the light is off; and value 5800 when it's on at
Since consumption is on a different endpoint, it should be a separate (ZHAPower?) sensor for the Xiaomi and the ubisys. I makes sense to do the same for the OSRAM (if we ever get a plug (firmware?) where this works), with |
Endpoint 02 cluster 0x000C attribute 0x0055 shows the current power consumption in watts. |
The Rest API seems to be reporting the wrong attribute anyway. Endpoint 03 cluster 0x000C attribute 0x0055 This attribute appears to be counting the consumed energy in kWh (it's reading 0.10 atm.) |
Odd. You might want to double-check by reading the attributes of the 0x0006 (On/Off) cluster from the Cluster Info panel in the deCONZ GUI. This should refresh the value shown there and the RESP API attribute. Is the plug actually turned on or off?
Cool. I'm very much tempted to order one... Does it come with EU plugs, or do you need to use an adapter? The pictures on the Chinese web shops only show the front side :-( |
The plug is turned on. You would need an adapter for this plug because it has an AU plug. |
Very odd. Does
That's a pity.
Yes. From ZigBee perspective it smells like a light, so it's exposed as a light resource (same on the Hue bridge; the OSRAM Lightify app also shows plugs and lights on the same screen). You can check |
Added the corresponding data to my excel sheet. |
Is there any progress on this? I have also have a wall plug that reports power, but it is not available in the REST api (I can control it tough). |
@manup Is it a lot of work to add the switch actions to the rest api? |
From the above REST output I see the smart plug is shown as light. Beside the attribute is reported as wrong state (Xiaomi might use reporting instead of ZCL read for onoff cluster like for their other devices). Does REST PUT request not already work? PUT /lights/1/state
{ "on": true } If you can provide a sniffer log it would be helpful to see if something is send to the device and also if the plug is sending ZCL attribute reports. |
Hmm.. I did a new query. Switching it from the deconz app doesn't generate websockets events. |
Is it visible in deCONZ? Just looked in the code and the smart plug type (0x0051) should be supported. You may also try to power-cycle the plug to force it to send a device announce command. |
I gave it a power cycle, still nothing in the rest-api and neither in deCONZ. |
Sounds like a plan :) |
Hehe. Ah I see, the reason it isn't showing up in the REST API is that other than the one from the above screenshot this doesn't have the 0x0051 device id but 0xffff which isn't recognized by deCONZ. Does the Basic cluster show anything useful? If not we may create the light resource by identify the device via endpoint 02 (Mains Power Outlet) and use OnOff cluster from endpoint 01 to control it. It's a bit of hack but everything with Xiaomi is it seems :) |
Oh that's not too bad the model id is quite handy here. |
It's good to know that the plug reports the model id on it's own too, that way the resource can be created very quickly after a power-cycle, I'll cook something together for the next version. |
I know I know, it's on the radar :) |
Relaxt :-) No need to hurry. Very happy with the progress so far. Thanks for your support! |
Hi, Apologies if this is the wrong place to post, a new Raspbee user here. Is there a list of known plugs that work with deconz and end up exposed via the REST Api please? I'm considering the Samsung smarthings plug as I'm in the UK. Thanks |
any updates on this issue? cant see anything in the change logs for the last couple of versions. thanks |
Still no support? Running 2.05.15 and it is not showing any consumption for Xiaomi Plugs nor other (non-xiaomi) plugs I have here. |
Did you re-pair the plugs? What other plugs do you have? |
@ebaauw Yes I did repair them. Deconz shows the power clusters, but the rest API does not have the info. The other plugs are not commercially available, and I'm not sure if I should mention them at the moment. |
Sensors need to be whitelisted, without any info on them, the REST API won’t create ZHAConsumption or ZHAPower sensor resources. The Xiaomi smart plug should be supported since v2.05.08. Make sure to open the network from the web app or from Phoscon and refresh the basic cluster in the GUI. If still no resource is created, best double-check the plug’s details, see #432 (comment). |
@ebaauw My bad! They do show up for the Xiaomi plug! I was checking the "/lights" instead of "/sensors", since I was expecting them to show as "/lights/plugid" attributes! 😄 Any idea why they also have a presence cluster? Regarding the other plugs, what info is needed? |
Not really. Do you mean ZigBee Occupancy Sensing cluster or ZHAPresence resource in the REST API? Could you list the resource? Does it have the same mac address in the
Device Type, Model ID, Manufacturer Code, Manufacturer Name, mac address prefix, overview of clusters (especially how they report consumption) and unit they report consumption etc in. Easiest to post some screenshots from the deCONZ GUI. |
The device already shows up as a light. Couldn't deconz simply add a sensor for every device that have the Simple Metering cluster, without needing it to be whitelisted? |
No, see above. Please provide screenshots of the Node Info panel and the Cluster Info panel for the Basic cluster. For the Simple Metering, attribute 0x0000 should report the total consumption devilvered (since the last reset). Would that be 102.292 kWh or 1022.92 kWh? Same question for 0x0400, that should report the current power drawn. Would that be 62W or 6.2W? Out of interest: what plug is that? Where did you buy them? Do they come in an EU version?
The ZigBee standard leaves a lot of room for interpretation, and quite some vendors take a very liberal interpretation, so typically some custom code is needed per device type or brand. The alternative would be to support only your own brand and standard devices, as e.g. the Hue bridge. |
@ebaauw sorry for the delay. The plug is sold by the energy provider here. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
My xiaomi smart plug
Shows up as a Light. I'm able to turn it on / off / toggle.
The power consumption and mails voltage are not listed in the rest api.
The mains voltage is visible in the attributes field, so is the power consumption ( 0x0055 shows the actual usage in watts)
It would be great if this data would be accessible from the rest-api.
If I need to provide more information, please let me know.
The text was updated successfully, but these errors were encountered: