Page 21 of 22

Re: Bwired Googlemaps upload data webservice

Posted: Sun Aug 05, 2012 2:59 pm
by appie
Hi all,

I like to add my data to the web service but I have no idea how to get the data out of my system into a XML file.

I’m using xComfort with IP-Symcon.

Someone a idea or better, already a script to do this?

Thanks,

Albert

Re: Bwired Googlemaps upload data webservice

Posted: Tue Aug 07, 2012 12:17 pm
by ludom
Hi Pieter,

I like to use your domotica map also, see my XML;

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<BWired>
	<Init>
		<DateTime>07-08-2012 12:09:35</DateTime>
		<UserName>ludom</UserName>
		<Password>B3w1r3dW3bs3rv1c3</Password>
		<ScreenName>Ludom</ScreenName>
		<Gpslat>51.4308</Gpslat>
		<Gpslong>5.5399</Gpslong>
		<City>Geldrop</City>
		<Website/>
		<WebCamPicUrl/>
		<Title>Ludom's Online Home</Title>
	</Init>
	<Entry>
		<Name>Temperature Outside</Name>
		<ID>0</ID>
		<Units>C</Units>
		<Value>17.5</Value>
	</Entry>
	<Entry>
		<Name>Temperature Inside</Name>
		<ID>1</ID>
		<Units>C</Units>
		<Value>21</Value>
	</Entry>
</BWired>
I also created a PHP class for posting the data, I'd like to share this with other forum members. When my first data posts are succesfull I will share the code here ;)

Re: Bwired Googlemaps upload data webservice

Posted: Wed Aug 08, 2012 1:21 am
by Bwired
Hi Ludom
i see your googlemaps XML's coming in on my Bwired server :-)
your set to go now!

Re: Bwired Googlemaps upload data webservice

Posted: Wed Aug 08, 2012 9:57 am
by ludom
Nice, it's working :D

I tweaked my PHP class a bit and is now ready to use (see attachment).

Re: Bwired Googlemaps upload data webservice

Posted: Sat Aug 18, 2012 12:22 pm
by appie
Hi,

I try to get this working with the script of Ludom but I don’t see the XML file.

See the review echo below from the script, is this enough for sending my XML string upload to the WebService of BWired?
18-08-2012 12:13:56albertshousealbertshouse2012AlbertsHouse51.8442794.968341Gorinchemwww.albertsweb.nlhomeserver.albertsweb.nl:82/data/img.php?imageid=45997MyTitle2Temperature outside:029.1 °CTemperature inside:123.8 °CHumidity outside:250.4 %Humidity inside:346.2 %
Bwired Googlemaps Webservice.
Albert

Re: Bwired Googlemaps upload data webservice

Posted: Sat Aug 18, 2012 10:40 pm
by Bwired
I need to put you in the database also, i will check my server and do this :-)

Re: Bwired Googlemaps upload data webservice

Posted: Sun Aug 19, 2012 2:12 pm
by Bwired
Appie, should work now, start uploading.
I have seen your XML on my server.

Re: Bwired Googlemaps upload data webservice

Posted: Sun Aug 19, 2012 5:23 pm
by appie
Great, it’s working .......

A few questions:
- I had some problem with the little o in the oC, is there a way to put this in the code?
- Is there a way to put a blank line into the sensor data?

Albert

Re: Bwired Googlemaps upload data webservice

Posted: Mon Aug 20, 2012 8:09 pm
by ludom
appie wrote:Hi,

I try to get this working with the script of Ludom but I don’t see the XML file.

See the review echo below from the script, is this enough for sending my XML string upload to the WebService of BWired?
18-08-2012 12:13:56albertshousealbertshouse2012AlbertsHouse51.8442794.968341Gorinchemwww.albertsweb.nlhomeserver.albertsweb.nl:82/data/img.php?imageid=45997MyTitle2Temperature outside:029.1 °CTemperature inside:123.8 °CHumidity outside:250.4 %Humidity inside:346.2 %
Bwired Googlemaps Webservice.
Albert
Hi Albert,

The echo is just for testing purposes. When you enable the echo and test it in your webbrowser you can press ctrl-U to open the page source, there you will find the full XML structure. When you use the POST function the data will be passed to Bwired.

For using the degrees celsius sign you can use an UTF-8 / ASCII code;
http://tlt.its.psu.edu/suggestions/inte ... chart.html

For degrees celsius you can use;
&deg;C

Re: Bwired Googlemaps upload data webservice

Posted: Sat Aug 25, 2012 3:09 pm
by appie
Hi Ludom,

When I put this in the code no XML upload is send to BWired. I don’t see a error, but in the echo I see the &deg;C and not the oC.
Maybe this is because I’m running the code inside IP-Symcon, I’m not sure?

Code: Select all

$bwired->addEntry('Temperature Outside:', 1, '&deg;C', $temp_out);
Is there a way to make a blank line, to separate the different sensor groups?

Albert

Re: Bwired Googlemaps upload data webservice

Posted: Sat Aug 25, 2012 11:16 pm
by ludom
appie wrote:Hi Ludom,

When I put this in the code no XML upload is send to BWired. I don’t see a error, but in the echo I see the &deg;C and not the oC.
Maybe this is because I’m running the code inside IP-Symcon, I’m not sure?

Code: Select all

$bwired->addEntry('Temperature Outside:', 1, '&deg;C', $temp_out);
Is there a way to make a blank line, to separate the different sensor groups?

Albert
Hi Albert,

Thats weird! I am using the same code at my side and that's working fine.

It could be something with charset encoding (UTF-8, etc.), what happens when you place non ASCII version of the sign ? so copy-paste the following;

Code: Select all

°C
What about the blank lines, I think this is possible, but I don't know how Pieter is processing this, maybe he truncates empty values/records before inserting it in his Database, you could give It a try by adding some empty Entries or entering some spaces in the entry name and values.

Re: Bwired Googlemaps upload data webservice

Posted: Sun Aug 26, 2012 11:24 am
by appie
Ludom,

When I put the o in of the oC no data is shown in GoogleMaps. A space is no problem, all uploaded data is shown.

I don’t know if the data is send or not processed by BWired, but I see other location with the o. Maybe BWired is reading this and could tell us if it’s something in my script. Is there code I can put in to do something with the UTF-8?

For the blank line, I tried to use the addEntry for this but can’t find the way to clear all text in it. Is there a way to do this with addEntry? When I put this line in all data below is not presented.

Code: Select all

$bwired->addEntry('  ', 7, '  ', NULL);
Albert

Re: Bwired Googlemaps upload data webservice

Posted: Sun Aug 26, 2012 9:04 pm
by Bwired
Dont know your script that good, did you see this....
http://www.domoticaforum.eu/viewtopic.p ... 120#p17557

Re: Bwired Googlemaps upload data webservice

Posted: Mon Aug 27, 2012 10:03 am
by ludom
Hi Bwired,

No didn't saw that page from this topic, but I have seen it now.

I tested this at my side and the UTF-8 code for degrees celsius "#186;" works. Because i am using PHP i need to parse this as "&#186;" and that works perfectly with the PHP class. The degrees celsius sign is displayed fine on the map.

@appie
Use the following code which should work;

Code: Select all

$bwired->addEntry('Temperature Outside:', 1, '&#186;C', $temp_out);

Re: Bwired Googlemaps upload data webservice

Posted: Tue Aug 28, 2012 12:23 am
by Bwired
great :)
i see a lot of unknown xml's coming in, but stil in Error