Skip to content
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

[Request Device Support] Samsung SmartPlug 2019 Model ID: 7A-PL-Z-J3 #2121

Closed
smartypantsuk opened this issue Nov 24, 2019 · 240 comments
Closed

Comments

@smartypantsuk
Copy link

smartypantsuk commented Nov 24, 2019

I have just purchased a 2019 Smartthings Smart Plug which supports power monitoring.
Deconz treats it as an on/off plug and works fine in that respect, but I'd love to get power monitoring working. These plugs are a reasonable price without breaking the bank so would be brilliant if the energy side worked.

I have a feeling that these plugs could be manufacturered by Innr, but I aren't certain. The manufacturer code is 0x1168, which according to this page is an Innr reference, Innr2 to be precise Perhaps Innr use the '2' designation for products they manufacturer but release under a difference brand?..

They are almost identical to the Innr plug with size, shape and power switch location, but there are some tiny differences regarding depth and bevel at the front lip. The build quality is identical to the Innr device.

I have attached the important stuff, If i've missed anything please advise.

Model ID: 7A-PL-Z-J3

Thank you

node
node-info
basic-cluster
simple-metering-cluster
electrical-measurment-cluster

and some debug info, in which I turned the smart plug on and off:

debug.txt

and perhaps there is some information from this smartthings github page which mentions the same model/make of ZB-ONOFFPlug-D0005 and LDS

SmartThingsPublic

@smartypantsuk smartypantsuk changed the title Smartthings SmartPlug support Device support request: Samsung SmartPlug Nov 24, 2019
@smartypantsuk smartypantsuk changed the title Device support request: Samsung SmartPlug Device support request: Samsung SmartPlug 2019 Model ID: 7A-PL-Z-J3 Nov 24, 2019
@smartypantsuk smartypantsuk changed the title Device support request: Samsung SmartPlug 2019 Model ID: 7A-PL-Z-J3 [Request Device Support] Samsung SmartPlug 2019 Model ID: 7A-PL-Z-J3 Nov 26, 2019
@avotronics101
Copy link

I'd like this working too. I've just purchased 6 of these smartthings smart plugs to use with Homeseer via deconz. The only alternative which support energy monitoring is the Aeotec or Fibaro smart plugs but they are twice the price, around £60 each which is far too much money. The Samsung plugs support energy monitoring and cost 50% less, approx. £30. We just need to get it needed. Have you found a way yet?

@smartypantsuk
Copy link
Author

I'd like this working too. I've just purchased 6 of these smartthings smart plugs to use with Homeseer via deconz. The only alternative which support energy monitoring is the Aeotec or Fibaro smart plugs but they are twice the price, around £60 each which is far too much money. The Samsung plugs support energy monitoring and cost 50% less, approx. £30. We just need to get it needed. Have you found a way yet?

Unfortunately I'm no programmer. We need someone else involved?

@SwoopX
Copy link
Collaborator

SwoopX commented Dec 6, 2019

Let me see if I can help you with that. I'd definitively require your feedback regarding correct values for power and consumption...

@smartypantsuk
Copy link
Author

Let me see if I can help you with that. I'd definitively require your feedback regarding correct values for power and consumption...

That would be great and very appreciated.
I can help you as long as I understand the question 😆

@smartypantsuk
Copy link
Author

Let me know what you need.

Thanks

@SwoopX
Copy link
Collaborator

SwoopX commented Dec 7, 2019

No worries. Right now, I just need a little bit of time. Keep an eye on this issue and I'll ping you once ready.

Hope you're not running on docker? It would help if you could compile the plugin and do some testing once the changes are ready. Right now, I'd say I only need some feedback if the values are plausible. If not, the divisor for calculating the consumption needs to be amended.

@smartypantsuk
Copy link
Author

No I'm on Windows but I can get my Linux box out of the cupboard if needed

SwoopX added a commit to SwoopX/deconz-rest-plugin that referenced this issue Dec 8, 2019
SwoopX added a commit to SwoopX/deconz-rest-plugin that referenced this issue Dec 8, 2019
@SwoopX
Copy link
Collaborator

SwoopX commented Dec 8, 2019

Ok, should be good to go now. You may try the version from my repo https://github.com/SwoopX/deconz-rest-plugin.

Before you do that, please provide me with screenshots for the reporting configuration from deconz GUI. In the GUI, please go to Simple Metering and double click on attribute 0x0000 (Current Summation Delivered). Then, read config. Please do the same for Electrical Measurement and attribute 0x050B.

Good luck ;)

@smartypantsuk
Copy link
Author

I tried that unfortunately it seems to give me a NOT_FOUND message when I click on read config. I hope this doesn't mean we're out of luck? I did unlock network prior to clicking the button. I can try again tomorrow when I'm not so tired.

@SwoopX
Copy link
Collaborator

SwoopX commented Dec 8, 2019

Just have the device paired and plugged in should suffice. I wonder that it says not found, doesn't really make sense...

However, nothing serious, I was just after the default values. We can give it pretty much what we want to have in the end.

@smartypantsuk
Copy link
Author

smartypantsuk commented Dec 9, 2019

I tried again today, device was paired, plugged in and switched on but no load.
I still got the NOT_FOUND error on read config.

You did mean 0x050B and not 0x0508?
Either way, the reading was the same outcome.

And... pardon my ignorance, I assume that I need to compile the version in your repo for windows?
Is there some guidance on that?

current-summation
active-power

@SwoopX
Copy link
Collaborator

SwoopX commented Dec 9, 2019

You did mean 0x050B and not 0x0508?

0x050B is correct.

I tried again today, device was paired, plugged in and switched on but no load.
I still got the NOT_FOUND error on read config.

Thanks for double checking. Currently no idea why this is but let's put that aside for the time being.

And... pardon my ignorance, I assume that I need to compile the version in your repo for windows? Is there some guidance on that?

All good. I don't know how to compile on Windows to be honest as my stuff is running on a RPi. For Linux, it should work out with the prerequisites mentioned here. Once the repo is added to apt, the dev-pachakge must be installed via
sudo apt-get install deconz-dev
Lastly, the instructions for compiling the plugin are mentioned in the repo readme.

Hope, that helps.

@smartypantsuk
Copy link
Author

Thanks, I'm looking at compiling it tonight.

@smartypantsuk
Copy link
Author

SwoopX,

I have compiled the plugin and I 'think' I am running it in deCONZ but is there anyway to tell I'm actually running your plugin version, just in case I messed up?

Also, is there any way to tell if the plugin changes you made are working without connecting to deCONZ via a thrid-partry home controller? I normally use Homeseer but that's on my other windows system. I can install a controller if need be.

@SwoopX
Copy link
Collaborator

SwoopX commented Dec 11, 2019

Also, is there any way to tell if the plugin changes you made are working without connecting to deCONZ via a thrid-partry home controller? I normally use Homeseer but that's on my other windows system. I can install a controller if need be.

Sure it is. you could use e.g. Rested plugin for Firefox (or any other REST-Plugin will do). However, to connect, you must have a valid API key. To get one, login to Phoscon via browser. Then, open a console and open deconz' DB, located in the home directory of the user deconz is running under (requires sqlite3 to be installed)

sqlite3 .local/share/dresden-elektronik/deCONZ/zll.db
select * from auth;

First values are the API key. Copy it and call the following URL (use either your local IP or 127.0.0.1 when calling it directly on the device):
http://192.168.XXX.XXX/api/<APIKEY>/sensors

Look for 2 sensors haveing the model identifier as in your screenshot above. The should be there and show values while a load is connected. Make sure to refresh the API query several times to see the changes.

but is there anyway to tell I'm actually running your plugin version

Not too sure to be honest. Didn't care much about that since Ive got a dedicated test system and gateway.

@wvuyk
Copy link

wvuyk commented Dec 12, 2019

@smartypantsuk
You can also find the API key JowiHue is using on the properties of the gateway device, the JowiHue tab. You can use that as well.

@smartypantsuk
Copy link
Author

smartypantsuk commented Dec 12, 2019

@smartypantsuk
You can also find the API key JowiHue is using on the properties of the gateway device, the JowiHue tab. You can use that as well.

I'm running latest Jowihue but not seeing API key. I can see the API version info.
I went to the jowihue tab of the bridge device as specified.

@smartypantsuk
Copy link
Author

Also, is there any way to tell if the plugin changes you made are working without connecting to deCONZ via a thrid-partry home controller? I normally use Homeseer but that's on my other windows system. I can install a controller if need be.

Sure it is. you could use e.g. Rested plugin for Firefox (or any other REST-Plugin will do). However, to connect, you must have a valid API key. To get one, login to Phoscon via browser. Then, open a console and open deconz' DB, located in the home directory of the user deconz is running under (requires sqlite3 to be installed)

sqlite3 .local/share/dresden-elektronik/deCONZ/zll.db
select * from auth;

First values are the API key. Copy it and call the following URL (use either your local IP or 127.0.0.1 when calling it directly on the device):
http://192.168.XXX.XXX/api/<APIKEY>/sensors

Look for 2 sensors haveing the model identifier as in your screenshot above. The should be there and show values while a load is connected. Make sure to refresh the API query several times to see the changes.

but is there anyway to tell I'm actually running your plugin version

Not too sure to be honest. Didn't care much about that since Ive got a dedicated test system and gateway.

Thanks SwoopX

@wvuyk
Copy link

wvuyk commented Dec 12, 2019

Check the Bridge user field, that is the API key for the plugin you need.
Should have mentioned that in the first post :-)

@smartypantsuk
Copy link
Author

smartypantsuk commented Dec 12, 2019

Check the Bridge user field, that is the API key for the plugin you need.
Should have mentioned that in the first post :-)

I actually thought it might be that but when I tried it I got an unauthorised user error. I'll try again later.

@smartypantsuk
Copy link
Author

Check the Bridge user field, that is the API key for the plugin you need.
Should have mentioned that in the first post :-)

I couldn't get that API key to work, whereas the method in SwoopX instructions worked, don't know why, everything in Jowihue works well.

@smartypantsuk
Copy link
Author

Look for 2 sensors haveing the model identifier as in your screenshot above. The should be there and show values while a load is connected. Make sure to refresh the API query several times to see the changes.

So I tried this, but the Samsung Smart Plug shows up under 'Lights' and not sensors. It also is listed only once, as below:

listed-as-light

@SwoopX
Copy link
Collaborator

SwoopX commented Dec 14, 2019

Thanks, that's not really the expected behaviour... I'd like to see the debug output from the join process. Could you please delete the device from Phoscon and then rejoin as a light? Before doing so, stop the deconz GUI service with the first command and enable debug output to be written to a file with the 2nd command

sudo systemctl stop deconz-gui
deCONZ --http-port=80 --ws-port=8888 --dbg-error=1 --dbg-info=1 > sam_join

Then, please post the file here.

@smartypantsuk
Copy link
Author

smartypantsuk commented Dec 15, 2019

Okay, think I got this right.
Note: The Samsung Plug is the LightNode 8 or Light 8, I'm not sure why the other nodes were responding.

19:26:37:066 HTTP Server listen on address 0.0.0.0, port: 80, root: /usr/share/deCONZ/webapp/
19:26:37:078 CTRL. 3.22.019:26:37:693 ZCLDB init file /home/dan/.local/share/dresden-elektronik/deCONZ/zcldb.txt
19:26:38:105 parent process bash
19:26:38:105 gw run mode: normal
19:26:38:105 GW sd-card image version file does not exist: /home/dan/.local/share/dresden-elektronik/deCONZ/gw-version
19:26:38:107 DB sqlite version 3.22.0
19:26:38:109 DB PRAGMA page_count: 30
19:26:38:109 DB PRAGMA page_size: 4096
19:26:38:109 DB PRAGMA freelist_count: 0
19:26:38:109 DB file size 122880 bytes, free pages 0
19:26:38:109 DB PRAGMA user_version: 6
19:26:38:109 DB cleanup
19:26:38:110 DB create temporary views
19:26:38:122 don't close database yet, keep open for 900 seconds
19:26:38:123 started websocket server at port 8888
19:26:38:129 found node plugin: libde_rest_plugin.so - REST API Plugin
19:26:38:133 found node plugin: libde_signal_plugin.so - Signal Monitor Plugin
19:26:38:157 found node plugin: libstd_otau_plugin.so - STD OTAU Plugin
19:26:38:312 Device firmware version 0x26490700
19:26:38:318 unlocked max nodes: 200
19:26:38:469 Device protocol version: 0x010B
19:26:38:515 new node - ext: 0x00212effff04fc3b, nwk: 0x0000
19:26:38:627 don't close database yet, keep open for 900 seconds
19:26:38:628 LightNode 1: Color temperature light 1 added
19:26:38:640 don't close database yet, keep open for 900 seconds
19:26:38:641 LightNode 2: Color temperature light 2 added
19:26:38:659 don't close database yet, keep open for 900 seconds
19:26:38:659 LightNode 3: Color temperature light 3 added
19:26:38:670 don't close database yet, keep open for 900 seconds
19:26:38:671 LightNode 4: Dimmable light 4 added
19:26:38:699 SensorNode 2 set node 0x001788010670ad57
19:26:38:712 don't close database yet, keep open for 900 seconds
19:26:38:712 LightNode 5: Color temperature light 5 added
19:26:38:723 don't close database yet, keep open for 900 seconds
19:26:38:724 LightNode 6: Color temperature light 6 added
19:26:38:762 CTRL [d0:cf:5e:ff:fe:ff:dc:9d] not viable in zll.db, skip load cache (101)
19:26:38:763 CTRL [00:17:88:01:06:35:b4:d3] not viable in zll.db, skip load cache (101)
19:26:38:764 CTRL [00:0d:6f:ff:fe:45:a0:bb] not viable in zll.db, skip load cache (101)
19:26:38:765 CTRL [00:17:88:01:06:37:f8:3f] not viable in zll.db, skip load cache (101)
19:26:38:766 CTRL [00:17:88:01:04:f2:72:7d] not viable in zll.db, skip load cache (101)
19:26:38:766 CTRL [00:15:8d:00:03:f1:00:3b] not viable in zll.db, skip load cache (101)
19:26:38:766 CTRL [00:15:8d:00:03:f0:fd:50] not viable in zll.db, skip load cache (101)
19:26:38:979 Current channel 25
19:26:38:997 CTRL got nwk update id 0
19:26:38:003 CTRL ANT_CTRL 0x03
19:26:39:042 Device protocol version: 0x010B
19:26:39:078 UPNP socket not bound, state: 0
19:26:39:120 Current channel 25
19:26:39:139 CTRL got nwk update id 0
19:26:39:145 CTRL ANT_CTRL 0x03
19:26:39:206 ZCL attribute report 0x0017880104F2727D for cluster 0x0001, ep 0x02
19:26:39:215 no button handler for: RWL021 ep: 0x02 cl: 0x0001 cmd: 0x0A pl[0]: 0x21
19:26:39:215 ZCL attribute report 0x001788010670AD57 for cluster 0x0001, ep 0x02
19:26:43:057 GW update firmware found: /usr/share/deCONZ/firmware/deCONZ_ConBeeII_0x26490700.bin.GCF
19:26:43:057 GW firmware version: 0x26490700
19:26:43:057 GW firmware version is up to date: 0x26490700
19:26:43:752 Announced to internet http://dresden-light.appspot.com/discover
19:26:46:299 new node - ext: 0x00158d0003f0fd50, nwk: 0x49E3
19:26:51:062 don't close database yet, keep open for 900 seconds
19:26:55:941 saved node state in 3 ms
19:26:56:016 sync() in 74 ms
19:27:01:338 New websocket 10.0.2.15:35844 (state: 3)
19:27:02:235 Websocket disconnected 10.0.2.15:35844 (state: 0)
19:27:04:620 New websocket 10.0.2.15:35848 (state: 3)
19:27:09:917 send permit join, duration: 59
19:27:23:118 DeviceAnnce of LightNode: 0x001788010472d5b2 Permit Join: 46
19:27:23:119 device announce 0x001788010472D5B2 (0xCBE7) mac capabilities 0x8E
19:27:23:119 device announce 0x001788010472D5B2 (0xCBE7) mac capabilities 0x8E
19:27:23:242 ZDP discovery done in 124 ms19:27:36:945 Current channel 25
19:27:36:951 CTRL got nwk update id 0
19:27:36:958 Device TTL 3122 s flags: 0x7
19:27:39:594 APS-DATA.indication from unknown node 0xCCCCCCFFFE6E2F7D
19:27:39:594 CTRL restore cached node 0xccccccfffe6e2f7d
19:27:39:594 Node zombie state changed 0xccccccfffe6e2f7d
19:27:39:595 new node - ext: 0xccccccfffe6e2f7d, nwk: 0x8D12
19:27:39:596 device announce 0xCCCCCCFFFE6E2F7D (0x8D12) mac capabilities 0x8E
19:27:39:596 device announce 0xCCCCCCFFFE6E2F7D (0x8D12) mac capabilities 0x8E
19:27:39:760 DB UPDATE device_descriptors SET data = x'01408e6811525200002c520000', timestamp = 1576438059 WHERE device_id = (SELECT id FROM devices WHERE mac = 'cc:cc:cc:ff:fe:6e:2f:7d') AND endpoint = 0 AND type = 2
19:27:39:760 DB INSERT INTO device_descriptors (device_id, endpoint, type, data, timestamp) SELECT id, 0, 2, x'01408e6811525200002c520000', 1576438059 FROM devices WHERE mac = 'cc:cc:cc:ff:fe:6e:2f:7d'
19:27:39:771 don't close database yet, keep open for 900 seconds
19:27:40:058 don't close database yet, keep open for 900 seconds
19:27:40:059 don't close database yet, keep open for 900 seconds
19:27:40:059 LightNode 8: Smart plug 8 added
19:27:40:060 DB UPDATE device_descriptors SET data = x'01040151000108000003000400050006000207040b82fc0303000a001900', timestamp = 1576438060 WHERE device_id = (SELECT id FROM devices WHERE mac = 'cc:cc:cc:ff:fe:6e:2f:7d') AND endpoint = 1 AND type = 4
19:27:40:061 DB INSERT INTO device_descriptors (device_id, endpoint, type, data, timestamp) SELECT id, 1, 4, x'01040151000108000003000400050006000207040b82fc0303000a001900', 1576438060 FROM devices WHERE mac = 'cc:cc:cc:ff:fe:6e:2f:7d'
19:27:40:076 don't close database yet, keep open for 900 seconds
19:27:40:294 DB UPDATE device_descriptors SET data = x'f2e0a161000000012100', timestamp = 1576438060 WHERE device_id = (SELECT id FROM devices WHERE mac = 'cc:cc:cc:ff:fe:6e:2f:7d') AND endpoint = 242 AND type = 4
19:27:40:294 DB INSERT INTO device_descriptors (device_id, endpoint, type, data, timestamp) SELECT id, 242, 4, x'f2e0a161000000012100', 1576438060 FROM devices WHERE mac = 'cc:cc:cc:ff:fe:6e:2f:7d'
19:27:40:301 don't close database yet, keep open for 900 seconds
19:27:40:440 ZDP discovery done in 844 ms19:27:41:005 Add to group response for light 8. Status:0x00, capacity: 0
19:27:49:938 saved node state in 5 ms
19:27:49:960 sync() in 21 ms
19:28:09:827 Search sensors done
19:28:09:928 don't close database yet, keep open for 900 seconds
19:28:12:071 0x001788010472D5B2 error APSDE-DATA.confirm: 0xE9 on task
19:28:22:670 Websocket disconnected 10.0.2.15:35848 (state: 0)
19:28:25:693 ZCL attribute report 0x001788010635B4D3 for cluster 0x0001, ep 0x02
19:28:26:857 saved node state in 3 ms
19:28:26:879 sync() in 21 ms
19:28:26:880 REST API plugin shutting down
19:28:26:886 sync() in 5 ms

@djashjones
Copy link

I've just got mine, watching with interest :o)

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 7, 2020

It's never been there with the commit which added the 2nd vendor.

@smartypantsuk
Copy link
Author

ok. but if I was to recompile this wouldn't tell us anything would it? after all it worked fine on Ubuntu just not in Windows

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 7, 2020

after all it worked fine on Ubuntu just not in Windows

? Where does that come from? It's the same code for both OS.

@smartypantsuk
Copy link
Author

after all it worked fine on Ubuntu just not in Windows

? Where does that come from? It's the same code for both OS.

What I mean is, I compiled your plugin and it worked previously. But those changes, I'm assuming, were committed and when deconz for Windows was updated with those changes it should now be working, no?

Sorry I'm a bit lost with the github commit process etc

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 7, 2020

Well, when I do a commit to my repo, this means that you have the change generally available in the code. Since you must compile it, it shouldn't matter if you do it on Windows or Linux.

Now, when I want to have that commit also in the official deconz repo, I have to issue a pull request. The guys can then check if everything's ok and eventually merge it, so it becomes an official part. However, this is not connected to the deconz releases in any way.

DE releases a new version when they're ready and typically do so for Windows and Linux.

So bottom line is: I made the change now in MY repo, raised a pull request to merge it in the OFFICIAL repo, hoping it will be accepted in time for the upcoming .75 release.

Hope that made things a bit clearer.

@smartypantsuk
Copy link
Author

crystal clear thanks.
Let's see what happens then. I hope all the effort is worth it in the end. 👍

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 7, 2020

Mee too. Don't get me wrong, but I'm getting sick and tired of the device... :)

Btw, the PR got merged, so now we're official 😎

@smartypantsuk
Copy link
Author

Mee too. Don't get me wrong, but I'm getting sick and tired of the device... :)

Btw, the PR got merged, so now we're official

😂...
Ok great

@djashjones
Copy link

I'm waiting for when zigbee2mqtt will wok conbee hardware which should be soon. So adding a new device will be less painful. I don't understand half of the above. Great work guys!!!

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 8, 2020

Version also already been bumped to .75, so it should arrive any day...

@djashjones
Copy link

Might be a while for Home Assistant users, like myself will see the update

@smartypantsuk
Copy link
Author

Might be a while for Home Assistant users, like myself will see the update

I thought yours were working okay on .73

@djashjones
Copy link

When I add the 2 remaining plugs I was on .74. (no power sensors)

When I did a restore from my HA back up. Deconz was .73 and the sensors were created.

When .75 gets released, it will take a few days before the deconz addon gets updated to the new version.

@djashjones
Copy link

djashjones commented Mar 23, 2020

Just ordered a 5 pack from amazon and I'm .75. Will report back on how they perform 😄

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 23, 2020

Is it working again or do you feel like gambling? 😄

@djashjones
Copy link

Will find out in a few days if the gamble paid off. I think it's the best choice if you live in the UK if you require power monitoring.

Anyway if it does not work with .75, then it will be fixed by .76 😉

@djashjones
Copy link

Just tried 1 of 5 and it's all good. Something to note thou, unlike my other 3 (FW 2.3) this one is FW 2.2.
ST plug

@SwoopX
Copy link
Collaborator

SwoopX commented Mar 24, 2020

Yeah 😎

@mike182uk
Copy link

I have tried setting up this plug with the latest version of deconz (with a view to use in home assistant) and the power / consumption sensors are never created. I've tried everything in this thread but can't seem to get it working 😢. I'm using the latest version of docker-deconz with a brand new ConBee 2 on firmware version: 0x264a0700. The plug is on firmware version: 2.2 according to deconz. Any ideas?

Interestingly, if i don't use phoscon and deconz at all, and instead use the zha integration in Home Assistant (which i believe uses https://github.com/zigpy/zigpy-deconz), the sensors for the plug are created as expected (like @djashjones screenshot above)

@mike182uk
Copy link

So had another play with this and managed to get deconz to add the sensors, semi related to #2121 (comment)

My steps were (from fresh everything):

  1. Boot up the deconz container and let everything load up
  2. In phoscon start a search via the initial screen that shows asking you if you want to add lights (does a 3 min search)
  3. I see 2 devices get added - LightNode 1: Smart Plug 1 & LightNode 2: Configuration Tool 2
  4. I check the database and see that no sensors have been added and logs show no indication of sensors being added. A node has been added for the smart plug.
  5. In the deconz GUI, i view the details of the Basic cluster and press the read button in the attributes section. I see 2 Sensors get added in the logs (SensorNode 2: Consumption, SensorNode 3: Power).
  6. After the search is done, check database and see the 2 new sensors added for the device
Log
λ docker-compose up deconz
Starting deconz ... done
Attaching to deconz
deconz    | [marthoc/deconz] Starting deCONZ...
deconz    | [marthoc/deconz] Current deCONZ version: 2.05.75
deconz    | [marthoc/deconz] Web UI port: 8124
deconz    | [marthoc/deconz] Websockets port: 8125
deconz    | [marthoc/deconz] VNC port: 5900
deconz    | Killing Xtigervnc process ID 23... which was already dead
deconz    | Cleaning stale pidfile '/root/.vnc/default:0.pid'!
deconz    | Cleaning stale x11 lock '/tmp/.X0-lock'!
deconz    | Cleaning stale x11 lock '/tmp/.X11-unix/X0'!
deconz    |
deconz    | New 'default:0 (root)' desktop at :0 on machine default
deconz    |
deconz    | Starting applications specified in /etc/X11/Xvnc-session
deconz    | Log file is /root/.vnc/default:0.log
deconz    |
deconz    | Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /root/.vnc/passwd default:0 to connect to the VNC server.
deconz    |
deconz    | libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:${ORIGIN}/dri:/usr/lib/dri)
deconz    | libEGL warning: DRI2: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:${ORIGIN}/dri:/usr/lib/dri)
deconz    | libpng warning: iCCP: known incorrect sRGB profile
deconz    | 22:27:39:979 HTTP Server listen on address 0.0.0.0, port: 8124, root: /usr/share/deCONZ/webapp/
deconz    | 22:27:39:984 CTRL. 3.16.222:27:40:012 COM: --dev: /dev/zigbee_usb_stick (RaspBee)
deconz    | 22:27:40:012 ZCLDB init file /root/.local/share/dresden-elektronik/deCONZ/zcldb.txt
deconz    | 22:27:40:051 parent process /bin/sh
deconz    | 22:27:40:051 gw run mode: docker
deconz    | 22:27:40:052 GW sd-card image version file does not exist: /root/.local/share/dresden-elektronik/deCONZ/gw-version
deconz    | 22:27:40:054 DB sqlite version 3.16.2
deconz    | 22:27:40:055 DB PRAGMA page_count: 0
deconz    | 22:27:40:055 DB PRAGMA page_size: 4096
deconz    | 22:27:40:056 DB PRAGMA freelist_count: 0
deconz    | 22:27:40:056 DB file size 0 bytes, free pages 0
deconz    | 22:27:40:057 DB PRAGMA user_version: 0
deconz    | 22:27:40:058 DB upgrade to user_version 1
deconz    | 22:27:40:109 DB write sqlite user_version 1
deconz    | 22:27:40:112 DB PRAGMA user_version: 1
deconz    | 22:27:40:112 DB upgrade to user_version 2
deconz    | 22:27:40:117 DB write sqlite user_version 2
deconz    | 22:27:40:120 DB PRAGMA user_version: 2
deconz    | 22:27:40:120 DB upgrade to user_version 6
deconz    | 22:27:40:129 DB write sqlite user_version 6
deconz    | 22:27:40:133 DB PRAGMA user_version: 6
deconz    | 22:27:40:133 DB cleanup
deconz    | 22:27:40:135 DB create temporary views
deconz    | 22:27:40:140 don't close database yet, keep open for 900 seconds
deconz    | 22:27:40:141 don't close database yet, keep open for 900 seconds
deconz    | 22:27:40:141 started websocket server at port 8125
deconz    | 22:27:40:142 create default username and password
deconz    | 22:27:40:144 found node plugin: libde_rest_plugin.so - REST API Plugin
deconz    | 22:27:40:146 found node plugin: libde_signal_plugin.so - Signal Monitor Plugin
deconz    | 22:27:40:157 found node plugin: libstd_otau_plugin.so - STD OTAU Plugin
deconz    | 22:27:40:170 COM: --dev: /dev/zigbee_usb_stick (RaspBee)
deconz    | 22:27:45:020 don't close database yet, keep open for 900 seconds
deconz    | 22:27:46:138 void MainWindow::devConnectClicked() choose com /dev/zigbee_usb_stick
deconz    | 22:27:46:176 Device firmware version 0x264A0700
deconz    | 22:27:46:201 unlocked max nodes: 200
deconz    | 22:27:46:203 Announced to internet http://dresden-light.appspot.com/discover
deconz    | 22:27:46:291 Device protocol version: 0x010B
deconz    | 22:27:46:296 new node - ext: 0x00212effff05996f, nwk: 0x0000
deconz    | 22:27:46:365 Current channel 11
deconz    | 22:27:46:386 CTRL ANT_CTRL 0x03
deconz    | 22:27:46:420 Device protocol version: 0x010B
deconz    | 22:27:46:425 New websocket 192.168.0.29:58327 (state: 3)
deconz    | 22:27:46:488 Current channel 11
deconz    | 22:27:46:514 CTRL ANT_CTRL 0x03
deconz    | 22:27:46:596 don't close database yet, keep open for 900 seconds
deconz    | 22:27:46:785 don't close database yet, keep open for 900 seconds
deconz    | 22:27:46:792 don't close database yet, keep open for 900 seconds
deconz    | 22:27:46:871 don't close database yet, keep open for 900 seconds
deconz    | 22:27:46:878 don't close database yet, keep open for 900 seconds
deconz    | 22:27:46:996 ZDP discovery done in 294 ms22:27:51:061 don't close database yet, keep open for 900 seconds
deconz    | 22:27:55:020 GW update firmware found: /usr/share/deCONZ/firmware/deCONZ_ConBeeII_0x26490700.bin.GCF
deconz    | 22:27:55:020 GW firmware version: 0x264a0700
deconz    | 22:27:55:020 GW firmware version is up to date: 0x264a0700
deconz    | 22:27:57:020 saved node state in 0 ms
deconz    | 22:27:57:021 sync() in 1 ms
deconz    | 22:28:00:008 Set bridgeid to 00212EFFFF05996F
deconz    | 22:28:05:017 don't close database yet, keep open for 900 seconds
deconz    | 22:28:35:153 Websocket disconnected 192.168.0.29:58327 (state: 0)
deconz    | 22:28:36:325 New websocket 192.168.0.29:58333 (state: 3)
deconz    | 22:28:40:042 Current channel 11
deconz    | 22:28:40:048 Device TTL 4576 s flags: 0x7
deconz    | 22:28:52:502 Websocket disconnected 192.168.0.29:58333 (state: 0)
deconz    | 22:28:53:668 New websocket 192.168.0.29:58338 (state: 3)
deconz    | 22:28:57:621 Websocket disconnected 192.168.0.29:58338 (state: 0)
deconz    | 22:28:58:705 New websocket 192.168.0.29:58341 (state: 3)
deconz    | 22:29:07:741 Websocket disconnected 192.168.0.29:58341 (state: 0)
deconz    | 22:29:14:205 created username: 30E9FF061A, devicetype: Phoscon#B1504x1590
deconz    | 22:29:19:015 don't close database yet, keep open for 900 seconds
deconz    | 22:29:29:191 Updated password hash: $1$8282jdkm$9MrPmYwS8P8.9tH3H1s9D1
deconz    | 22:29:29:202 created username: B56FB2EC10, devicetype: Phoscon#B1504x1590
deconz    | 22:29:30:454 New websocket 192.168.0.29:58359 (state: 3)
deconz    | 22:29:34:017 don't close database yet, keep open for 900 seconds
deconz    | 22:29:37:469 Websocket disconnected 192.168.0.29:58359 (state: 0)
deconz    | 22:29:38:605 New websocket 192.168.0.29:58367 (state: 3)
deconz    | 22:29:40:023 Current channel 11
deconz    | 22:29:40:028 Device TTL 4516 s flags: 0x7
deconz    | 22:29:42:276 Websocket disconnected 192.168.0.29:58367 (state: 0)
deconz    | 22:29:42:911 don't close database yet, keep open for 900 seconds
deconz    | 22:29:43:392 New websocket 192.168.0.29:58371 (state: 3)
deconz    | 22:29:54:008 send permit join, duration: 59
deconz    | 22:29:55:789 APS-DATA.indication from unknown node 0x14B457FFFECBFCEB
deconz    | 22:29:55:790 new node - ext: 0x14b457fffecbfceb, nwk: 0x2D9B
deconz    | 22:29:55:790 device announce 0x14B457FFFECBFCEB (0x2D9B) mac capabilities 0x8E
deconz    | 22:29:55:790 device announce 0x14B457FFFECBFCEB (0x2D9B) mac capabilities 0x8E
deconz    | 22:29:55:912 don't close database yet, keep open for 900 seconds
deconz    | 22:29:56:206 don't close database yet, keep open for 900 seconds
deconz    | 22:29:56:207 don't close database yet, keep open for 900 seconds
deconz    | 22:29:56:208 LightNode 1: Smart plug 1 added
deconz    | 22:29:56:214 don't close database yet, keep open for 900 seconds
deconz    | 22:29:56:363 don't close database yet, keep open for 900 seconds
deconz    | 22:29:56:397 Add to group response for light 1. Status:0x00, capacity: 0
deconz    | 22:29:56:436 ZDP discovery done in 646 ms22:30:03:011 don't close database yet, keep open for 900 seconds
deconz    | 22:30:03:012 don't close database yet, keep open for 900 seconds
deconz    | 22:30:03:013 LightNode 2: Configuration tool 2 added
deconz    | 22:30:03:013 drop request to zombie (rx = 0)
deconz    | 22:30:03:921 FP indication 0x0104 / 0x0000 (0x00212EFFFF05996F / 0x0000)
deconz    | 22:30:03:921                       ...     (0x0000000000000000 / 0x0000)
deconz    | 22:30:03:943 FP indication 0x0104 / 0x0000 (0x00212EFFFF05996F / 0x0000)
deconz    | 22:30:03:943                       ...     (0x0000000000000000 / 0x0000)
deconz    | 22:30:06:020 saved node state in 1 ms
deconz    | 22:30:06:021 sync() in 1 ms
deconz    | 22:30:16:089 verified group capacity: 11 and group count: 1 of LightNode 0x14b457fffecbfceb
deconz    | 22:30:16:089 0x14b457fffecbfceb found group 0xFFF0
deconz    | 22:30:18:944 FP indication 0x0104 / 0x0000 (0x00212EFFFF05996F / 0x0000)
deconz    | 22:30:18:944                       ...     (0x0000000000000000 / 0x0000)
deconz    | 22:30:18:967 FP indication 0x0104 / 0x0000 (0x00212EFFFF05996F / 0x0000)
deconz    | 22:30:18:967                       ...     (0x0000000000000000 / 0x0000)
deconz    | 22:30:40:025 Current channel 11
deconz    | 22:30:40:030 Device TTL 4456 s flags: 0x7
deconz    | 22:30:53:454 Search sensors done    <---- Around here is where I clicked to read the basic attribute in deconz
deconz    | 22:30:55:008 send permit join, duration: 59
deconz    | 22:31:18:110 don't close database yet, keep open for 900 seconds
deconz    | 22:31:18:110 SensorNode 2: Consumption 2 added
deconz    | 22:31:18:112 don't close database yet, keep open for 900 seconds
deconz    | 22:31:18:112 SensorNode 3: Power 3 added
deconz    | 22:31:18:116 discard double entry in binding queue (size: 2) for for 0x14B457FFFECBFCEB, cluster 0x0702
deconz    | 22:31:18:119 discard double entry in binding queue (size: 2) for for 0x14B457FFFECBFCEB, cluster 0x0B04
deconz    | 22:31:18:222 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0702
deconz    | 22:31:18:233 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0B04
deconz    | 22:31:40:039 Current channel 11
deconz    | 22:31:40:049 Device TTL 4396 s flags: 0x7
deconz    | 22:31:54:346 Search sensors done
deconz    | 22:31:55:020 GW firmware version: 0x264a0700
deconz    | 22:31:55:020 GW firmware version is up to date: 0x264a0700
deconz    | 22:31:56:015 don't close database yet, keep open for 900 seconds
deconz    | 22:32:40:033 Current channel 11
deconz    | 22:32:40:043 Device TTL 4336 s flags: 0x7
deconz    | 22:32:47:608 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0702
deconz    | 22:32:47:608 skip configure report for cluster: 0x0702 attr: 0x0000 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:47:609 skip configure report for cluster: 0x0702 attr: 0x0400 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:49:603 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0B04
deconz    | 22:32:49:603 skip configure report for cluster: 0x0B04 attr: 0x050B of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:49:604 skip configure report for cluster: 0x0B04 attr: 0x0505 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:49:604 skip configure report for cluster: 0x0B04 attr: 0x0508 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:33:40:023 Current channel 11

I was able to repro this multiple times from fresh. I was also able to do the same doing a Sensor search instead of a light search in phoscon. In the case of the Sensor search, the modal that shows acknowledged that a sensor had been added (although they don't show in phoscon)

TLDR The only way I have been able to get the power and consumption sensors added for this device is to trigger a read of the attributes of the Basic cluster in the deconz GUI whilst doing a search for lights or sensors via phoscon

@SwoopX Anything i can do to help debug why these sensors don't just get added along with the device in the first place?

@mike182uk
Copy link

🤔 The consumption does not appear to work correctly for this device, the Current Summation Delivered attribute in the Simple Metering Cluster never seems to change (always set to 0, was expecting this value to increase with usage)

@SwoopX
Copy link
Collaborator

SwoopX commented Apr 28, 2020

I have a theory on what should be changed based on an extensive for another device persistently denying sensor creation. There might also another thing come into play... tldr.

The best option to support debugging and do testing would be to have a bare metal system where you compile my repo when I did the changes (pure deconz only, no HA or any other virtualization). If that's an option for you, happy to look into it again. I'd also need to verify that for another smart plug, which behaves really strage at times...

🤔 The consumption does not appear to work correctly for this device, the Current Summation Delivered attribute in the Simple Metering Cluster never seems to change (always set to 0, was expecting this value to increase with usage)

Sounds like the binding has failed (and polling has been explicitly disabled as I recall). Pluggin the device out and in again should probably do the trick.

@mike182uk
Copy link

The best option to support debugging and do testing would be to have a bare metal system where you compile my repo when I did the changes (pure deconz only, no HA or any other virtualization). If that's an option for you, happy to look into it again. I'd also need to verify that for another smart plug, which behaves really strage at times...

I can do that ✅ Would be great to get this plug working correctly!

Sounds like the binding has failed (and polling has been explicitly disabled as I recall). Pluggin the device out and in again should probably do the trick.

Unfortunately nothing changed when i did that. Is there somewhere I can view the bindings? Or manually create them? In the log output provided above, when the sensors are added there is some logging around the bindings:

deconz    | 22:31:18:116 discard double entry in binding queue (size: 2) for for 0x14B457FFFECBFCEB, cluster 0x0702
deconz    | 22:31:18:119 discard double entry in binding queue (size: 2) for for 0x14B457FFFECBFCEB, cluster 0x0B04
deconz    | 22:31:18:222 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0702
deconz    | 22:31:18:233 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0B04
deconz    | 22:32:47:608 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0702
deconz    | 22:32:47:608 skip configure report for cluster: 0x0702 attr: 0x0000 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:47:609 skip configure report for cluster: 0x0702 attr: 0x0400 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:49:603 Bind response success for 0x14b457fffecbfceb ep: 0x01 cluster: 0x0B04
deconz    | 22:32:49:603 skip configure report for cluster: 0x0B04 attr: 0x050B of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:49:604 skip configure report for cluster: 0x0B04 attr: 0x0505 of node 0x14B457FFFECBFCEB (seems to be active)
deconz    | 22:32:49:604 skip configure report for cluster: 0x0B04 attr: 0x0508 of node 0x14B457FFFECBFCEB (seems to be active)

@mike182uk
Copy link

Turns out Current Summation Delivered does appear to be working, just very slowly (took around an hour with a ~8w lamp for the value to increment by 1). I noticed on my other plug (Salus SP600) the Current Summation Delivered value incremented much quicker with the same load on it - I guess this is down to a difference in how the plugs report / record the data? (maybe the unit of measurement). Anyways, it appears to be doing something 😃

As for manually creating the bindings, this comment describes how to set them up in the deconz GUI

@SwoopX
Copy link
Collaborator

SwoopX commented May 8, 2020

Ah yes, totally forgot to come back on this. Too much stuff lying around here. The consumption goes in 10W steps (which is the smallest unit provided). So with an LED bulp, it takes quite some time. This is based on the divisors and multipliers.

@Mimiix
Copy link
Collaborator

Mimiix commented Jun 6, 2020

It seems this issue is resolved or otherwise inactive. If it is not, please re-open!

@hagih
Copy link

hagih commented Mar 21, 2022

I had a lot of trouble getting this device to work with deCONZ/Home Assistant but it finally seems to be reporting both the on/off state (switch entity) and the current power reading (sensor entity).

I had very little experience with deCONZ so it was difficult to understand how to debug it. The below information is simply recording what I found and what I think got it working assuming virtually no experience with deCONZ and may be helpful to others trying to get it working too.

When it's working, there should be one device in Home Assistant, showing both the control and sensor readings:
image

There will be two sensors in Home Assistant (one boolean for the on/off state and one integer for the current power draw):
image

Note that even when it's working, the Phoscon web interface only shows one device listed under lights. It never appeared under sensors for me and doesn't appear to need to:
image

I spent a while unpairing and repairing expecting a second device to appear in Phoscon (as seems to be suggested in some of the comments online) but that doesn't seem to be necessary.

I really didn't know exactly what I was doing so I will try to write down the steps that I took that I think made it work and will come back and update this comment if I get a better list of steps.

Prepare the device

  • Add the device using Phoscon (I used Sensors > Add new sensor, although it appeared under "Lights" anyway). It doesn't appear there is any trick required here, as suggested by some comments that you need to read data and then add a second device.
  • To prepare for the next steps, open the deCONZ main app and look for the newly appeared box. It'll probably be called "smart plug 1" or similar by default.
  • There will be two circle buttons next to it. Click the right most circleand a long list should appear.
    image

Check the model number

  • Click on Basic.
  • Make sure Cluster Info is selected from the tabs in the bottom left corner.
  • You can confirm the model number is being read here and matches the one being talked about here (ZB-ONOFFPlug-D0005) which is the 2019 UK variant of the Samsung SmartThings Power Meter.
    image

Check the power reading

  • Now in the same list where you found basic, click "Electrical Measurement".
  • Click read and then look for an entry called "Active Power" under AC.
  • If there is power being drawn from the socket, the number here will indicate the number of watts of the load.
    If this is working then it seems you're pretty close.

Report meter reading to Home Assistant
I was mostly guessing at this point and trying to follow another comment that was written in a way that was very difficult to understand, but I think this got it working:

  • Click Panels (menu at the top) > Bind Dropbox
  • A new tab appears in the bottom left corner, click on it (Bind Dropbox)
  • Drag the Electrical Measurement to the button on the left with the name "Source".
  • Now look for another box which may be named "Configuration tool 1" (a green line will likely be drawn from the smart plug to this other box) and click the right-most circle button on it.
  • image
  • For me, I dragged the "Power Configuration" entry to the Destination button, although maybe dragging the header would work just as well
  • Click the Bind button
  • image

At this point, restarting Home Assistant (Configuration > Settings > Home Assistant: Restart) got the second entity to appear and begin working.

Feel free to correct my steps if they are wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants