Stretch 2.0 commandline interface (PWScli)

Plugwise Forum about Plugwise devices and the Source software.
Post Reply
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

PWScli.jpg
PWScli.jpg (54.75 KiB) Viewed 18420 times
Here is a program where you can switch your PlugWise circles from the commandline, this way you don't need complicated programmer knowledge and can use this program from a "shell" command. (think of Excel, PHP Script, Homeseer)

Download: http://domoticx.nl/plugwise-stretch-2-0 ... interface/

Tested and working on:
– Windows XP 32-bit
– Windows Vista/7/8 32/64-bit

* Does not work on Windows 95 / 98 / ME due to unicode compile.
* Does not work on Windows Server 2000 (crash)

The commandline usage of this program is: PWScli.exe switch [stretchIP] [stretchID] [applianceID/CircleName] [on/off]

[stretchIP] = The IP adres of the Stretch 2.0
[stretchID] = The Stretch 2.0 ID code (8 letters)
[applianceID/CircleName] = The 32 characters of the ApplianceID or the name of the circle
[on/off] = Switch the circle on or off

SWITCH EXAMPLES:
PWScli.exe switch 192.168.1.101 abcdefgh 71abf031c54f400ca77c8ae6957ad7cf on > Switch a circle with the proper applianceID on, via the Stretch 2.0 on IP adres 192.168.1.101
PWScli.exe switch 192.168.1.101 abcdefgh livingroom off > Switch the circle named "livingroom" off, via the Stretch 2.0 on IP adres 192.168.1.101
PWScli_01.png
PWScli_01.png (16.34 KiB) Viewed 18420 times
PWScli.exe applist [show/txt/ini] 192.168.1.101 abcdefgh > Show's or exports a list with the names and applianceID's of connected circles to a txt or ini file
PWScli_02.png
PWScli_02.png (17.82 KiB) Viewed 18420 times
INI export example:

Code: Select all

[7adf2ef4b16b41ffad98eb9d]
name=keuken
state=off
power=0
[71abf031c54f400ca77c8ae6]
name=keukentafel
state=off
power=0
[2ef525453c764b2db87061ad]
name=logeerkamer
state=off
power=0
CHANGELOG:
v2.1 (2013-10-17)
- Solved a bug getting the proper power consumption of the circles.
- It's now also possible to switch plugs "namebased".

v2.0 (2013-10-10)
- Program adjusted for stretch 2.0 with firmware 2.0.x
- Note: This version is not compatible for a stretch with firmware 1.0.x

v1.2 (2013-05-05)
- ApplianceID and StetchID are case sensitive, now the input always get converted to lowercase!
- Checks added for the applist function.
- Build in applist extended with status en power data.
- Dump of ApplianceID's, status and power possible to txt or ini file!

v1.1 (2013-05-04)
- True CLi mode (no more messageboxes, all messages go to the prompt now)
- Build in mode to get a list of the names and appliance ID's.
- Shows status progress whenever switching a circle
- All converted to English.

NOTES:
For contact, improvements or ideas, you can contact me @ phoenixinteractive -at- hotmail -dot- com

DISCLAIMER:
* The usage of this program is at own risk!, the author cannot be held responsible for any damage to your hardware!
* Plugwise has got nothing with 'PWScli.exe' ,and will deny all responsibility.
* The PlugWise logo is and stay's the property of: http://www.plugwise.com
Last edited by Phoenix on Fri Dec 26, 2014 1:46 pm, edited 13 times in total.
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
jeroen_
Member
Member
Posts: 105
Joined: Mon Feb 11, 2013 4:02 pm
Location: Switzerland
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by jeroen_ »

Cool ;)
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

Thanks!, there will be an update soon -> PWScli v1.1 , i'll also convert everything to english!

Stay tuned!
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

Updated to 1.1 (2013-05-04):
- True CLi mode (no more messageboxes, all messages go to the prompt now)
- Build in mode to get a list of the names and appliance ID's.
- Shows status progress whenever switching a circle
- All converted to English.
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

Updated to v1.2 (2013-05-05)
- ApplianceID and StetchID are case sensitive, now the input always get converted to lowercase!
- Checks added for the applist function.
- Build in applist extended with status en power data.
- Dump of ApplianceID's, status and power possible to txt or ini file!
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Bwired »

great job you are doing with the Stretch
I got one Stretch myself because i want to get rid of my USB dipstick

but i see now that the stretch gives less information then the USB Stick

info i get from usb in single call via source
you see also totalusage ever, totalusage today

not possible from the Stretch so it seems??

Code: Select all

  <id>47</id> 
- <device>
- <![CDATA[ Div1
  ]]> 
  </device>
  <devicetype>- Miscellaneous -</devicetype> 
  <locked>True</locked> 
  <realstate>on</realstate> 
  <powerstate>on</powerstate> 
  <powerusage>27.6</powerusage> 
  <totalusage>45.1465</totalusage> 
  <moduleid>71</moduleid> 
  <macaddr>000D6F0000B81199</macaddr> 
  <moduletype>Circle</moduletype> 
  <room>Attic</room> 
  <totalusagetoday>0.0888</totalusagetoday> 
  <isonline>True</isonline> 
  <lastseendate>2013-10-07 21:10:35</lastseendate> 
  <lastseenseconds>136</lastseenseconds> 
  <firstseendate>2012-11-25 12:37:54</firstseendate> 
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

Hi bwired,

In the new stretch 2.0.x firmware, you can also see lot's of data including comulative logs etc...this is the data of one circle:

Code: Select all

