Announcement

Collapse
No announcement yet.

Questions regarding Maps Rotation and stock XML templates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AllHailJ
    replied
    Searched for weather and radar. Looked at different sites and then extracted the URL from the picture. I looked at the Canada weather and there is a lot of information available. I looked at Calgary radar which appears to be a .gif but didn't download and see if it was complete.

    I don't understand the html you posted in that I don't know what to name the file or why it works. Sorry ignorant about this file type.

    -- EDIT --

    Figured out how the HTML works - now I need to work out how to switch between maps and have it update.

    Here is a site I think you might be interested in:

    https://www.ready.noaa.gov/READY_animations.php The snow rain and ice 84 hour forecast is pretty neat. It is for most of North America.

    -- EDIT 2 --

    I found a way to have the animation gif reload. I modified the script for the .gif files and then on the scroll buttons I closed the screen and opened the screen.

    Here is the screen shot of the increment function.

    Click image for larger version

Name:	Screenshot from 2019-12-23 03-21-16.png
Views:	51
Size:	317.9 KB
ID:	1349106 This is the same process as for static maps except I use the html 123QWEASD shared and instead of activating a release of the element you have to close and open the screen. I have not looked at how much bandwidth this is consuming but at least it is working and optimization if needed can happen at a later date.

    Hope this helps someone!

    Leave a comment:


  • 123qweasd
    replied
    Thx for the link AllhailJ.
    Just curious, how did you find the associated folder (https://radar.weather.gov/Conus/Loop) ? Is there any web interface pointing to it or is it just backend data found via trial/error?
    Just wondering if there is more detailed/regional data available. Thx

    Leave a comment:


  • AllHailJ
    replied
    Here is my solution.

    I retrieve the files using two homeseer events shown in the file below - one for daily updates and one for multiple refreshes during the day. I use imagemagick's mogrify to batch change and resize and convert from jpg to png files. - this is the static part. The -resize 900x makes the file 900 pixels wide and scales the vertical proportionately. -resize x900 would resize vertical pixels and scale horizontal proportionally. Both keep the aspect ratio.


    Click image for larger version

Name:	Screenshot from 2019-12-22 20-23-47.png
Views:	102
Size:	205.8 KB
ID:	1349069

    I set up HSTouch with an image element and set the URLNormal property to the location of the file that I wanted it to read. http://192.168.1.135/opt/HomeSeer/ht...L/maps/map.png. This is the file I use as a working file to hold the current map to be displayed.

    Click image for larger version

Name:	Screenshot from 2019-12-22 20-33-52.png
Views:	34
Size:	585.7 KB
ID:	1349070

    I have the two scroll buttons do two things to traverse the images. I call an event and I simulate a release on the image element - this forces the update.

    Click image for larger version

Name:	Screenshot from 2019-12-22 20-38-32.png
Views:	34
Size:	210.0 KB
ID:	1349071

    I have an increment and decrement event that do the same things only subtract instead of add. Below is the increment event. I created a counter to keep track of which picture is displayed.

    Click image for larger version

Name:	Screenshot from 2019-12-22 20-42-19.png
Views:	32
Size:	31.8 KB
ID:	1349072

    I wrote the following script to cycle through the pictures.

    --------------------------------------------------- Start of .vb script
    '12/21/2019 ScrollPictures.vb
    'Script to scroll through static pictures and write file to unique filename.

    IMPORTS System.IO
    IMPORTS System.Net
    IMPORTS System.Threading

    Sub Main(ByVal Parm As String) 'There are 0 parameters

    Dim sPath, sDisplayFile, Counter, Source, Destination As String
    Dim sFile(6) As String
    Dim dCounter As Double
    Dim iCnt, iMax, iIncCnt As Integer

    iMax = 6 'Set the maximum number of maps
    Counter = "MapCounter" 'Created Counter

    'set the files and pathname for maps
    sPath = "/opt/HomeSeer/html/images/weatherXML/maps/" 'The Path Name to the files
    sFile(0) = "USWeather.png"
    sFile(1) = "USStorms.png"
    sFile(2) = "USPressures.png"
    sFile(3) = "USPollen.png"
    sFile(4) = "USGrass.png"
    sFile(5) = "USTree.png"
    sFile(6) = "USRagweed.png"
    sDisplayFile = "map.png" ' this is the filename used as the working file.

    dCounter = hs.CounterValue(Counter) 'Get the Map Counter Value
    iCnt = CInt(dCounter) ' Set the double to an integer

    'Make the list a loop and set the Counter correctly

    iIncCnt = 0
    If iCnt < 0 Then 'Went through the floor value so set to ceiling value.
    iCnt = iMax
    For iIncCnt = 1 To iMax
    hs.CounterIncrement(Counter)
    Next
    End If

    If iCnt > iMax Then 'Went through the ceiling value so set to the floor value
    iCnt = 0
    hs.CounterReset(Counter)
    End If

    Source = sPath & sFile(iCnt)
    Destination = sPath & sDisplayFile

    'Overwrite or create the file that will be displayed.
    System.IO.File.Copy(Source, Destination, True)


    End Sub

    --------------------------------------- End of .vb script

    I am still struggling to get .gif files to cycle through the pictures in the file. I had it working and now it is not. It works on windows but not android. I know this is complex and somewhat convoluted but I now have the ability to download any files or sequence and have them update reliably. I know I should change the parameter passing to object but events call scripts with a single string. Hope this helps someone.

    Leave a comment:


  • AllHailJ
    replied
    https://radar.weather.gov/Conus/Loop...ckies_loop.gif

    Try this.

    Leave a comment:


  • 123qweasd
    replied
    Hi Jeff, I read your "weatherXML Map Devices" PDF but still have my original question unanswered:

    when imported in HStouch, animated WeatherXML maps become static images.
    is this the intended behavior or is there a way to get animated maps?

    Tried tracking the WeatherXML device with "image" and "text" elements. no success

    If I use the file located in HomeSeer HS3\html\images\weatherXML\maps, it weighs 29MB which is too much load on HStouch

    source is:

    https://cdn.star.nesdis.noaa.gov//GO...-1000x1000.gif

    Also your "resize" option doesn't seem to work either for this link type.
    Maybe I could automate some separate GIF resizer to make it lighter....

    If I link the URL directly in a "text" element, it kind of works but there doesn't seem to be a way to "scale" it correctly, which makes it useless.

    Is there any other way to get a scalable/animated element that would be light on CPU and usable in HStouch?


    AllHailJ : saw references in your screenshots to "https://radar.weather.gov/Conus/northrockies_loop.gif"
    This link doesn't work for me. I get "The requested URL /Conus/northrockies_loop.gif was not found on this server"
    I could only find a php version of this map "https://radar.weather.gov/Conus/northrockies_loop.php" at "https://radar.weather.gov/Conus/"
    how did you manage to get the GIF version ? where would be the source website if any?

    Thanks!


    EDIT: got it!

    works by adding an HTM code to the HS HTML folder and referring to it in a text/url element.
    Works perfectly. fast refresh and resizable in HSTouch

    <html lang="en">
    <head><META HTTP-EQUIV=Refresh CONTENT=600></head>
    <body bgcolor="MidnightBlue" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <img src="https://cdn.star.nesdis.noaa.gov//GOES16/ABI/SECTOR/EUS/GEOCOLOR/GOES16-EUS-GEOCOLOR-1000x1000.gif" height="100%" width="100%"></img>
    </body>
    </html>


    If you have other options/workarounds, feel free to share, thx

    Leave a comment:


  • AllHailJ
    replied
    I could not get the maps to update even after upgrading to hstouch 3.0.77. I read somewhere in the forum, and now can't find the posts, where in HSTouch 3.0.55 they added update via URL. I used this solution and it is working. I will share my solution later today as there are multiple screen shots and a script to copy.

    Jeff - Thank you for all that you do and share. It is appreciated and hope your family emergency resolved in a favorable manner.

    Regards

    Leave a comment:


  • CFGuy
    replied
    If you have the image in a device, you can change the device value. That will trigger HSTouch to reload the image. Typically in the plugin, I use 99 and 100. Nothing special about those numbers. It is just to toggle the device value. Doing that will cause HSTouch to reload the image.
    Just make sure the image is in the Device Status setup using which ever number you set the device to.

    Leave a comment:


  • AllHailJ
    replied
    More info - The images will not update from day to day unless the HSTouch client is shutdown and restarted. I don't exactly understand why.

    This is true for weatherXML devices as well as setting the files to display directly on an hstouch screen.

    This S**ks and I can't figure out a work around right now.

    In addition, you can't do a reconnection to a server and have it update.
    Last edited by AllHailJ; December 21, 2019, 10:15 AM. Reason: Further information on issue

    Leave a comment:


  • AllHailJ
    replied
    I got all files working. I took a different tact - I download the files I want to /weatherXML/maps. I convert .jpg files to .png with mogrify. On the gifs, I create a device for the .gif just like the .png

    Here is my event to download the files that are updated more than once per day.

    Click image for larger version

Name:	Screenshot from 2019-12-19 10-12-09.png
Views:	131
Size:	113.0 KB
ID:	1348036

    Here is my event to modify files that are updated only once per day.

    Click image for larger version

Name:	Screenshot from 2019-12-19 10-15-01.png
Views:	106
Size:	155.6 KB
ID:	1348037


    Prior to displaying any maps on HS Touch, the maps are updated and I set the map to be displayed to the first map. I then display the screen. The element I display the map in is an image element.

    Here is a screenshot from HSTouch.

    Click image for larger version

Name:	Screenshot from 2019-12-19 10-18-25.png
Views:	92
Size:	368.5 KB
ID:	1348038

    I created up & down buttons to allow me to scroll through the maps.

    Here are the devices I created through weatherXML
    Click image for larger version

Name:	Screenshot from 2019-12-19 10-23-40.png
Views:	98
Size:	214.6 KB
ID:	1348039
    Here is how I set up a looping device

    Click image for larger version

Name:	Screenshot from 2019-12-19 10-25-22.png
Views:	90
Size:	39.2 KB
ID:	1348040

    I hope this answers your original question. You can have weatherXML do the update work by using the URL where I have the full file name - I just wanted a little more control. I want to take a series of static graphics files .png .jpg .bmp (such as max temp forecasts graphics for day 0-6) and convert them to .gif and combine to make a loop of the 7 days. I will share when I have this working.


    Regards

    Leave a comment:


  • AllHailJ
    replied
    I think your problem of not getting animation is using the wrong element in HSTouch. Try using a text element to display the map device status ad see if that works. I will try using an image element and see if I get failure.

    Both elements display the gif correctly. I am wondering it the gif you are using is just the first image and the problem is the downloaded file.

    Leave a comment:


  • AllHailJ
    replied
    OK here is how they name the file

    20193502346-20193510351-GOES16-ABI-CONUS-GEOCOLOR-625x375.gif

    it is year,Day of year, Start Time (UTC) - Year, Day of Year, End Time (UTC) - all the same. The file is 6.4 MB. Not huge but will put a load on the client. I will make sure I can display this and it works. Then I have to figure out where NOAA store the file so I can do a wget. Still noodling on the problem. You can load the website into a text element and see the animation. It just looks cheesy in HSTouch.

    UPDATE: This methodology displays an animated gif. It takes a few seconds to load and then it endlessly loops. I also noticed that you were using an image element "(I did enable "is video" in image HST element) ?" did you try a text element?

    2ND UPDATE: the file names change everyday at the NOAA site. The methodology works but requires consistency in naming.

    Leave a comment:


  • 123qweasd
    replied
    ok keep me posted as this was the original question/issue, Thanks!

    Leave a comment:


  • AllHailJ
    replied
    just static ones so far but I am working up to the dynamic. Those will likely be .gif's.

    EDIT AHJ - They are .gifs but they are coded to each time period from NOAA. I can display the web site and view it that way but not just the file. Alot of the pages at the site are .php which are not viewable by homeseer. If I can work out NOAA well coding, I think there might be a way to download just the .gif's. No promises!

    Leave a comment:


  • 123qweasd
    replied
    Thanks for the feedback, did you manage to integrate animated maps or just static ones? will do some more testing on my end and post results. Cheers.

    Leave a comment:


  • AllHailJ
    replied
    I have been playing with maps and have learned quite a bit. I set up a virtual device and changed the status graphics to include these files. I have set up a page that will display downloaded maps but am not quite finished to be able to swap the different maps. I will display maps by incrementing the device value to show the correct map. I wrote an event that runs every 6 hours that uses wget, which is available for free and has both linux and windows versions, to retrieve the maps. I have not gone to the canada web site to see how to retrieve the maps but will. The wget -O option allows you to rename the file and where it is placed. Also the files say they are .gif but they are really .png.

    Some snapshots below

    Click image for larger version

Name:	Screenshot from 2019-12-16 15-10-39.png
Views:	162
Size:	73.4 KB
ID:	1347111

    Here is what the screen looks like - in progress

    Click image for larger version

Name:	Screenshot from 2019-12-16 15-15-49.png
Views:	141
Size:	482.3 KB
ID:	1347112

    Leave a comment:

Working...
X