Closed Brunsben closed 2 years ago
You can test the two files: https://github.com/JanSucco/various/tree/main/Deconz Set status in deconz-gui to bronze.
Those plugs looks promising, I wiil try them when they are official supported!
For that, need someone test the @JanSucco file, confirm they are working (if he haven't the device himself or if he want a confirmation) for someone make a PR.
I'll try today and report if it works.
Ok, I would test it if I knew how. Is there a guide somewhere on how to use these files?
I'm using a conbee II in a Raspberrry Pi with HassOS
Ok so bad new, I m asking the same thing https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-ha-using-text-editor/1839
If you know a little docker https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5459#issuecomment-1018984004 But the last user I have give the link haven't succed.
On a nomal OS it's simple
All DDF provided directly with deCONZ typically reside in /usr/share/deCONZ/devices/generic/ on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g. /home/deconzuser/.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.
You just need to put the file on the "devices" folder.
I have SSH-Access, but all the Folders seems to be empty, maybe the root is not really a root user or the folder is only for own addons. I didn't use docker right now.
Same than the other user, he have tried a file search, nothing.
nothing here too ? /mnt/data/supervisor/addons/data/core_deconz/.local/share/dresden-elektronik/deCONZ/devices/
No, empty mnt folder:
and inside the folder data or addons ?
I have found that too
Created new NAS-WR01B_2.json file inside directory /usr/share/hassio/addons/data/core_deconz/.local/share/dresden-elektronik/deCONZ/devices/neo/ (neo directory didn’t exist, so I created it by myself)
And that
What happens if we create a custom DDF from a copy of this json in the Docker Mount (/docker/deconz/data/devices?
Data:
Addons:
And in /usr/share is no folder hassio:
@Smanar I can get the sensor recognized with the config file, at least thats what I think :) I can't get any power measurement data via the api though.
I'm running on a RaspberryPI, HomeAssistant in docker, deconz native install via apt or something. Steps I did:
~/.local/share/dresden-elektronik/deCONZ/devices
{
"etag": "04381f583750ed7ff9b2814e4367e0a5",
"hascolor": false,
"lastannounced": null,
"lastseen": "2022-04-28T17:52Z",
"manufacturername": "_TZ3000_ksw8qtmt",
"modelid": "TS011F",
"name": "On/Off plug-in unit 11",
"state": {
"alert": "none",
"on": true,
"reachable": true
},
"swversion": null,
"type": "On/Off plug-in unit",
"uniqueid": "a4:c1:38:5a:f2:47:ea:d0-01"
}
Any steps I'm missing or misunderstood. Am half proficient in coding so feel free to push me in the right direction.
I'm running on a RaspberryPI, HomeAssistant in docker, deconz native install via apt or something.
It mean deconz is not on docker ?
Saw the plug in the GUI and checked that Bronze is checked (was already enabled?) Had enabled this before on some Aqara sensor, is this setting shared or something?
You are speaking about the setting in the tab "control" ? This is other thing, here you set the minium level autorised by DDF, But you have ronze checked here ? By defaut it s "Gold"
You don't need to restart deconz, on the DDF editor, on the menu you have "Hot reload" On the GUI
You will see on the editor title the path and the file, and can test changes direclty before switching to headless mode.
Plug (light devices) don't have consumption, if all is working you will have a new sensor for that.
On the DDF you have downloaded, line 8, edit to put "Gold" (even you don't need it if you have checked "Bronze", but like that I m sure it can't be an issue ^^) Else the DDF realy look good.
You can see direclty the API in Phoscon / help / API Information.
@Brunsben I have some more information to edit DDF on HA https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-ha-using-text-editor/1839/2
Hi,
I have the same situation as @codeaphex above. When I look at the websocket events in phoscon app, I can also see the changing values of "current" etc..
{
"22:34:26:777": {
"e": "changed",
"id": "2",
"r": "lights",
"state": {
"consumption": 142,
"current": 467,
"on": true,
"power": 0,
"reachable": true,
"voltage": 236
},
"t": "event",
"uniqueid": "a4:.."
},
But I dont have any sensors with this data in the REST-API.
Plug (light devices) don't have consumption, if all is working you will have a new sensor for that.
@Smanar You mean after adding the light will have a Sensor as well, or should I be able to find the plug in the Phoscon App by searching for Sensors as well?
I'm running on a RaspberryPI, HomeAssistant in docker, deconz native install via apt or something.
It mean deconz is not on docker ?
Yes, deconz is not deployed via docker.
Saw the plug in the GUI and checked that Bronze is checked (was already enabled?) Had enabled this before on some
Aqara sensor, is this setting shared or something?You are speaking about the setting in the tab "control" ? This is other thing, here you set the minium level autorised by DDF, But you have ronze checked here ? By defaut it s "Gold" On the DDF you have downloaded, line 8, edit to put "Gold" (even you don't need it if you have checked "Bronze", but like that I m sure it can't be an issue ^^) Else the DDF realy look good.
Yes was bronze, I think it was read directly from the config. I now changed it back to gold and its still running.
You don't need to restart deconz, on the DDF editor, on the menu you have "Hot reload" On the GUI
- select the device
- right clic "edit DDF"
You will see on the editor title the path and the file, and can test changes direclty before switching to headless mode. You can see direclty the API in Phoscon / help / API Information.
Oh thats both pretty nice 😄
Plug (light devices) don't have consumption, if all is working you will have a new sensor for that.
Thats the last thing missing, same output as @Brandt1930. What do we need to do, to get the sensor and events recognized by Phoscon and HomeAssistant.
Just compared the config with a similar plug from Innr: https://github.com/dresden-elektronik/deconz-rest-plugin/blob/1d7f27ea34f3470998998fff8c28a2319817ce1e/devices/innr/sp_120.json
Looks like we need to add the configuration for the sensor?
Dont know if I could figure it out with some fiddling around (or if it will blow up that way lol), but it would probably take longer for me, than someone who had worked with it before.
Anyone who is up for that?
Thanks for providing the json @JanSucco. I successfully imported the DDF and paired the Nous A1Z. Except the metering it works fine. Let me know if you need anything from me.
Ha yes, lol, you are right, haven't checked the json. There is a problem, it miss the sensor part, all is mixed in the light entry, that's not "deconz rule" (that are from "philips rules" at start)
Try with this json
{
"schema": "devcap1.schema.json",
"manufacturername": "_TZ3000_ksw8qtmt",
"modelid": "TS011F",
"vendor": "Nous A1Z",
"product": "TS011F",
"sleeper": false,
"status": "Gold",
"subdevices": [
{
"type": "$TYPE_ON_OFF_PLUGIN_UNIT",
"restapi": "/lights",
"uuid": [
"$address.ext",
"0x01"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "state/alert"
},
{
"name": "state/on",
"refresh.interval": 360
},
{
"name": "state/reachable"
}
]
},
{
"type": "$TYPE_CONSUMPTION_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0702"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/consumption",
"refresh.interval": 360,
"parse": {
"at": "0x0000",
"cl": "0x0702",
"ep": 1,
"eval": "Item.val = Attr.val * 10;"
}
},
{
"name": "state/lastupdated"
}
]
},
{
"type": "$TYPE_POWER_SENSOR",
"restapi": "/sensors",
"uuid": [
"$address.ext",
"0x01",
"0x0b04"
],
"items": [
{
"name": "attr/id"
},
{
"name": "attr/lastannounced"
},
{
"name": "attr/lastseen"
},
{
"name": "attr/manufacturername"
},
{
"name": "attr/modelid"
},
{
"name": "attr/name"
},
{
"name": "attr/swversion"
},
{
"name": "attr/type"
},
{
"name": "attr/uniqueid"
},
{
"name": "config/on"
},
{
"name": "config/reachable"
},
{
"name": "state/current",
"refresh.interval": 360
},
{
"name": "state/lastupdated"
},
{
"name": "state/power",
"refresh.interval": 360
},
{
"name": "state/voltage",
"refresh.interval": 360
}
]
}
],
"bindings": [
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0006",
"report": [
{
"at": "0x0000",
"dt": "0x10",
"min": 1,
"max": 300
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0702",
"report": [
{
"at": "0x0000",
"dt": "0x25",
"min": 1,
"max": 300,
"change": "0x0000000A"
}
]
},
{
"bind": "unicast",
"src.ep": 1,
"cl": "0x0B04",
"report": [
{
"at": "0x0505",
"dt": "0x21",
"min": 1,
"max": 300,
"change": "0x00000001"
},
{
"at": "0x0508",
"dt": "0x21",
"min": 1,
"max": 300,
"change": "0x00000064"
},
{
"at": "0x050B",
"dt": "0x29",
"min": 1,
"max": 300,
"change": "0x00000001"
}
]
}
]
}
This one will create a light entry + 1 ZHAPower + 1 ZHAConsumption
@Smanar Thank you. Now its working and I have sensor data
"2": {
"config": {
"on": true,
"reachable": true
},
"etag": null,
"lastannounced": null,
"lastseen": "2022-04-29T20:28Z",
"manufacturername": "_TZ3000_ksw8qtmt",
"modelid": "TS011F",
"name": "Consumption 2",
"state": {
"consumption": 0,
"lastupdated": "2022-04-29T20:28:05.773"
},
"type": "ZHAConsumption",
"uniqueid": "a4:c1:38:7....6-01-0702"
},
"3": {
"config": {
"on": true,
"reachable": true
},
"etag": null,
"lastannounced": null,
"lastseen": "2022-04-29T20:28Z",
"manufacturername": "_TZ3000_ksw8qtmt",
"modelid": "TS011F",
"name": "Power 3",
"state": {
"current": 0,
"lastupdated": "2022-04-29T18:25:20.758",
"power": 0,
"voltage": 235
},
"type": "ZHAPower",
"uniqueid": "a4:c1:38:7...:e6-01-0b04"
},
Am I able to set the name or do I have to find the connection to the light(for a user set name in phsocon) via the uniqueid?
I m not sure to understand ? What do you want to do ? You can change the name ofc.
Lets say I named the plug "TV". Now in my Lights json I can find the name "TV". But in my Sensor JSON I can only find some generic name like Power 3 or Consumption 2. The only mapping between lights and sensors I see which should be possible is my cutting of some of the unique id of the sensor and searching for this on the lights json. There I can get my name TV again and can say TV is consuming 50 W or something. Or is there another way? Can I change the name of the sensors?
@Brandt1930 Just change the name of the entity under Configuration > Devices & Services > Entities
Ha yes, all is separed, you can use a different name for the power measurement and the consumption measurement. But you can rename them to use the same too.
For the procedue it depend of third app, as phosocon don't support all sensors.
@Smanar Thx for the config, finally a zigbee smart plug with working measurements that is also available in stores/online.
I'm running deconz from homeassistant os in a docker. I can connect with bash from portainer. However nano, vi, ftp etc are not installed. Opening nano and copy paste the json file doesn't work... How do I transfer the .json to the docker container?
Solved: cat > nous.json right click and paste ctrl-c
Ha nice I don't know this method https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/2 If you can explain better the command line to use pls ?
I managed to place the file (nous_a1z.json) in the devices folder. I can open the file in DDF editor and hot load it. I don't see how that changes anything in phoscon/home assistant. tried removing the device in deconz(VNC) and adding a new switch / light. It loads the old DDF. Must have missed something obvious...
It's working now solution was to enable pairing in deConz VNC.
Ordered a bunch of these plugs to replace my old non measuring switches.
Thanks!
Perhaps a conflit if there is 2 files. You can see on logs or on editor title the file and the path of the used DDF.
But to use your commands you need first to travel in docker stuff up to the good directory ? and some users don't find it.
I put the file in ~/.local/share/dresden-elektronik/deCONZ/devices Or should it go in /usr/share/deCONZ/devices/
I'll try both once I have the other plugs. It's working now.
Received new plugs. They pair directly if nous_a1z.json is stored in /data/.local/share/dresden-elektronik/deCONZ/devices DeCONZ and home assistant immediately recognize the switch with power and consumption entities. Nice!
I managed to pair two plugs correctly, but the plugs switch themselves on after a couple of seconds!? Removed the Integration in FHEM and Homassist - still the same, so it´s not an automation issue.
:(
Both of them ?
Sorry for reporting this device again, thanks for pointing me here. Right-clicked on the node, edit DDF and "save-as" to create a json file where appropriate, which I overwrote with the one provided by Smanar. Rebooted my RPI3 (for some strange reason the webapp was not responding anymore) Re-added the 2 "lights", it immediately showed the expected devices in Domoticz
Thanks for the support!
Both of them ?
yes on and off - random
And you can see them in phoscon ? the reported state is the real one ?
And you can see them in phoscon ? the reported state is the real one ?
yes, state under On/Off changes accordingly I also returned the switches as defect and got a replacement which behaves exactly the same
Don't know if this can be relevant but here is my Phoscon version (installed on RPI3 64bits) as I don't face the same issue
Ha yes, lol, you are right, haven't checked the json. There is a problem, it miss the sensor part, all is mixed in the light entry, that's not "deconz rule" (that are from "philips rules" at start)
Try with this json
{ "schema": "devcap1.schema.json", "manufacturername": "_TZ3000_ksw8qtmt", "modelid": "TS011F", "vendor": "Nous A1Z", "product": "TS011F", "sleeper": false, "status": "Gold", "subdevices": [ { "type": "$TYPE_ON_OFF_PLUGIN_UNIT", "restapi": "/lights", "uuid": [ "$address.ext", "0x01" ], "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "state/alert" }, { "name": "state/on", "refresh.interval": 360 }, { "name": "state/reachable" } ] }, { "type": "$TYPE_CONSUMPTION_SENSOR", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0702" ], "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/on" }, { "name": "config/reachable" }, { "name": "state/consumption", "refresh.interval": 360, "parse": { "at": "0x0000", "cl": "0x0702", "ep": 1, "eval": "Item.val = Attr.val * 10;" } }, { "name": "state/lastupdated" } ] }, { "type": "$TYPE_POWER_SENSOR", "restapi": "/sensors", "uuid": [ "$address.ext", "0x01", "0x0b04" ], "items": [ { "name": "attr/id" }, { "name": "attr/lastannounced" }, { "name": "attr/lastseen" }, { "name": "attr/manufacturername" }, { "name": "attr/modelid" }, { "name": "attr/name" }, { "name": "attr/swversion" }, { "name": "attr/type" }, { "name": "attr/uniqueid" }, { "name": "config/on" }, { "name": "config/reachable" }, { "name": "state/current", "refresh.interval": 360 }, { "name": "state/lastupdated" }, { "name": "state/power", "refresh.interval": 360 }, { "name": "state/voltage", "refresh.interval": 360 } ] } ], "bindings": [ { "bind": "unicast", "src.ep": 1, "cl": "0x0006", "report": [ { "at": "0x0000", "dt": "0x10", "min": 1, "max": 300 } ] }, { "bind": "unicast", "src.ep": 1, "cl": "0x0702", "report": [ { "at": "0x0000", "dt": "0x25", "min": 1, "max": 300, "change": "0x0000000A" } ] }, { "bind": "unicast", "src.ep": 1, "cl": "0x0B04", "report": [ { "at": "0x0505", "dt": "0x21", "min": 1, "max": 300, "change": "0x00000001" }, { "at": "0x0508", "dt": "0x21", "min": 1, "max": 300, "change": "0x00000064" }, { "at": "0x050B", "dt": "0x29", "min": 1, "max": 300, "change": "0x00000001" } ] } ] }
This one will create a light entry + 1 ZHAPower + 1 ZHAConsumption
Looks good to me (Docker on an AMD64 machine). How I proceeded:
sudo docker exec -it deconz /bin/bash
cat > /usr/share/deCONZ/devices/nous.json
Insert JSON from clipboard with right-click -> paste
finish editing with Ctrl + CBe aware, that this is not a persistent solution. Just wanted to try the JSON and give a feedback.
@TheNice4GH have you try with something that consumme enought power ? Some plugs are realy sensibles https://github.com/Koenkk/zigbee2mqtt/issues/11703#issuecomment-1109036970
No issue with a very low power consumption device (battery charger):
No issue with a medium power consumption device (warmsteam humidifier):
No issue with a high power consumption device (steam ironing station):
For the sake of comparison of readings, I plugged this new NOUS device into a ZW099 Smart Dimmer 6+ from AEON labs (ZWave) which I have installed for years now and connected a 400W Halogen light into them:
Then I reversed the order, NOUS first then AEON, same halogen light:
Seems pretty well aligned to me :-)
While busy in Domoticz I looked into the log and I noticed the following two lines appearing on a very regular basis, always in pair: [...] 2022-05-10 15:55:34.351 Error: Zigbee: Can't Update Unit > 13 (sensors) Special part 2022-05-10 15:55:34.351 Error: Zigbee: Can't Update Unit > 13 (sensors) Special part [...] 2022-05-10 15:54:10.954 Error: Zigbee: Can't Update Unit > 15 (sensors) Special part 2022-05-10 15:54:10.955 Error: Zigbee: Can't Update Unit > 15 (sensors) Special part [...] So far I'm unable to tell what it is about (could it be that little led that can be switched off?) or if it is due to Domoticz, Conbee2 or a combination of both...
While busy in Domoticz I looked into the log and I noticed the following two lines appearing on a very regular basis, always in pair: [...] 2022-05-10 15:55:34.351 Error: Zigbee: Can't Update Unit > 13 (sensors) Special part 2022-05-10 15:55:34.351 Error: Zigbee: Can't Update Unit > 13 (sensors) Special part [...] 2022-05-10 15:54:10.954 Error: Zigbee: Can't Update Unit > 15 (sensors) Special part 2022-05-10 15:54:10.955 Error: Zigbee: Can't Update Unit > 15 (sensors) Special part [...] So far I'm unable to tell what it is about (could it be that little led that can be switched off?) or if it is due to Domoticz, Conbee2 or a combination of both...
Is this related to this device?
13 and 15 already appear in my screenshots above. Additionally, herewith what is logged for the two NOUS plugs I have when I deactivate/reactive the ZigBee plugin:
[...] 2022-05-10 16:17:04.151 Zigbee: ### Device > 12 Name:Consumption 12 Type:ZHAConsumption Details:{'consumption': 490, 'lastupdated': '2022-05-10T14:17:03.386'} and {'on': True, 'reachable': True} 2022-05-10 16:17:04.152 Zigbee: ### Device > 13 Name:Power 13 Type:ZHAPower Details:{'current': 0, 'lastupdated': '2022-05-10T14:15:34.379', 'power': 0, 'voltage': 234} and {'on': True, 'reachable': True} 2022-05-10 16:17:04.153 Zigbee: ### Device > 14 Name:Consumption 14 Type:ZHAConsumption Details:{'consumption': 130, 'lastupdated': '2022-05-10T14:12:20.071'} and {'on': True, 'reachable': True} 2022-05-10 16:17:04.154 Zigbee: ### Device > 15 Name:Power 15 Type:ZHAPower Details:{'current': 0, 'lastupdated': '2022-05-10T14:14:11.019', 'power': 0, 'voltage': 235} and {'on': True, 'reachable': True} [...]
@Smanar I think this is more a domoticz thing than a deCONZ thing, correct?
Oups sorry my comment was for @shaktimaan (for his auto on / off devices)
have you try with something that consumme enought power ? Some plugs are realy sensibles https://github.com/Koenkk/zigbee2mqtt/issues/11703#issuecomment-1109036970
And yes it's domoticz related, you can ask on domoticz forum or domoticz plugin github, but to make short.
Many thanks for the update and explanation!
Hello, is anyone else noticing that you can't rename the devices after using the custom DDF? If I rename it in Phoscon it changes in deconZ as well. Sadly after I close and reopen deconZ the name changes back to Power52. In Phoscon it still got the old name I have changed it to.
Anyone knows how to fix that?
If I rename it in Phoscon it changes in deconZ as well. Sadly after I close and reopen deconZ the name changes back to Power52. In Phoscon it still got the old name I have changed it to.
Wich one deconz are you using ? When you change the name in phoscon, the name is updated in the API, and saved on the database, it need to be re-used on next start.
You have the issue on light entry and sensors entries ?
Hello, I'm using deconZ for Windows 10. Version: 2.16.0 Using the ddf you (@Smanar) has posted.
I don't have this issue with any other entry, except the innr sp120 which ddf file looks suprisingly exactly the same as used for the nous a1z except the model names etc.
Device
Screenshots
Basic
Identify
On/Off
Scenes
Groups
Electrical Measurement
Simple Metering
OTAU