Home AMX Technical Discussion

Y-Weather Replacement module for ENV-VST-C and i-Weather

amdpoweramdpower Junior MemberPosts: 110
So, I got really annoyed the other day when my i-Weather subscription ran out for my ENV-VST-C. Being that a new license is about the same cost as a Viewstat (don't ask me why), I decided to roll my own module. Because I was pushing weather updates to the Stat I decided to include control as well. This module will essentially replace both the i-Weather and Viewstat modules. It supports 5-Day forecast through Yahoo weather, full display on the Viewstat, filter reminders, etc., etc.

I based the code off of some an old module I wrote for Yahoo weather when I was MUCH greener at coding. So, please forgive any "doing it the long way" sections. Also, please forgive the G3 style send commands. I have an old G3 panel installed in my Bedroom and needed to maintain compatibility.

The graphics are based off of a template on AMX's site and their Viewstat module. However, this panel DOES NOT use the same channels! Also, the graphics for the weather are ripped from Yahoo. Please be respectful of the image and XML data copyright holder's policies. You are free to use my code however you want, as long as it is helpful, but please maintain the copyright notice at the top and let me know if you fix anything.

Someday, I'll clean this code up a bit and add scheduling to it.

Not sure if anyone will find this useful but if you do, please let me know! Thanks.

I'm pointing to a link on my website with all of my current modules as I can't upload right now for some reason in VBulletin.

http://www.jackkolesar.com/code.html
«1

Comments

  • HARMAN_antonypriceHARMAN_antonyprice Junior Member Posts: 2
    UK Postcodes

    This module is fantastic but i can only get it to work with US ZIP codes. Do you happen to have the API guide? I am trying to use UK locations but get errors if i use postcodes or Yahoo location codes. Do you have any ideas?

    Antony
  • amdpoweramdpower Junior Member Posts: 110
    Figured it out! I kinda knew I was going to have to add this to the module. Looks like Yahoo lookup can take a weather.com location ID. I'll need to add a keyboard entry so you can do it just like the number pad. If you search weather.com for your city and look at the link at the top, you will see an alphanumeric number. Enter that where the zip code goes. So, for Tokyo, Japan it would be JAXX0085. The full link would be

    http://xml.weather.yahoo.com/forecastrss/JAXX0085_f.xml

    Good luck!
  • amdpoweramdpower Junior Member Posts: 110
    By the way... Change that "f" to a "c" if you want the data in Celcius. ;)
  • amdpoweramdpower Junior Member Posts: 110
    Gonna make the changes and should have them posted shortly.

    Sent from my DROIDX using Tapatalk 2
  • amdpoweramdpower Junior Member Posts: 110
    Give this one a try. Now supports Location and Zip as well as F and C scales.
  • HARMAN_antonypriceHARMAN_antonyprice Junior Member Posts: 2
    All works great. Saved me loads of time.

    Thanks

    Antony
  • DavidRDavidR Junior Member Posts: 62
    Really does work well... much faster than the AMX module.

    One question... what does dvREL do? I had to comment it out and remove it from the module definitions as .96 would compile for me. Studio compiler error says the module has 7 parameters while only 6 were found.
  • amdpoweramdpower Junior Member Posts: 110
    Doh! Forgot to comment that out in the new verion. I use the "sunset" time to trigger a relay to my landscape lights. I deleted that portion of code but forgot the variable.

    Sent from my DROIDX using Tapatalk 2
  • kennethkkennethk Junior Member Posts: 86
    Thanks for the module!

    Really works very well!!
    I use it in my home system now, and have been reading true the code many times, learned alot (parsing/string handling, module use/creation), and beleive i will try doing a version working with www.yr.no (norwegian++ weather provider).

    I will credit you (of course), and post here when i'm done.


    Kenneth K
  • DavidRDavidR Junior Member Posts: 62
    just trying this code with some thermostats and noticed it doesn't update the heat and cool setpoints when selecting a zone. if an up or down heat / cool setpoint button is pressed they immediately fill in with the current values. any idea?
  • amdpoweramdpower Junior Member Posts: 110
    Yeah. Didnt really get to test with multiple zones. I think I am using a level _event and it doesnt update until changed. I don't think LEVON worked. I'll need to take a look when I get time. Might have to build a structure to store the current temp and settings. Thanks.

    Sent from my DROIDX using Tapatalk 2
  • trx250r87trx250r87 Junior Member Posts: 31
    I have this somewhat working with an ENV-VST-C with latest firmware, NI3000, and NXD-CV7. I converted the touchpanel file and had to change some of the graphics. I am able to change temperature settings and turn fan on/off.
    I am not able to get any of the forecast working after entering in my zip code, nor can I get the temperature for my outside temp sensor or internal humidity to show up.

    Any help would be greatly appreciated!

    Eric
  • amdpoweramdpower Junior Member Posts: 110
    Have you tried other known zip codes? Try 43026. That is where I live and I know it works. Did you define everything in the main file as per my example? Thanks.
  • trx250r87trx250r87 Junior Member Posts: 31
    What do I need to do to access the internet from my home router? Anything special?
    Eric
  • amdpoweramdpower Junior Member Posts: 110
    Well, your controller needs to be able to access the internet. Are you using static or DHCP? If it isn't DHCP, then you need to manually enter your gateway and DNS entries in Diagnostics --> Network Addresses.
  • trx250r87trx250r87 Junior Member Posts: 31
    I'm not sure why it wasn't working, but I tried again today and everything seems to be working correctly. Thank you!

    Now if I can only get the G4 web interface to work I would be all set. All I'm getting is a black screen after clicking on the link to my panel.

    ERIC
  • amdpoweramdpower Junior Member Posts: 110
  • pdabrowskipdabrowski Aussie Guy Posts: 184
    trx250r87 wrote: »
    Now if I can only get the G4 web interface to work I would be all set. All I'm getting is a black screen after clicking on the link to my panel.
    That's due to the usual thing if the Java incompatibility with newer OS'es.

    You'll also get the same with a vanilla install of V4 of RealVNC to view G4 panels, I've found that in the viewer options you need to check "Always use best available color quality" in the advanced options.

    It was never a problem with V3 though so I keep a copy of the original V3 binary folder on a USB stick that works well without needing to be installed.
  • Andrew MartinAndrew Martin Junior Member Posts: 11
    it works perfectly - for UK data - thank you!

    Hello there Jack,
    Thank you for the module. It is the first time I have has UK weather data working.

    This is what I love about the AMX forums. Jack builds a module that works, and then allows other programmers to download it to play with. Very public spirited of you Jack, thank you.

    Take care,

    Andrew
  • amdpoweramdpower Junior Member Posts: 110
    No problem! Glad it worked out for you. Software was meant to be "free" in my opinion. :)
  • DavidRDavidR Junior Member Posts: 62
    Forecast days 3, 4 and 5 no longer are reporting... could there have been a change on Yahoo's side?
  • amdpoweramdpower Junior Member Posts: 110
    Darn.... It would appear so. I only see two days when I bring this up.

    http://xml.weather.yahoo.com/forecastrss/43026_f.xml

    I'll have to look into it later.
  • the8thstthe8thst Junior Member Posts: 470
    change the URL to:
    http://xml.weather.yahoo.com/forecastrss/43026&d=5.xml

    That will give you a 5 day forecast. Change the d=# parameter to specify the number of days to return. The API supports up to a 10 day forecast now.
  • amdpoweramdpower Junior Member Posts: 110
    Awesome! Thank you!
  • amdpoweramdpower Junior Member Posts: 110
    I've updated the module to include the changes. You can still pass the Fahrenheit and Celsius variables in the link as well. Newest version of the module is available on my website.

    http://www.jackkolesar.com/code.html

    Thanks again for the tip.
  • ajish.rajuajish.raju chief evangelist of favante Posts: 185
    Basic Weather Module

    Thanks Jack for the module, saved my client a few licenses.

    I did some modifications in your module so that it only does the weather rss process. I also changed to BMP and !T send commands after testing with G4 panels.

    The tp file attached doesnt have any images since due to file size restrictions, i was not able to upload with images. The images are same from the previous files but only the channel numbers are changed in the TP.
  • amdpoweramdpower Junior Member Posts: 110
    Cool. Thanks for the contribution Ajish.
  • trx250r87trx250r87 Junior Member Posts: 31
    Y-Weather

    Would anyone be interested in adding a couple items to this module?
    -external temperature probe reading
    -some type of fan circulation mode where it turns the furnace fan on, say 30% more

    It would be greatly appreciated!

    Eric
  • amdpoweramdpower Junior Member Posts: 110
    Man... Hate the iPhone sometimes... Had a response written and just fat-fingered something... Anyway, external temp should be trivial and just a level. The circulation mode is quite interesting. I'll look into it when I get my system put back together (just moved). We could do something like choose a minimum run time per day and then track fan usage and correct every couple hours or so. I like the idea as it saves energy over constantly running or depending soley on heat/cool. Thanks for the suggestion!
Sign In or Register to comment.