Handling HNAP - DLink DSP-W215 example

Python and python framework

Moderator: leecollings

tkald
Posts: 8
Joined: Friday 01 January 2016 12:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald »

My Python skills are very limited :-) Maybe author could fix it better :-)
Dnpwwo wrote:
tkald
Posts: 8
Joined: Friday 01 January 2016 12:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald »

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 3916 times
plugin.py.zip
plugin
(3.34 KiB) Downloaded 190 times
Update 2:
I can read a Temp values :-) in testing.
w215 - switch power temp
w215 - switch power temp
dlink_w215.png (44.25 KiB) Viewed 3903 times
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by Dnpwwo »

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 247 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: 2
Joined: Tuesday 15 August 2017 15:10
Target OS: -
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by dennisb1 »

@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: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by Dnpwwo »

@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: 5
Joined: Tuesday 01 November 2016 9:20
Target OS: Linux
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by device33 »

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: 5
Joined: Tuesday 01 November 2016 9:20
Target OS: Linux
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by device33 »

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: 8
Joined: Friday 01 January 2016 12:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald »

Small preview with temp and kWh, still testing :-)
IMG_0014.PNG
IMG_0014.PNG (103.87 KiB) Viewed 3745 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 / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by RvD »

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 / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by transistorGL »

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
device33
Posts: 5
Joined: Tuesday 01 November 2016 9:20
Target OS: Linux
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by device33 »

Would you mind sharing the kWh script?
vizion88
Posts: 3
Joined: Sunday 12 March 2017 13:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by vizion88 »

Hi all,

Bought myself such a DSP-W215 and hooked it up in my WiFi. Now I copied the examplecode from the examples folder to the plugins directory. Tried to find my DSP-W215 in the hardware list but nothing there. What am I missing out here? I'm running the stable release version 3.8153

Thanks!


I got it working now, for future reference my actions:
  • Get your DSP-W215 set up in your local network
  • Create a directory with name DSP-W215 in /home/pi/domoticz/plugins/ with permissions set to 775 (chmod 775 DSP-W215)
  • Copy the example from /home/pi/domoticz/plugins/examples/Dlink DSP-W215.py to your newly created folder with name plugin.py
  • Restart domoticz service with sudo service domoticz.sh restart
  • Find the device in your hardware list
Hope it helps!
tkald
Posts: 8
Joined: Friday 01 January 2016 12:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald »

vizion88 wrote:Saturday 04 November 2017 22:35 Did you finish the script including kWh already? Would be so nice to have it!

All the best,
Ben
device33 wrote: Monday 30 October 2017 12:11 Would you mind sharing the kWh script?
Script:
plugin.py.zip
(3.52 KiB) Downloaded 242 times
vizion88
Posts: 3
Joined: Sunday 12 March 2017 13:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by vizion88 »

tkald wrote: Sunday 05 November 2017 7:25
Script: plugin.py.zip
No success, domoticz crashes when I use your Plugin.py. I've attached the logfile :)
Attachments
log.txt
(11.65 KiB) Downloaded 132 times
tkald
Posts: 8
Joined: Friday 01 January 2016 12:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by tkald »

vizion88 wrote: Sunday 05 November 2017 19:45
tkald wrote: Sunday 05 November 2017 7:25
Script: plugin.py.zip
No success, domoticz crashes when I use your Plugin.py. I've attached the logfile :)
Sorry, i cant help with this. I tested a plugin with fresh beta release on rpi and works fine. Try complete reboot.
art4me
Posts: 7
Joined: Tuesday 12 December 2017 10:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10264
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by art4me »

Hello, I'm trying to install the plugin but something very strange is happening.

My Domoticz version is 3.8775 (beta release). I install the plugin inside domoticz/plugins/DSP-W215 and set file permission to 775.
then I restart domoticz service, I open Hardware page and add the hardware from the list (it appears correctly). Then I go to Devices and Domoticz crashes (Offline). To fix the problem I need to move the plugin out from the plugins folder, else Domoticz remains offline.

The log error gives me this:

Code: Select all

2017-12-08 13:07:00.124 Error: (DSP-W215) failed to load 'plugin.py', Python Path used was ':/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2017-12-08 13:07:00.124 Error: (Dlink) Module Import failed, exception: 'ImportError'
2017-12-08 13:07:00.124 Error: (Dlink) Module Import failed: ' Name: plugin'
2017-12-08 13:07:00.125 Error: (Dlink) Error Line details not available.
2017-12-08 13:08:00.785 Error: Dlink hardware (12) thread seems to have ended unexpectedly
I tried to see if it was a Python version that needs to be update but it's the last version.
Suggestions?

UPDATE
I found out that HNAP1 protocol has problems (that's why the Error: Module Import failed.
I tried to access to the XML file on my smart plug (http://smartplugip/HNAP1/) but it looks empty.
So I tried to understand where the problem could be and found out that the SOAP Action link is broken: http://purenetworks.com/HNAP1/

Somebody can help me in this? Maybe D-Link decided not to provide this protocol anymore? I read that it has many bad comment because of vulnerability.
Tangred
Posts: 1
Joined: Saturday 03 March 2018 13:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by Tangred »

Hello,

I had the same error as first dezde29 error (181 291) and i replaced my script by the one given there https://github.com/domoticz/domoticz/bl ... SP-W215.py.

i got this error

2018-03-03 14:29:10.968 (Test3) Calling message handler 'onHeartbeat'.
2018-03-03 14:29:10.968 (Test3) onHeartbeat called
2018-03-03 14:29:18.940 (Test3) Calling message handler 'onHeartbeat'.
2018-03-03 14:29:18.940 (Test3) onHeartbeat called
2018-03-03 14:29:20.194 PluginSystem: Restarting I/O service thread.
2018-03-03 14:29:20.194 (Test3) Calling message handler 'onDisconnect'.
2018-03-03 14:29:20.195 (Test3) Device has disconnected
2018-03-03 14:29:20.195 (Test3) Transport set to: 'TCP/IP', 192.168.1.30:80.
2018-03-03 14:29:20.196 (Test3) Connect directive received, action initiated successfully.
2018-03-03 14:29:20.297 (Test3) Calling message handler 'onConnect'.
2018-03-03 14:29:20.297 (Test3) Smart plug connected successfully.
2018-03-03 14:29:20.297 (Test3) Sending 674 bytes of data:.
2018-03-03 14:29:20.298 (Test3) 50 4f 53 54 20 2f 48 4e 41 50 31 2f 20 48 54 54 50 2f 31 2e POST./HNAP1/.HTTP/1.
2018-03-03 14:29:20.298 (Test3) 31 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 1..Content-Type:.tex
2018-03-03 14:29:20.298 (Test3) 74 2f 78 6d 6c 3b 20 63 68 61 72 73 65 74 3d 75 74 66 2d 38 t/xml;.charset=utf-8
2018-03-03 14:29:20.298 (Test3) 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 36 38 2e 31 2e 33 30 ..Host:.192.168.1.30
2018-03-03 14:29:20.298 (Test3) 3a 38 30 0d 0a 41 63 63 65 70 74 3a 20 43 6f 6e 74 65 6e 74 :80..Accept:.Content
2018-03-03 14:29:20.299 (Test3) 2d 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 -Type:.text/html;.ch
2018-03-03 14:29:20.299 (Test3) 61 72 73 65 74 3d 55 54 46 2d 38 0d 0a 43 6f 6e 74 65 6e 74 arset=UTF-8..Content
2018-03-03 14:29:20.299 (Test3) 2d 4c 65 6e 67 74 68 3a 20 34 31 37 0d 0a 43 6f 6e 6e 65 63 -Length:.417..Connec
2018-03-03 14:29:20.299 (Test3) 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 53 4f tion:.keep-alive..SO
2018-03-03 14:29:20.299 (Test3) 41 50 41 63 74 69 6f 6e 3a 20 22 68 74 74 70 3a 2f 2f 70 75 APAction:."http://pu
2018-03-03 14:29:20.300 (Test3) 72 65 6e 65 74 77 6f 72 6b 73 2e 63 6f 6d 2f 48 4e 41 50 31 renetworks.com/HNAP1
2018-03-03 14:29:20.300 (Test3) 2f 4c 6f 67 69 6e 22 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a /Login"..User-Agent:
2018-03-03 14:29:20.300 (Test3) 20 44 6f 6d 6f 74 69 63 7a 2f 31 2e 30 0d 0a 0d 0a 3c 3f 78 .Domoticz/1.0....
2018-03-03 14:29:20.300 (Test3) 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 ml.version="1.0".enc
2018-03-03 14:29:20.300 (Test3) 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 3c 73 6f 61 70 oding="utf-8"?>
2018-03-03 14:29:20.300 (Test3) 3a 45 6e 76 65 6c 6f 70 65 20 78 6d 6c 6e 73 3a 78 73 69 3d :Envelope.xmlns:xsi=
2018-03-03 14:29:20.300 (Test3) 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 "http://www.w3.org/2
2018-03-03 14:29:20.301 (Test3) 30 30 31 2f 58 4d 4c 53 63 68 65 6d 61 2d 69 6e 73 74 61 6e 001/XMLSchema-instan
2018-03-03 14:29:20.301 (Test3) 63 65 22 20 78 6d 6c 6e 73 3a 78 73 64 3d 22 68 74 74 70 3a ce".xmlns:xsd="http:
2018-03-03 14:29:20.301 (Test3) 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31 2f 58 4d //www.w3.org/2001/XM
2018-03-03 14:29:20.301 (Test3) 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 73 6f 61 70 3d LSchema".xmlns:soap=
2018-03-03 14:29:20.301 (Test3) 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 6d 6c 73 "http://schemas.xmls
2018-03-03 14:29:20.301 (Test3) 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e 76 65 6c 6f 70 oap.org/soap/envelop
2018-03-03 14:29:20.302 (Test3) 65 2f 22 3e 3c 73 6f 61 70 3a 42 6f 64 79 3e 3c 4c 6f 67 69 e/">
2018-03-03 14:29:20.302 (Test3) 6e 20 78 6d 6c 6e 73 3d 22 68 74 74 70 3a 2f 2f 70 75 72 65 n.xmlns="http://pure
2018-03-03 14:29:20.302 (Test3) 6e 65 74 77 6f 72 6b 73 2e 63 6f 6d 2f 48 4e 41 50 31 2f 22 networks.com/HNAP1/"
2018-03-03 14:29:20.302 (Test3) 3e 3c 41 63 74 69 6f 6e 3e 72 65 71 75 65 73 74 3c 2f 41 63 >request
2018-03-03 14:29:20.302 (Test3) 74 69 6f 6e 3e 3c 55 73 65 72 6e 61 6d 65 3e 63 68 75 6e 67 tion>
2018-03-03 14:29:20.303 (Test3) 2e 66 61 62 69 65 6e 40 67 6d 61 69 6c 2e 63 6f 6d 3c 2f 55 .f
2018-03-03 14:29:20.303 (Test3) 73 65 72 6e 61 6d 65 3e 3c 4c 6f 67 69 6e 50 61 73 73 77 6f sername>
2018-03-03 14:29:20.303 (Test3) 72 64 3e 3c 2f 4c 6f 67 69 6e 50 61 73 73 77 6f 72 64 3e 3c rd><
2018-03-03 14:29:20.303 (Test3) 43 61 70 74 63 68 61 3e 3c 2f 43 61 70 74 63 68 61 3e 3c 2f Captcha></
2018-03-03 14:29:20.303 (Test3) 4c 6f 67 69 6e 3e 3c 2f 73 6f 61 70 3a 42 6f 64 79 3e 3c 2f Login></
2018-03-03 14:29:20.303 (Test3) 73 6f 61 70 3a 45 6e 76 65 6c 6f 70 65 3e .. .. .. .. .. .. soap:Envelope>
2018-03-03 14:29:26.941 (Test3) Calling message handler 'onHeartbeat'.
2018-03-03 14:29:26.941 (Test3) onHeartbeat called
2018-03-03 14:29:31.713 (Test3) 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 73 6f 61 70 3d LSchema".xmlns:soap=
2018-03-03 14:29:31.713 (Test3) 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 6d 6c 73 "http://schemas.xmls
2018-03-03 14:29:31.713 (Test3) 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e 76 65 6c 6f 70 oap.org/soap/envelop
2018-03-03 14:29:31.713 (Test3) 65 2f 22 3e 3c 73 6f 61 70 3a 42 6f 64 79 3e 3c 4c 6f 67 69 e/">
2018-03-03 14:29:31.714 (Test3) 6e 20 78 6d 6c 6e 73 3d 22 68 74 74 70 3a 2f 2f 70 75 72 65 n.xmlns="http://pure
2018-03-03 14:29:31.714 (Test3) 6e 65 74 77 6f 72 6b 73 2e 63 6f 6d 2f 48 4e 41 50 31 2f 22 networks.com/HNAP1/"
2018-03-03 14:29:31.714 (Test3) 3e 3c 41 63 74 69 6f 6e 3e 72 65 71 75 65 73 74 3c 2f 41 63 >request
2018-03-03 14:29:31.714 (Test3) 74 69 6f 6e 3e 3c 55 73 65 72 6e 61 6d 65 3e 63 68 75 6e 67 tion>ch
2018-03-03 14:29:31.715 (Test3) 2e 66 61 62 69 65 6e 40 67 6d 61 69 6c 2e 63 6f 6d 3c 2f 55 .com
2018-03-03 14:29:31.715 (Test3) 73 65 72 6e 61 6d 65 3e 3c 4c 6f 67 69 6e 50 61 73 73 77 6f sername>
2018-03-03 14:29:31.715 (Test3) 72 64 3e 3c 2f 4c 6f 67 69 6e 50 61 73 73 77 6f 72 64 3e 3c rd><
2018-03-03 14:29:31.715 (Test3) 43 61 70 74 63 68 61 3e 3c 2f 43 61 70 74 63 68 61 3e 3c 2f Captcha></
2018-03-03 14:29:31.715 (Test3) 4c 6f 67 69 6e 3e 3c 2f 73 6f 61 70 3a 42 6f 64 79 3e 3c 2f Login></
2018-03-03 14:29:31.715 (Test3) 73 6f 61 70 3a 45 6e 76 65 6c 6f 70 65 3e .. .. .. .. .. .. soap:Envelope>
2018-03-03 14:29:31.867 (Test3) Received 458 bytes of data:.
2018-03-03 14:29:31.867 (Test3) 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20
2018-03-03 14:29:31.867 (Test3) 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 3f 3e 3c 73 encoding="UTF-8"?>
2018-03-03 14:29:31.867 (Test3) 6f 61 70 3a 45 6e 76 65 6c 6f 70 65 20 78 6d 6c 6e 73 3a 78 oap:Envelope.xmlns:x
2018-03-03 14:29:31.867 (Test3) 73 69 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 si="http://www.w3.or
2018-03-03 14:29:31.867 (Test3) 67 2f 32 30 30 31 2f 58 4d 4c 53 63 68 65 6d 61 2d 69 6e 73 g/2001/XMLSchema-ins
2018-03-03 14:29:31.868 (Test3) 74 61 6e 63 65 22 20 78 6d 6c 6e 73 3a 78 73 64 3d 22 68 74 tance".xmlns:xsd="ht
2018-03-03 14:29:31.868 (Test3) 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31 tp://www.w3.org/2001
2018-03-03 14:29:31.868 (Test3) 2f 58 4d 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 73 6f /XMLSchema".xmlns:so
2018-03-03 14:29:31.868 (Test3) 61 70 3d 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 ap="http://schemas.x
2018-03-03 14:29:31.868 (Test3) 6d 6c 73 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e 76 65 mlsoap.org/soap/enve
2018-03-03 14:29:31.868 (Test3) 6c 6f 70 65 2f 22 3e 3c 73 6f 61 70 3a 42 6f 64 79 3e 3c 4c lope/">
2018-03-03 14:29:31.869 (Test3) 6f 67 69 6e 52 65 73 70 6f 6e 73 65 20 78 6d 6c 6e 73 3d 22 oginResponse.xmlns="
2018-03-03 14:29:31.869 (Test3) 68 74 74 70 3a 2f 2f 70 75 72 65 6e 65 74 77 6f 72 6b 73 2e http://purenetworks.
2018-03-03 14:29:31.869 (Test3) 63 6f 6d 2f 48 4e 41 50 31 2f 22 3e 3c 4c 6f 67 69 6e 52 65 com/HNAP1/">
2018-03-03 14:29:31.869 (Test3) 73 75 6c 74 3e 4f 4b 3c 2f 4c 6f 67 69 6e 52 65 73 75 6c 74 sult>OK
2018-03-03 14:29:31.869 (Test3) 3e 3c 43 68 61 6c 6c 65 6e 67 65 3e 50 70 4b 37 59 6c 58 52 >PpK7YlXR
2018-03-03 14:29:31.870 (Test3) 63 45 6d 45 69 42 63 70 67 6c 37 43 3c 2f 43 68 61 6c 6c 65 cEmEiBcpgl7C
2018-03-03 14:29:31.870 (Test3) 6e 67 65 3e 3c 43 6f 6f 6b 69 65 3e 6f 46 32 66 55 35 45 7a nge>oF2fU5Ez
2018-03-03 14:29:31.870 (Test3) 41 62 3c 2f 43 6f 6f 6b 69 65 3e 3c 50 75 62 6c 69 63 4b 65 Ab
2018-03-03 14:29:31.870 (Test3) 79 3e 33 78 43 59 73 35 55 47 65 70 45 48 6f 49 66 36 57 6a y>3xCYs5UGepEHoIf6Wj
2018-03-03 14:29:31.870 (Test3) 79 39 3c 2f 50 75 62 6c 69 63 4b 65 79 3e 3c 2f 4c 6f 67 69 y9
2018-03-03 14:29:31.870 (Test3) 6e 52 65 73 70 6f 6e 73 65 3e 3c 2f 73 6f 61 70 3a 42 6f 64 nResponse>
2018-03-03 14:29:31.871 (Test3) 79 3e 3c 2f 73 6f 61 70 3a 45 6e 76 65 6c 6f 70 65 3e .. .. y>
2018-03-03 14:29:31.871 (Test3) Calling message handler 'onMessage'.
2018-03-03 14:29:31.871 (Test3) Good Response received for 'GetAuth'.
2018-03-03 14:29:31.874 (Test3) Sending 687 bytes of data:.
2018-03-03 14:29:31.874 (Test3) 50 4f 53 54 20 2f 48 4e 41 50 31 2f 20 48 54 54 50 2f 31 2e POST./HNAP1/.HTTP/1.
2018-03-03 14:29:31.874 (Test3) 31 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 1..Content-Type:.tex
2018-03-03 14:29:31.874 (Test3) 74 2f 78 6d 6c 3b 20 63 68 61 72 73 65 74 3d 75 74 66 2d 38 t/xml;.charset=utf-8
2018-03-03 14:29:31.874 (Test3) 0d 0a 43 6f 6f 6b 69 65 3a 20 75 69 64 3d 6f 46 32 66 55 35 ..Cookie:.uid=oF2fU5
2018-03-03 14:29:31.875 (Test3) 45 7a 41 62 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 36 38 2e EzAb..Host:.192.168.
2018-03-03 14:29:31.875 (Test3) 31 2e 33 30 3a 38 30 0d 0a 41 63 63 65 70 74 3a 20 43 6f 6e 1.30:80..Accept:.Con
2018-03-03 14:29:31.875 (Test3) 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c tent-Type:.text/html
2018-03-03 14:29:31.875 (Test3) 3b 20 63 68 61 72 73 65 74 3d 55 54 46 2d 38 0d 0a 43 6f 6e ;.charset=UTF-8..Con
2018-03-03 14:29:31.875 (Test3) 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 34 33 30 0d 0a 53 4f tent-Length:.430..SO
2018-03-03 14:29:31.875 (Test3) 41 50 41 63 74 69 6f 6e 3a 20 22 68 74 74 70 3a 2f 2f 70 75 APAction:."http://pu
2018-03-03 14:29:31.876 (Test3) 72 65 6e 65 74 77 6f 72 6b 73 2e 63 6f 6d 2f 48 4e 41 50 31 renetworks.com/HNAP1
2018-03-03 14:29:31.876 (Test3) 2f 4c 6f 67 69 6e 22 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a /Login"..User-Agent:
2018-03-03 14:29:31.876 (Test3) 20 44 6f 6d 6f 74 69 63 7a 2f 31 2e 30 0d 0a 0d 0a 3c 3f 78 .Domoticz/1.0....
2018-03-03 14:29:31.876 (Test3) 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 ml.version="1.0".enc
2018-03-03 14:29:31.876 (Test3) 6f 64 69 6e 67 3d 22 75 74 66 2d 38 22 3f 3e 3c 73 6f 61 70 oding="utf-8"?>
2018-03-03 14:29:31.876 (Test3) 3a 45 6e 76 65 6c 6f 70 65 20 78 6d 6c 6e 73 3a 78 73 69 3d :Envelope.xmlns:xsi=
2018-03-03 14:29:31.877 (Test3) 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 "http://www.w3.org/2
2018-03-03 14:29:31.877 (Test3) 30 30 31 2f 58 4d 4c 53 63 68 65 6d 61 2d 69 6e 73 74 61 6e 001/XMLSchema-instan
2018-03-03 14:29:31.877 (Test3) 63 65 22 20 78 6d 6c 6e 73 3a 78 73 64 3d 22 68 74 74 70 3a ce".xmlns:xsd="http:
2018-03-03 14:29:31.877 (Test3) 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31 2f 58 4d //www.w3.org/2001/XM
2018-03-03 14:29:31.877 (Test3) 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 73 6f 61 70 3d LSchema".xmlns:soap=
2018-03-03 14:29:31.877 (Test3) 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 6d 6c 73 "http://schemas.xmls
2018-03-03 14:29:31.878 (Test3) 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e 76 65 6c 6f 70 oap.org/soap/envelop
2018-03-03 14:29:31.878 (Test3) 65 2f 22 3e 3c 73 6f 61 70 3a 42 6f 64 79 3e 3c 4c 6f 67 69 e/">
2018-03-03 14:29:31.878 (Test3) 6e 20 78 6d 6c 6e 73 3d 22 68 74 74 70 3a 2f 2f 70 75 72 65 n.xmlns="http://pure
2018-03-03 14:29:31.878 (Test3) 6e 65 74 77 6f 72 6b 73 2e 63 6f 6d 2f 48 4e 41 50 31 2f 22 networks.com/HNAP1/"
2018-03-03 14:29:31.878 (Test3) 3e 3c 41 63 74 69 6f 6e 3e 6c 6f 67 69 6e 3c 2f 41 63 74 69 >login
2018-03-03 14:29:31.878 (Test3) 6f 6e 3e 3c 55 73 65 72 6e 61 6d 65 3e 41 64 6d 69 6e 3c 2f on>Admin</
2018-03-03 14:29:31.879 (Test3) 55 73 65 72 6e 61 6d 65 3e 3c 4c 6f 67 69 6e 50 61 73 73 77 Username>
2018-03-03 14:29:31.879 (Test3) 6f 72 64 3e 39 34 46 31 34 35 32 46 37 43 34 37 46 30 44 43 ord>94F1452F7C47F0DC
2018-03-03 14:29:31.879 (Test3) 38 38 36 32 42 42 36 35 37 34 37 31 39 39 42 46 3c 2f 4c 6f 8862BB65747199BF
2018-03-03 14:29:31.879 (Test3) 67 69 6e 50 61 73 73 77 6f 72 64 3e 3c 43 61 70 74 63 68 61 ginPassword>
2018-03-03 14:29:31.879 (Test3) 3e 3c 2f 43 61 70 74 63 68 61 3e 3c 2f 4c 6f 67 69 6e 3e 3c ><
2018-03-03 14:29:31.879 (Test3) 2f 73 6f 61 70 3a 42 6f 64 79 3e 3c 2f 73 6f 61 70 3a 45 6e /soap:Body>
2018-03-03 14:29:31.879 (Test3) 76 65 6c 6f 70 65 3e .. .. .. .. .. .. .. .. .. .. .. .. .. velope>
2018-03-03 14:29:31.981 (Test3) Received 349 bytes of data:.
2018-03-03 14:29:31.981 (Test3) 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20
2018-03-03 14:29:31.981 (Test3) 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 3f 3e 3c 73 encoding="UTF-8"?>
2018-03-03 14:29:31.981 (Test3) 6f 61 70 3a 45 6e 76 65 6c 6f 70 65 20 78 6d 6c 6e 73 3a 78 oap:Envelope.xmlns:x
2018-03-03 14:29:31.981 (Test3) 73 69 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 si="http://www.w3.or
2018-03-03 14:29:31.982 (Test3) 67 2f 32 30 30 31 2f 58 4d 4c 53 63 68 65 6d 61 2d 69 6e 73 g/2001/XMLSchema-ins
2018-03-03 14:29:31.982 (Test3) 74 61 6e 63 65 22 20 78 6d 6c 6e 73 3a 78 73 64 3d 22 68 74 tance".xmlns:xsd="ht
2018-03-03 14:29:31.982 (Test3) 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72 67 2f 32 30 30 31 tp://www.w3.org/2001
2018-03-03 14:29:31.982 (Test3) 2f 58 4d 4c 53 63 68 65 6d 61 22 20 78 6d 6c 6e 73 3a 73 6f /XMLSchema".xmlns:so
2018-03-03 14:29:31.982 (Test3) 61 70 3d 22 68 74 74 70 3a 2f 2f 73 63 68 65 6d 61 73 2e 78 ap="http://schemas.x
2018-03-03 14:29:31.983 (Test3) 6d 6c 73 6f 61 70 2e 6f 72 67 2f 73 6f 61 70 2f 65 6e 76 65 mlsoap.org/soap/enve
2018-03-03 14:29:31.983 (Test3) 6c 6f 70 65 2f 22 3e 3c 73 6f 61 70 3a 42 6f 64 79 3e 3c 4c lope/">
2018-03-03 14:29:31.983 (Test3) 6f 67 69 6e 52 65 73 70 6f 6e 73 65 20 78 6d 6c 6e 73 3d 22 oginResponse.xmlns="
2018-03-03 14:29:31.983 (Test3) 68 74 74 70 3a 2f 2f 70 75 72 65 6e 65 74 77 6f 72 6b 73 2e http://purenetworks.
2018-03-03 14:29:31.983 (Test3) 63 6f 6d 2f 48 4e 41 50 31 2f 22 3e 3c 4c 6f 67 69 6e 52 65 com/HNAP1/">
2018-03-03 14:29:31.983 (Test3) 73 75 6c 74 3e 66 61 69 6c 65 64 3c 2f 4c 6f 67 69 6e 52 65 sult>failed
2018-03-03 14:29:31.984 (Test3) 73 75 6c 74 3e 3c 2f 4c 6f 67 69 6e 52 65 73 70 6f 6e 73 65 sult>
2018-03-03 14:29:31.984 (Test3) 3e 3c 2f 73 6f 61 70 3a 42 6f 64 79 3e 3c 2f 73 6f 61 70 3a >
2018-03-03 14:29:31.984 (Test3) 45 6e 76 65 6c 6f 70 65 3e .. .. .. .. .. .. .. .. .. .. .. Envelope>
2018-03-03 14:29:31.984 (Test3) Calling message handler 'onMessage'.
2018-03-03 14:29:31.984 (Test3) Good Response received for 'Login'.
2018-03-03 14:31:48.011 Error: (Test3) Login failed, check username and password in Hardware page

Domotics 3.8153.

I have insert :
IP Address : the one given by my router
Port 80 (is that correct ?)
Username MyDlink Username (i deleted it in the logs shown )
Password MyDlink Password

Can you help me please?
mozo78
Posts: 22
Joined: Friday 09 June 2017 6:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by mozo78 »

Hi, I face the problem described above, but I can live with it. :) Is anyone use more than one dsp-w215? One is work, but the second is not.

2018-10-06 08:55:42.983 Error: (Iroda konnektor) 'onMessage' failed 'KeyError'.
2018-10-06 08:55:42.983 Error: (Iroda konnektor) ----> Line 280 in /home/pi/domoticz/plugins/Dlink DSPW-215/plugin.py, function onMessage
2018-10-06 08:55:42.983 Error: (Iroda konnektor) ----> Line 136 in /home/pi/domoticz/plugins/Dlink DSPW-215/plugin.py, function onMessage
2018-10-06 08:55:43.035 (Iroda konnektor) Device has disconnected
2018-10-06 08:55:43.289 (Iroda konnektor) Smart plug authentication successful.
2018-10-06 08:55:43.035 Error: (Iroda konnektor) 'onMessage' failed 'KeyError'.
2018-10-06 08:55:43.035 Error: (Iroda konnektor) ----> Line 280 in /home/pi/domoticz/plugins/Dlink DSPW-215/plugin.py, function onMessage
2018-10-06 08:55:43.035 Error: (Iroda konnektor) ----> Line 140 in /home/pi/domoticz/plugins/Dlink DSPW-215/plugin.py, function onMessage
mozo78
Posts: 22
Joined: Friday 09 June 2017 6:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by mozo78 »

I think the problem is the different HW version: the B1 version works, the B2 is not...
Lacman
Posts: 4
Joined: Sunday 27 February 2022 20:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Hungary
Contact:

Re: Handling HNAP - DLink DSP-W215 example

Post by Lacman »

tkald wrote: Sunday 05 November 2017 7:25
vizion88 wrote:Saturday 04 November 2017 22:35 Did you finish the script including kWh already? Would be so nice to have it!

All the best,
Ben
device33 wrote: Monday 30 October 2017 12:11 Would you mind sharing the kWh script?
Script: plugin.py.zip
Hello everyone,
I would like to chime in and just tell what works for me currently. Notes for whoever stumbles on this thread...
I am running the following Domoticz and Python version on Win 10 x64:

Version: 2022.1 (build 14205)
Build Hash: ee9cfcdcf
Compile Date: 2022-02-18 07:07:28
dzVents Version: 3.1.8
Python Version: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]

I downloaded the quoted plugin.py.zip, which contains the python script version 1.2.0 created by Dnpwwo.

And regarding the W215, the details are:
Firmware Internal Version: V2.24b01

I am really happy that it is working well, also in a sense that D-Link will pull the plug for MyDlink home services at the end of 2022:
https://www.mydlink.com/faq#id-topFAQ/ans-4242

Rgds,
Lacman
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest