-
Notifications
You must be signed in to change notification settings - Fork 502
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
Aqara Single Switch Module T1 (With Neutral) #4328
Comments
Hello, It s not working natively ? |
Hi @Smanar, thanks for the reply. It is missing the simple metering and electrical measurement, as well as temperature and so on. The only feature that is on deconz is "on/off", that works. Kind regards. |
Device temperature is not exposed via API. I highly doubt the simple metering and electrical measurement clusters are truly available and usable. Like I got to know Xiaomi, any power/consumption values are taken from the analog input (basic) clusters. You can verify that by turning the wtisch on and reading the attribute 0x0055 from both endpoints (double click on the value, then press read and not read config). Additionally, we would need like 15 mins of log data, having info level 2 enabled. During that timeframe, please also make sure that you turn the the switch on and off a couple of times. |
Hello @SwoopX, Attached as load to the Aqara T1 is a 60 Watt "old school" bulb, so that there may come some useful reading out of the data. I think the "at the moment" power measurement is in the "Electrical Measurement Cluster" as id 0x050B "Active Power" and needs to be divided by 10 to get the Watt-reading (maybe the id 0x0605 "AC Power Divisor" that reads "10" has that meaning. The summation power over time that adds up is in the "Simple Metering Cluster", under id 0x000 "Current Summation Delivered", needs to be divided by 1000 (id "0x0302", "Divisor") and reads in kWh. The hardware device has two terminals to add an external (old school) switch as well, that toggles the current "zigbee" state. I suppose this is so that you always can "hardware" switch or have a "smooth" transition from and old school installation to a smart home. I made a 20 seconds video clip (aqara_t1.mp4, see attached to this github-document) for you to see the test environment and the "external switch contacts" in action. Also the log file is attached to this github-document as 20200217_deconz_log_aqara_single_switch_t1_with_neutral.txt-file, I hope this is how you like to have the raw data. aqara_t1.mp4Thanks for all the work of you and your colleagues! |
Thanks for providing the requested info. The results are ... rather unexpected. Now first I'm really surprised to only see the on/off attribute reports, and literally nothing else. However, this might be related to the fact that Aqara and Mija ZB3.0 devices do seem to behave very differently and the Aqara's tending to more adhere to the expected zigbee behavior. Can you please manually bind the simple metering, electrical measurement and lumi specific cluster as described in here https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/How-to...#manually-bind-server-clusters ? Then, please wait some minutes and take another log of 10 mins. The log settings are fine for the moment. |
Hi @SwoopX , Attached you will find the file 20210219_log_aqara_single_switch_t1_with_neutral.txt with INFO_L2 and ERROR_L2 activated as debug levels. About 19:20:xx: Bound all three simple metering, electrical measurement and lumi specific Kind regards. |
As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs. |
Bump to keep it alive. |
Although I somehow doubt that it will make and difference, I peeked at z2m for this device. There it is handled pretty much standard, so I added the code for the power and consumption sensors to be created. The interesting part will be to see if anything will drip in or not. |
I just tried the pull request #4660 above:
is there some progress soon? thanks for clarify, I am willing to help if needed. |
I got no clue what you're trying to say, except for the absent measurement sensors. Can you please share a screenshot of the lumi specific cluster? |
@SwoopX I do not have screenshots, but I have some console results for now: I captured the binding process with the CLI plugin, it looks like this: <-EP 0x0149 0x0149 1 (01) It looks similar than what can be found in the deCONZ pictures of @EarlOfBurton above, the onoff cluster is present as well as the 0x0702 metering cluster and the interesting 0x0B04 power cluster. Then I read sensors and ligths with the rest plugin: One new entry in the lights list, but no new sensors are bound yet!!! Swtich on/off is already possible by button, device switch, with REST and even with Phoscon. At every switch, the new state is sent to the gate and can be shown with the REST or CLI: <-LQI 0x0000 01 0 1 0x54EF44100009DACE 0x0149 1 1 2 00 01 FF Then I sent the "read attribute" command to the interesting power cluster 0x0B04 (the gate is still open): $ echo "r 0x0149 1 0x0B04 0x050B" | nc localhost 5008 From now, the device sends its power (0x0B04) and total energie (0x0702) from itself perjodically (ca 2sec) as well as the switch state when changed. You can see the power is changing from 0028 (=40dez = 4.0W) to 0000 (0W) when switching off and back to 28 when switching on. Now lets see the sensors table in the REST API: "11" : { Again, the actual power is 4.0W, the factor can be found in another attribute to 1/10. Another REST sensor show the total energy in kWh, but it is reseted at every restart of the device... My conclusion:
|
Ah, shxx. That one is on me. Forgot that the Xiaomi's are excluded from the automatic bindings.
Interesting. My smart plug keeps the values even after a device reset. However, I assume the divisor for the consumption is correct, so that doesn't require any changes and the values are in Wh already.
Correct. Phoscon doesn't show any power/consumption in general. |
I have installed the aqara switch module T1 today but no report of power in deconz. What is the status of power report in deconz? I am running HA via raspberry pi. |
Am Montag, 27. Dezember 2021, 19:31:49 CET schrieb cobch:
I have installed the aqara switch module T1 today but no report of power in
deconz. What is the status of power report in deconz? I am running HA via
raspberry pi.
I can just say that it works for me but I use my own home system.
I read/write to the deconz direct over the REST API by curl commands.
But in Phoscon the Power Sensor is not shown, just the (Light)Switch.
Maybe the feature is only available in low level access?
|
@andudi I first did not make the correct wiring and that was why the power did not report correctly... I manage to installed the switch and even the power off memory so it is automatically on after a power outage. Thanks for your help (-: |
I would also like to know how to get power and energy via the rest interface, Actually I'm using the deconz / phoscon applications to bring Xiaomi (and other zigbee) devices into my home automation. In my current setup I'm interacting with the Phoscon frontend to add the devices and to manage them. Now I try to summarize what I read in this thread:
Ah, shxx. That one is on me. Forgot that the Xiaomi's are excluded from the automatic bindings. Does this mean the process by simply adding the sensor via Phoscon is not sufficient to get the power / energy data in the REST API? Do I need to open up the deconz app and expose the specific measurements there? I'm currently running the deconz app headless (platform minimal) and there was no need till now to use the deconz itself. So i do have no experience and cannot quickly validate my assumptions. Thanks. |
hei Matthias
I used the following CURL syntax on my raspi:
# first I define some shortcuts:
$ path=localhost:80/api/<application ID>
$ format="json_pp -json_opt pretty,canonical"
# now I can get the config:
curl $path/config | $format
# and the list of lights:
$ curl $path/lights | $format
{
"1" : {
...
},
"2" : {
"etag" : "dd48815737a735c8c840123f30e326b4",
"hascolor" : false,
"lastannounced" : "2022-01-06T21:13:34Z",
"lastseen" : "2022-01-24T19:28Z",
"manufacturername" : "LUMI",
"modelid" : "lumi.switch.n0agl1",
"name" : "On/Off light 2",
"state" : {
"alert" : "none",
"on" : false,
"reachable" : true
},
"swversion" : "Aug 8 2020",
"type" : "On/Off light",
"uniqueid" : "54:eg:77:10:00:09:da:ce-01"
},
}
# I can now switch on/off the switch like
$ curl -X PUT $path/lights/2/state -d '{"on":true}' | $format
# and I can read out the sensor states with energy consumption and actual power
curl $path/sensors | $format
{
"12" : {
"config" : {
"on" : true,
"reachable" : true,
"temperature" : 0
},
"ep" : 1,
"etag" : "1774c82ed1c27f12392d945029c88d26",
"lastannounced" : "2022-01-06T21:13:34Z",
"lastseen" : "2022-01-24T19:30Z",
"manufacturername" : "LUMI",
"modelid" : "lumi.switch.n0agl1",
"name" : "Consumption 12",
"state" : {
"consumption" : 548,
"lastupdated" : "2022-01-24T19:30:38.874"
},
"swversion" : "Aug 8 2020",
"type" : "ZHAConsumption",
"uniqueid" : "54:eg:77:10:00:09:da:ce-01-0702"
},
"13" : {
"config" : {
"on" : true,
"reachable" : true,
"temperature" : 0
},
"ep" : 1,
"etag" : "8707559f80087435bba8123a4bca4a46",
"lastannounced" : "2022-01-06T21:13:34Z",
"lastseen" : "2022-01-24T19:30Z",
"manufacturername" : "LUMI",
"modelid" : "lumi.switch.n0agl1",
"name" : "Power 13",
"state" : {
"lastupdated" : "2022-01-24T19:30:38.912",
"power" : 0
},
"swversion" : "Aug 8 2020",
"type" : "ZHAPower",
"uniqueid" : "54:eg:77:10:00:09:da:ce-01-0b04"
},
}
since the consumption is resetting while rebooting the device, I think it is not really
interesting feature, but to know the actual power can be nice
Andreas
Am Freitag, 21. Januar 2022, 14:06:36 CET schrieb Matthias:
… I would also like to know how to get power and energy via the rest
interface, Unfortunately I'm not so much in the details to fully understand
everything discussed within this thread.
Actually I'm using the deconz / phoscon applications to bring Xiaomi (and
other zigbee) devices into my home automation. I'm using the rest interface
to gather all the needed data. And it works quite well for all the deviced
I used so far (mainly temperature sensors and some lights)
In my current setup I'm interacting with the Phoscon frontend to add the
devices and to manage them. I can do the same with the Aqara SSM-U01 and it
is added as a On/Off switch in the lights section. This seems to be correct
according to what i read so far,
Now I try to summarize what I read in this thread:
1. The power / energy monitoring will never show up in phoscon as it is not
intended to be shown there. The phoscon app is an abstraction layer above
deconz focusing on light control. So the sensor data of power and energy is
not there.
|
Hey Andreas, thanks for sharing the feedback and the actual code.
I'm not sure if step 3 is really necessary, but I do have only 3 devices and it took me some hours to figure out the actual process. For the first two devices I got the data rather by accident and on the third device I finally found above process. It would be nice if someone else with the same problem could confirm the process and also check if step 3 is really necessary... BR |
cool if you found a solution.
I recently buyed a second device, and it just worked after binding with the
Phoscon web frontend without problems, the sensors are just shown in the REST
API like the first one...
|
It's more complicated on HA ^^ yes, but I have the command line to use in a link to the forum to add a DDF for HA. I don't want to start from scratch for this one, if you can at least share screen capture on the auto generated DDF, it will help me. Or easier we can complete your DDF.
Yes, it's normal, but deconz will auto generate an incomplete one, but used as squeleton. For information we will mimic this one https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/devices/xiaomi/xiaomi_zncz04lm_smart_plug_v24.json |
I can complete it but I will upload hoe it looks now
|
How you have do that ? the copy/paste don't work on HA ... So I presume you have the same device than here #4328 (comment) ? So I m using same cluster (0x000C) and endpoint (0x15 and 0x1F)
To install it you can use the hidden folder in the "data" docker folder (it's a persistent one) Long story here https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839 I have added a check To don't broke your previous device, but if your device don't have endpoint 0x15 and 0x1F the DDF will be not used. |
Thanks. Now I need to wait I guess? |
After I restarted deCONZ today it seems that it uses the old JSON and the one I selected yesterday |
The auto generated one ? Else you can just make "hot relaod" it will be active immediatly (up you restart deconz) else you will have an error message if you can't load it. |
Will try to hot reload with the new JSON I uploaded and see what happens. |
this is how I do Next time I press Edit DDF on the same device, as I just did above on, it will be back to the auto generated Could this be user rights for the new JSON or any other user rights for other files? |
I think you will an error message.
Yeah, good catch, I don't found the file neither, without it the swversion will be bugged, but it don't prevent the device working. |
I have two old of the same device that works with the auto generated DDF.
|
Is there a file where I can see what DDF a device is assigned to? |
Yes I think it's probably the issue. I think the DDF don't matche the devices, can you take a look if there is not a typo here.
You need to have "LUMI", "lumi.switch.n0agl1" and the endpoint 0x15 and 0x1F |
This I got when I pressed Edit DDF
then I pressed Save and then when I pressed Hot reload I got this:
|
No typo except "$MF_" but I think that is an variable right?
|
I removed this line |
@Smanar I now saw that I got new devices in Home Assistant, power and consumption, so it works, YEAH Thank you so much Can I send you a coffee or paypal? |
Thx for the offer ^^, I have a link in my plugin for domoticz repo on my github profile, but it's not finished for me.
And your device have it (it s the big number, you have 01 15 1F 29 and F2), I don't see why the check is not working, I will ask in dev channel to be sure. This check is here to keep a compatibility whith old and new device, you have both model on your side ? and both are working with the new DDF ? BTW what is your deconz version ? Look like your version don't support it. |
I have totally 5 Aqara T1. All of them are working fine now with new JSON. I can delete all off them if that help you to develop/solve it. |
I noticed that I got 2 power and 2 consumption for the old ones but that is because I removed the line in JSON, that you will check with dev how to solve |
I think it's because you have the one created by legacy code, and the one with the DDF. I m still waiting help to see If I m doing something wrong with endpoints.includes(), but it's used for others devices with the same synthax |
@flopp999
For me, the error mentioned above shows an array of integers, and |
this is what I got in Debug View: |
Honnestly I haven't thoses devices and too much to read in the issue, but I don't want to break first version that use the classic cluster 0x0b04 and 0x0702 (if they exist) it's for that I wana use this check. And BTW if its not working mean there is the issue too on 2 others DDF that use the same check.
Yes, I think, its like this code
But @SwoopX if you know better than me thoses device, you can confirm me, we don't need the matchexpr check ? |
The point here is that you only need For the sake of completeness, that would be the correct stanza to use (as it is independent of any order within the array): However, you guys seemed to have accidentally solved the issue ghosting around the 2 Xiaomi smart plugs 🙂 |
It seem ^^, I will make the PR for this switch I let you correct the 2 other PRs. |
Device
Product page: https://www.aqara.com/en/single_switch_T1_with-neutral.html
Screenshots
Node
Basic
Phoscon
Device temperature configuration
02_device_temperature_configuration
Identify
Groups 1/2
Groups 2/2
Scenes 1/4
Scenes 2/4
Scenes 3/4
Scenes 4/4
On/Off 1/2
On/Off 2/2
Alarms
Time
Simple Metering 1/2
Simple Metering 2/2
Electrical Measurement
Lumi specific
OTAU
15 Home Automation On/Off
1F Home Automation On/Off
29 Home Automation On/Off
F2 Green Power
Home Automation On/Off
The text was updated successfully, but these errors were encountered: