Handling HNAP - DLink DSP-W215 example

Python and python framework
tkald
Posts: 14
Joined: Friday 01 January 2016 13:38
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald » Wednesday 09 August 2017 19:26

My Python skills are very limited :-) Maybe author could fix it better :-)
Dnpwwo wrote:

tkald
Posts: 14
Joined: Friday 01 January 2016 13:38
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald » Thursday 10 August 2017 16:46

mozo78 wrote:
Wednesday 09 August 2017 9:56
Big THX! It is working now. :) A previous version could log the temperature and power consumption as well. Have you got a solution for these values?
Hmm, I can read a data:
Ready: {'Data': b'OK2.50', 'Status': '200', 'Headers': {'Content-Length': '474', 'Server': 'lighttpd/1.4.34', 'Content-Type': 'text/xml; charset=utf-8', 'Date': 'Thu, 10 Aug 2017 14:43:58 GMT', 'Connection': 'keep-alive'}}

Power = 2.50 W
But, I don't know, how to parse value to domoticz device :-)

Update 1:
Make backup (plugin and DB), replace plugin, sudo chmod +x plugin.py, sudo service domoticz restart, add new hardware dlink w215
power.png
power.png (18.89 KiB) Viewed 546 times
plugin.py.zip
plugin
(3.34 KiB) Downloaded 29 times
Update 2:
I can read a Temp values :-) in testing.
dlink_w215.png
w215 - switch power temp
dlink_w215.png (44.25 KiB) Viewed 533 times

User avatar
Dnpwwo
Posts: 586
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by Dnpwwo » Thursday 10 August 2017 23:50

I don'y have one of these so I can't test it but I believe this should do the trick. I used @tkald s fix and added one more.

plugin.zip
(3.23 KiB) Downloaded 39 times
backup your old plugin.py file, drop this one in the same location, go to the Hardware page, select the device and hit 'Update' to reload it
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

dennisb1
Posts: 1
Joined: Tuesday 15 August 2017 15:10
Target OS: -
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by dennisb1 » Tuesday 15 August 2017 15:12

@Tkald, With your script the two devices for on/off and power usage is created but when the connection is made Domoticz will crash.

@Dnpowwo, With your script only the on/off device is created but the same crash is happening.

What is going on? With the file from examples i dont have a crash and its sort off stable but no power usage.

User avatar
Dnpwwo
Posts: 586
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by Dnpwwo » Thursday 17 August 2017 13:47

@dennisb1,

Can you turn on debug for the plugin and post the log?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

device33
Posts: 4
Joined: Tuesday 01 November 2016 10:20
Target OS: Linux
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by device33 » Friday 18 August 2017 21:32

Is it possible to change the socket 2 device to electric(instant+counter) to get the daily kwh usage and total kwh usage?

device33
Posts: 4
Joined: Tuesday 01 November 2016 10:20
Target OS: Linux
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by device33 » Friday 18 August 2017 21:38

I also have intermittent crashes,

heres the last lines before the crash.

Code: Select all

2017-08-18 21:33:43.841  (DSP_RIG4) Stop directive received.
2017-08-18 21:33:43.872  (DSP_RIG4) Disconnect directive received.
2017-08-18 21:33:43.872  (DSP_RIG4) Disconnect directive received.
2017-08-18 21:33:43.872  Error: Domoticz received fatal signal 6 !...
2017-08-18 21:33:43.874  Error:   /home/pi/domoticz/domoticz() [0x5d65e8]
2017-08-18 21:33:43.874  Error:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x50) [0x5d6690]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0) [0x7f41f90488d0]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f41f832f147]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f41f8330528]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libc.so.6(+0x73294) [0x7f41f836d294]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libc.so.6(+0x78a6e) [0x7f41f8372a6e]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libc.so.6(+0x79776) [0x7f41f8373776]
2017-08-18 21:33:43.874  Error:   /home/pi/domoticz/domoticz(_ZN7Plugins19CPluginTransportTCP16handleDisconnectEv+0x265) [0x901d25]
2017-08-18 21:33:43.874  Error:   /home/pi/domoticz/domoticz(_ZN7Plugins13CPluginSystem7Do_WorkEv+0x37c) [0x8fb70c]
2017-08-18 21:33:43.874  Error:   /home/pi/domoticz/domoticz() [0xa1889a]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4) [0x7f41f90410a4]
2017-08-18 21:33:43.874  Error:   /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f41f83e29cd]
I think it's related to when the DSP is offline and i try to make changes at the hardware tab in domoticz.

tkald
Posts: 14
Joined: Friday 01 January 2016 13:38
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald » Friday 25 August 2017 16:01

Small preview with temp and kWh, still testing :-)
IMG_0014.PNG
IMG_0014.PNG (103.87 KiB) Viewed 375 times
For kWh I used a custom sensor, I dont know how exactly used a defined 'kWh' device :-)

RvD
Posts: 8
Joined: Wednesday 15 October 2014 18:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by RvD » Monday 28 August 2017 19:36

Hello,

I also have two of these devices and would like to include them in Domoticz, so I'd like to thank you all for your hard work and I hope there'll be a stable version soon!

transistorGL
Posts: 1
Joined: Tuesday 19 September 2017 22:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by transistorGL » Tuesday 19 September 2017 23:09

hello everybody
I'm new to Domoticz....I just started tonight... and I have one of these dlink home plug
Where can I find a document on hot to setparameters inside domoticz and get the last working version of plugin.py
I can see the device in my list.. but I can't turn iton and off...
Do I have to be in the same lan ?
thanks for your help and sorry for my dummy question

Post Reply

Who is online

Users browsing this forum: assenzuid and 3 guests