<appliances>
<appliance id="750a4e07ed8840528f8ceb5c313eff3d">
<name>Keukenaqua</name>
<description/>
<type>zz_misc</type>
<created_date>2013-06-28T17:36:54.479+02:00</created_date>
<modified_date>2013-10-07T22:40:02.579+02:00</modified_date>
<deleted_date/>
<services>
<electricity_interval_meter id="55967b5e5a394b51ae6821e04c8a15d4"/>
<electricity_point_meter id="5ee942a3e836424c88f5af9be73b3165"/>
<relay id="20f4d271299e4f0684a3983b858b5b20"/>
</services>
<logs>
<interval_log id="f3d44ea40bda4df89d34009e33f85a75">
<updated_date>2013-10-07T22:40:02.579+02:00</updated_date>
<type>electricity_produced</type>
<unit>Wh</unit>
<last_consecutive_log_date>2013-10-07T21:00:00+02:00</last_consecutive_log_date>
<interval>PT1H</interval>
<period start_date="2013-10-07T22:00:00+02:00" end_date="2013-10-07T22:40:02.579+02:00" interval="PT1H">
<measurement log_date="2013-10-07T22:00:00+02:00">0.00</measurement>
</period>
</interval_log>
<point_log id="65573f1097bf4a3b9cc14169fbd160a8">
<updated_date>2013-10-07T22:40:02.549+02:00</updated_date>
<type>electricity_consumed</type>
<unit>W</unit>
<last_consecutive_log_date>2013-10-07T18:06:25.739+02:00</last_consecutive_log_date>
<period start_date="2013-10-07T22:40:02.549+02:00" end_date="2013-10-07T22:40:02.549+02:00">
<measurement log_date="2013-10-07T22:40:02.549+02:00">0.00</measurement>
</period>
</point_log>
<point_log id="4bf1281102cc4fbbaf708770cc3a7d54">
<updated_date>2013-10-07T22:39:27.309+02:00</updated_date>
<type>relay</type>
<unit/>
<last_consecutive_log_date>2013-10-07T20:33:07.552+02:00</last_consecutive_log_date>
<period start_date="2013-10-07T22:39:27.309+02:00" end_date="2013-10-07T22:39:27.309+02:00">
<measurement log_date="2013-10-07T22:39:27.309+02:00">on</measurement>
</period>
</point_log>
<interval_log id="147b8e2a5c3b425ea3f15805e09bca26">
<updated_date>2013-10-07T22:40:02.565+02:00</updated_date>
<type>electricity_consumed</type>
<unit>Wh</unit>
<last_consecutive_log_date>2013-10-07T21:00:00+02:00</last_consecutive_log_date>
<interval>PT1H</interval>
<period start_date="2013-10-07T22:00:00+02:00" end_date="2013-10-07T22:40:02.565+02:00" interval="PT1H">
<measurement log_date="2013-10-07T22:00:00+02:00">0.00</measurement>
</period>
</interval_log>
<point_log id="4ccb216a253d492bb39ebd02eb74d5f2">
<updated_date>2013-10-07T22:40:02.549+02:00</updated_date>
<type>electricity_produced</type>
<unit>W</unit>
<last_consecutive_log_date>2013-10-07T18:06:25.739+02:00</last_consecutive_log_date>
<period start_date="2013-10-07T22:40:02.549+02:00" end_date="2013-10-07T22:40:02.549+02:00">
<measurement log_date="2013-10-07T22:40:02.549+02:00">0.00</measurement>
</period>
</point_log>
</logs>
<actuators>
<relay id="87aad1fbb6ea4737b59934eef548dd0d">
<updated_date>2013-10-07T22:39:27.313+02:00</updated_date>
<state>on</state>
<lock>false</lock>
</relay>
</actuators>
</appliance>
</appliances>
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
User avatar
RdP
Advanced Member
Advanced Member
Posts: 989
Joined: Thu May 04, 2006 10:14 am
Location: Netherlands

Re: Stretch 2.0 commandline interface (PWScli)

Post by RdP »

I use the 2.x Stretch firmware for a couple of weeks now. It has been a huge improvement, but the functionality is still not comparable to the Source. PlugWise is positioning the 2 products for different groups of interest and not as the Stretch will be a replacement product for the Source, however since the latest improvements the gap has become less than before.

/Rien
Rien
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Bwired »

the new source will also support the stretch later..
but NO total- and day usage is a big miss!

updating firmware stretch now
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

New version of PWScli released for Stretch 2.0 with firmware 2.0.x!

v2.0 (2013-10-10)
- Program adjusted for stretch 2.0 with firmware 2.0.x
- Note: This version is not compatible for a stretch with firmware 1.0.x

Screen:
pwscli_2.0_screen.png
pwscli_2.0_screen.png (23.03 KiB) Viewed 18386 times
Enjoy!
Last edited by Phoenix on Fri Oct 11, 2013 12:11 am, edited 1 time in total.
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
User avatar
RdP
Advanced Member
Advanced Member
Posts: 989
Joined: Thu May 04, 2006 10:14 am
Location: Netherlands

Re: Stretch 2.0 commandline interface (PWScli)

Post by RdP »

Nice...

Thx Sebastiaan

PS net weer een update beschikbaar gekomen. Ik draai nu 2.0.16.

Gr,
Rien
Rien
Phoenix
Starting Member
Starting Member
Posts: 48
Joined: Sun Apr 28, 2013 9:40 pm
Location: Netherlands (Deventer)
Contact:

Re: Stretch 2.0 commandline interface (PWScli)

Post by Phoenix »

v2.1 (2013-10-17)
- Solved a bug getting the proper power consumption of the circles.
- It's now also possible to switch plugs "namebased".
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
Post Reply

Return to “Plugwise Forum”