This page last changed on Aug 21, 2014 by dswinnen.
I am trying to incorporate pictures that are changing in function of the data found in XML files.
For example, reading the weather forecast from available feeds (e.g. WUnderground or Yahoo Weather) is great and give all the relevant information that are easily parsed by OpenRemote and displayed as text.
I am sure it is possible to have pictures representing some values from the XML file, such as replacing the data "Partly cloudy" by a nice icon representing this.
Can someone guide me in the steps that are needed for this or to any discussions about related topic?
So far I could not find the solution.
Any help would be greatly appreciated!
I have not done this, but somthing simmilar. I think this should work.
- Collect all the relevant pictures in your local directory under /webbapps/controller (There is a collection somewhere on the Wunderground site)
In Building Modeler create new Device with the following:
- Create a http command that extracts the weather type from wunderground XML source
- Create sensor of type:custom, where you enumerate all possible weather types. You may use the same name for Name and Value
In the UI designer add:
- Add Image where you do select the sensor you just created in Building Modeler.
- Now under Sensor State you will see the names of the weather types you mentioned followed by a select button. Click those and select the appropriate images.
Posted by pz1 at Aug 21, 2014 09:35
Thank you very much for the clear and prompt answer!
This works like a charm (and it much more easy than I thought it would be).
Posted by dswinnen at Aug 21, 2014 20:36
I did not collect all the pictures but with a XPath Expression (//response/current_observation/icon_url) I call the icon url from the Weatherunderground XML that I store on my Synology.
Than you do not need to type in all the weathertypes.
Works perfect as well.
Posted by placemaster at Aug 21, 2014 21:21
Not sure I am following you... I understand that you have created a new http command such as "http://api.wunderground.com/api/e5z6zz4z3z3zz3/conditions/q/Mauricius/CurePipe.xml" with the XPath Expression (//response/current_observation/icon_url), but after I do not see how you got the pictures from the http address in OpenRemote and how you succeeded in not typing all the weather types.
Thanks for this interesting alternative that I like to try.
Posted by dswinnen at Aug 21, 2014 22:56
I just made on the panel a webview component and linked my sensor to that.
The sensor looks like this
In the command I used your link: http://api.wunderground.com/api/e5z6zz4z3z3zz3/conditions/q/Mauricius/CurePipe.xml
It is necesary that in your XML is an path to : icon_url
Otherwise it will not work.
Posted by placemaster at Aug 22, 2014 11:39
This is a good way to do it.
The reason I did choose against the WEBview element at the time is that they can't be packed as closely on a screen as the images. In addition my solution gives freedom of choice for kind ans size of icons. That being said, yours is easier to set up
Posted by pz1 at Aug 22, 2014 12:07
Thanks Erwin for the clarification and for the screenshots!
This is indeed a very easy set up.
One needs to balance the convenience of your setup with the fixed picture format available from WUnderground (including no transparent background).
All the best!
Posted by dswinnen at Aug 26, 2014 20:39
Erwin Bouwman says: I just made on the panel a webview component and linked my sensor to that...
Did in your example, the picture is, but only in Google Chrome (PC Win7 x64). On iPad mini no, I see a white square. How to fix?
Posted by aleksey_z at Oct 26, 2014 17:13