Bwired Googlemaps upload data webservice

Forum about Questions, discussions and announcements regarding the Bwired website owned by Pieter Knuvers

Re: Bwired Googlemaps upload data webservice

Postby appie » Sun Aug 05, 2012 1:59 pm

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
appie
Starting Member
Starting Member
 
Posts: 8
Joined: August 2012
Location: Gorinchem, Netherlands

Re: Bwired Googlemaps upload data webservice

Postby ludom » Tue Aug 07, 2012 11:17 am

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
User avatar
ludom
Member
Member
 
Posts: 90
Joined: June 2010
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby Bwired » Wed Aug 08, 2012 12:21 am

Hi Ludom
i see your googlemaps XML's coming in on my Bwired server :-)
your set to go now!
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby ludom » Wed Aug 08, 2012 8:57 am

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 471 times
Home-brewed HA system based on Linux, PHP5, MySQL and Beanstalkd
User avatar
ludom
Member
Member
 
Posts: 90
Joined: June 2010
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby appie » Sat Aug 18, 2012 11:22 am

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
User avatar
appie
Starting Member
Starting Member
 
Posts: 8
Joined: August 2012
Location: Gorinchem, Netherlands

Re: Bwired Googlemaps upload data webservice

Postby Bwired » Sat Aug 18, 2012 9:40 pm

I need to put you in the database also, i will check my server and do this :-)
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby Bwired » Sun Aug 19, 2012 1:12 pm

Appie, should work now, start uploading.
I have seen your XML on my server.
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby appie » Sun Aug 19, 2012 4:23 pm

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
appie
Starting Member
Starting Member
 
Posts: 8
Joined: August 2012
Location: Gorinchem, Netherlands

Re: Bwired Googlemaps upload data webservice

Postby ludom » Mon Aug 20, 2012 7:09 pm

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
ludom
Member
Member
 
Posts: 90
Joined: June 2010
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby appie » Sat Aug 25, 2012 2:09 pm

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
appie
Starting Member
Starting Member
 
Posts: 8
Joined: August 2012
Location: Gorinchem, Netherlands

Re: Bwired Googlemaps upload data webservice

Postby ludom » Sat Aug 25, 2012 10:16 pm

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
ludom
Member
Member
 
Posts: 90
Joined: June 2010
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby appie » Sun Aug 26, 2012 10:24 am

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
User avatar
appie
Starting Member
Starting Member
 
Posts: 8
Joined: August 2012
Location: Gorinchem, Netherlands

Re: Bwired Googlemaps upload data webservice

Postby Bwired » Sun Aug 26, 2012 8:04 pm

Dont know your script that good, did you see this....
viewtopic.php?f=23&t=2379&start=120#p17557
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby ludom » Mon Aug 27, 2012 9:03 am

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
User avatar
ludom
Member
Member
 
Posts: 90
Joined: June 2010
Location: Netherlands

Re: Bwired Googlemaps upload data webservice

Postby Bwired » Mon Aug 27, 2012 11:23 pm

great :)
i see a lot of unknown xml's coming in, but stil in Error
User avatar
Bwired
Administrator
Administrator
 
Posts: 5312
Joined: March 2006
Location: Netherlands

PreviousNext

Return to Bwired Forum

Who is online

Users browsing this forum: No registered users and 1 guest