Bwired Googlemaps upload data webservice

Forum about Questions, discussions and announcements regarding the Bwired website owned by Pieter Knuvers
User avatar
appie
Starting Member
Starting Member
Posts: 8
Joined: Sun Aug 05, 2012 2:50 pm
Location: Gorinchem, Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post 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
User avatar
ludom
Member
Member
Posts: 90
Joined: Fri Jun 11, 2010 12:30 am
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Post 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 ;)
Home-brewed HA system based on Linux, PHP5, MySQL and Beanstalkd
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post by Bwired »

Hi Ludom
i see your googlemaps XML's coming in on my Bwired server :-)
your set to go now!
User avatar
ludom
Member
Member
Posts: 90
Joined: Fri Jun 11, 2010 12:30 am
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Post by ludom »

Nice, it's working :D

I tweaked my PHP class a bit and is now ready to use (see attachment).
Attachments
Bwired_Webservice PHP Class.zip
(2.05 KiB) Downloaded 802 times
Home-brewed HA system based on Linux, PHP5, MySQL and Beanstalkd
User avatar
appie
Starting Member
Starting Member
Posts: 8
Joined: Sun Aug 05, 2012 2:50 pm
Location: Gorinchem, Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post 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
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post by Bwired »

I need to put you in the database also, i will check my server and do this :-)
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post by Bwired »

Appie, should work now, start uploading.
I have seen your XML on my server.
User avatar
appie
Starting Member
Starting Member
Posts: 8
Joined: Sun Aug 05, 2012 2:50 pm
Location: Gorinchem, Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post 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
User avatar
ludom
Member
Member
Posts: 90
Joined: Fri Jun 11, 2010 12:30 am
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Post 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
Home-brewed HA system based on Linux, PHP5, MySQL and Beanstalkd
User avatar
appie
Starting Member
Starting Member
Posts: 8
Joined: Sun Aug 05, 2012 2:50 pm
Location: Gorinchem, Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post 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
User avatar
ludom
Member
Member
Posts: 90
Joined: Fri Jun 11, 2010 12:30 am
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Post 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.
Home-brewed HA system based on Linux, PHP5, MySQL and Beanstalkd
User avatar
appie
Starting Member
Starting Member
Posts: 8
Joined: Sun Aug 05, 2012 2:50 pm
Location: Gorinchem, Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post 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
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post by Bwired »

Dont know your script that good, did you see this....
http://www.domoticaforum.eu/viewtopic.p ... 120#p17557
User avatar
ludom
Member
Member
Posts: 90
Joined: Fri Jun 11, 2010 12:30 am
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Post 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);
Home-brewed HA system based on Linux, PHP5, MySQL and Beanstalkd
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

Re: Bwired Googlemaps upload data webservice

Post by Bwired »

great :)
i see a lot of unknown xml's coming in, but stil in Error
Post Reply

Return to “Bwired Forum”