Plugwise Stretch firmware 2.0.x urls

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:

Plugwise Stretch firmware 2.0.x urls

Post by Phoenix »

Found links and urls for PlugWise stretch 2.0 with firmware 2.0.x , the note's are in Dutch!

Apparaat/Module (appliance) gegevens:
http://192.168.X.X/core/modules (overzicht van aangesloten apparaten op het ZigBee netwerk (module niveau) vanuit de stretch)
http://192.168.X.X/core/modules;id=[MODULEID] (geeft de gegevens weer van 1 module (apparaat) in XML, [MODULEID] is het ID van de module)

http://192.168.X.X/core/appliances (overzicht van alle aangesloten apparaten op het ZigBee netwerk (appliance niveau), met alle gegevens die IN de apparaten staan)
http://192.168.X.X/core/appliances;id=[APPID] (geeft de gegevens weer van 1 module (apparaat) in XML, [APPID] is het ID van de appliance)
http://192.168.X.X/core/appliances/interval_logs (geeft een XML overzicht van het verbruik/opwek van de apparaten in het ZigBee netwerk)
http://192.168.X.X/core/appliances/interval_logs?type=electricity_consumed (geeft een XML overzicht weer, alleen van het verbruik van de apparaten in het ZigBee netwerk)
http://192.168.X.X/core/appliances/interval_logs?type=electricity_produced (geeft een XML overzicht weer, alleen van het opgewekte vermogen van de apparaten in het ZigBee netwerk)

http://192.168.X.X/core/rules (geeft motion sensors weer?)
http://192.168.X.X/core/groups (geeft een XML weer van de ingestelde (schakel) groepen, bijvoorbeeld icm de Scan)
http://192.168.X.X/core/networks (geeft een overzicht in XML weer van het ZigBee netwerk)

http://192.168.X.X/system (gateway, lan info, ssid, timezone)
http://192.168.X.X/system/beacon (stretch "baken")
http://192.168.X.X/system;@scan/wlan0 (wifi gegevens (lijst SSID's + signaalsterke))
http://192.168.x.x/system;@upgrade_check/gateway (gateway gegevens?)
http://192.168.x.x/system;@upgrade_download (upgrade downloaden)
http://192.168.x.x/system;@update_install (upgrade installeren)

http://192.168.X.X/portal/gateway (hardware gegevens)
http://192.168.X.X/portal/license (licentie gegevens)
http://192.168.X.X/portal/url_list (URL lijst met plugwise links)

Diagnostische gegevens:
http://192.168.X.X/diagnostic (geeft een log weer)
http://192.168.X.X/diagnostic/log (geeft een log weer)
http://192.168.X.X/diagnostic/log/nginx/error (geeft NGINX error log weer)
http://192.168.X.X/diagnostic/log/nginx/access (geeft NGINX toegangslog weer)
http://192.168.X.X/diagnostic/log/dmesg (geeft bootlog weer)
http://192.168.X.X/diagnostic/log/syslog (geeft systeem log weer)
http://192.168.X.X/diagnostic/report (geeft het totale diagnostische rapport weer)
Wordt wel data weergegeven, maar dit is geen XML (zoals op de smile)

Enjoy!
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: Plugwise Stretch firmware 2.0.x urls

Post by Phoenix »

If you have any other result or wish to commit some links, please reply and post! ;-)
You can always view the total "updated" list here: http://phoenixinteractive.mine.nu/websi ... ?f=27&t=42
Huisautomatisering - Domotica - Elektronica - IT consulting - Software ontwikkeling - 3D printing - Maatwerk
Website: domoticx.nl / Webshop: domoticx.nl/webwinkel / Knowledge Center: http://domoticx.com
brammh
Starting Member
Starting Member
Posts: 8
Joined: Thu Aug 30, 2012 10:49 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by brammh »

Hi all,
I thankfully!! use the Phoenix / Sebastiaans website (and this forum) as reference for the URI's that are supported with the stretch / smile.

Yesterday my stretch got updated, and my unfortunately my scripts and site collapsed.
I used this file to get the actual usage: http://192.168.X.X/minirest/appliances
In firmware 2.x this is gone, and logically Í need to use: http://192.168.X.X/core/appliances
unfortunately the file format has changed (more equal to the smile now with point logs / interval logs etc.) but I can get the info I need from this file.

however...
I'm using php -> simplexml_load_file("http://stretch:mypass@192.168.x.x/core/appliances") to parse the xml.
This worked fine, this works fine for the smile, but since firmware 2.x not anymore for the stretch.
Diving into the issue I see this error: "failed to load external entity <url>"
Debugging the HTML [Get] request too the stretch, I see an error 505 -> HTTP1.0 response instead of the expected HTTP1.1 (perhaps this is why the new plugwise HTML website for Strech is not compliant with internet explorer?)

Is there anyone that has a clue on how to parse the new format XML (firmware 2.x) in PHP, such it can retrieve the actual usage of the plugwise appliances?
thanks in advance!

@Phoenix, keep up the good work! I love the info that you post about Plugwise
User avatar
RdP
Advanced Member
Advanced Member
Posts: 989
Joined: Thu May 04, 2006 10:14 am
Location: Netherlands

Re: Plugwise Stretch firmware 2.0.x urls

Post by RdP »

I cannot answer your question, but I was wondering if you received the update automaticaly or did you do it manually and on which firmware level are you now?

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

Re: Plugwise Stretch firmware 2.0.x urls

Post by Phoenix »

Hi brammh,

For my Stretch Commandline Interface i don't use a XML parser to get the data, i just "cut" away what i don't need from the XML output, so i cannot help you with this..., but with autoit3 i don't have problems getting the XML data from the stretch using http api/com
Last edited by Phoenix on Fri Nov 08, 2013 9:45 pm, 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
brammh
Starting Member
Starting Member
Posts: 8
Joined: Thu Aug 30, 2012 10:49 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by brammh »

Hi all,

@Rien, the update was suggested by the Plugwise app. So no manual force of the new firmware.
@Phoenix / all.
My issue is solved. Difference between stretch 1.x / 2.x firmware is the use of CURL
You cannot use 'simplexml_load...' without CURL anymore.
So you need to add something like:

$fp = fopen ('php://memory', 'wb+');
$ch = curl_init($GLOBALS['stretch_url']);// or any url you can pass which gives you the xml file
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERPWD, $GLOBALS['stretch_username'] . ':' . $GLOBALS['stretch_password']);
curl_exec($ch);
curl_close($ch);
fseek($fp, 0);

if( ! $appliancesxml = simplexml_load_string(stream_get_contents($fp)))
{
echo 'unable to load XML file';
}
fclose($fp);
Iliak
Starting Member
Starting Member
Posts: 1
Joined: Sun Nov 03, 2013 3:51 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by Iliak »

Hello all,

first thx Phoenix for digging out the URLs _and_ posting the source code of your tool - helped me greatly to adapt my perl based
switching / monitoring to the new "core" interface.

maybe worth pointing out the new method of switching as well, as the power_state that was in 1.x no longer works:

You send a POST request to the url http://192.168.x.x/core/appliances;id=XXXXXXXX/relay or http://192.168.x.x/core/appliances;name=XXXXXXXX/relay
and put the following in the body "<relay><state>on</state></relay>" for switching on and "<relay><state>off</state></relay>" for switching off. Be carefull
as the XML parses from plugwise seems to be very sensitive to extra characters or even capital vs. lower case.

Regards and again thx for the excellent work
Iliak
nslmanu
Starting Member
Starting Member
Posts: 9
Joined: Fri May 07, 2010 4:04 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by nslmanu »

Hey guys,

Just recevied mine ... without a sticker with SSID on the box ...

So i still can't connect with Iphone or Mac app for the moment.

I'm trying to reach the http webserver but it request from me a login/password ... not cool.

On my source software, before moving the usb stick into the strech, i didn't need a login/password ...

Do you know please how i can connect to this box with http request and how to configure it with iphone app ?

Because for the moment : i know only the Ip address and can ping it on the LAN, nothing more .. :(

many thnaks btw for your help.

Manu
nslmanu
Starting Member
Starting Member
Posts: 9
Joined: Fri May 07, 2010 4:04 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by nslmanu »

thanks to Pietje for his help ( can't reply to him with private message ... not allowed !!! ).

I have contacted Plugwise support and now, i can reach , configure my stretch ...

Only VERY VERY bad point : i still can't set ON or OFF plugs because requests are not working like on source.

I read that i have to do some external php requests :( i'm very disapointed for this.

Here is an email from them on the 5 march 2015 :

There is no API available at this time.
With http it is possible to switch modules with the Stretch.
Also it is possible to get the data like usage from the Strech with http
requests (xml)
Example:
HTTP POST: http://stretch:
ID>/power_state=off
HTTP GET: http://stretch:

So i don't understand why it does not working :(

Maybe you have an idea ?

have a nice day
Manu
User avatar
RdP
Advanced Member
Advanced Member
Posts: 989
Joined: Thu May 04, 2006 10:14 am
Location: Netherlands

Re: Plugwise Stretch firmware 2.0.x urls

Post by RdP »

I have the API document for the Stretch. I thought this was a public API, but I will double check!!
Rien
nslmanu
Starting Member
Starting Member
Posts: 9
Joined: Fri May 07, 2010 4:04 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by nslmanu »

What the API says so ? :)
PietjeNL
Member
Member
Posts: 150
Joined: Sun May 30, 2010 8:47 am

Re: Plugwise Stretch firmware 2.0.x urls

Post by PietjeNL »

How do u like to switch? Because the stretch also has a app to switch.
Or do u want to intergrade it into some other software like HS?
I personally use the app tasker for android to post a command, simular to the ones u got from plugwise.
This way i can voice controle my livingroom lights.
nslmanu
Starting Member
Starting Member
Posts: 9
Joined: Fri May 07, 2010 4:04 pm

Re: Plugwise Stretch firmware 2.0.x urls

Post by nslmanu »

Yep i want to integrate them in my homeautomation box ( eedomus ).

Many thanks :)
PietjeNL
Member
Member
Posts: 150
Joined: Sun May 30, 2010 8:47 am

Re: Plugwise Stretch firmware 2.0.x urls

Post by PietjeNL »

U should see if u can use HTTP POST commands to switch.
http://doc.eedomus.com/en/index.php/Scripts has info on HTTP post command in scripts
Post Reply

Return to “Plugwise Forum”