Author Topic: Virtual Rain Sensor  (Read 31936 times)

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: Virtual Rain Sensor
« Reply #15 on: April 26, 2014, 01:05:08 pm »
Great plugin idea!
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline Faber Optime

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #16 on: April 26, 2014, 05:14:20 pm »
Thank you for your reply and sorry for being on the front end of testing. :)
No probs good sir, thank you for your ongoing, sterling work! :)

Pleased to report that with your kind assist, have made progress and seem to have successfully achieved working sensor - just awaiting the essential real life local rain to further explore...  ::)

In feedback:
  • My resolution was to install plugin and correct the Location setting.
    • I think v2.1 your code brilliantly uses any WUnderground key, location and/or unit plugin settings it finds as the defaults for the newly created VRain Sensor.
    • Since I installed plugin after having already manually installed v2.1 from this thread's zip, not sure if settings were inherited or if plugin also does this too?
    • Anyhow, top banana and massive kudos for this key integration point well delivered, but I have my WUnderground plugin configured to my specific personal weather station, using this for my location: pws:IAUCKLAN163
    • This works just fine in WUnderground plugin, but it appears this use case at present not (yet) supported by the VRain plugin (feature request! :) ).
    • So correcting the VRain plugin Location from its pws code defaulted from WUnderground plugin to lat,long transcribed from WUnderground page for PWS, appears to have done the trick.
    • Doh! Kickself.  :o
      Pays to read the small print!
      Not as if the settings page doesn't say it explicity right where it should!!
  • Icon prob found to be un poisson rouge - once I corrected the Location and plugin was able to successfully update data, cog icon evaporated. In retrospect, I think the plugin icon behaviour was correct and that I was just being impatient.  ;)
  • I believe what is happening is a conflict between your system time zone and the time zone of the location you selected.  Is your Vera system time set properly for your time zone(shown in top right corner)? What are you using as your location? 
    FYI I'm based in Auckland, New Zealand, so do have +12h local time zone; all clocks on my local 'net synced to same time server as vera. Just have accum & forcast precip period set to Today and data appearing as expected. Let me know if you'd like me to experiment with a few different test cases if you want.
  • RE Chrome/UI5 Save & Update button being hidden, also confirmed prob on latest Firefox, ok on IE11.

Thanks again for the great work mate.

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: Virtual Rain Sensor
« Reply #17 on: April 27, 2014, 05:07:09 am »
@blakem I uninstalled and deleted all files from the manually installed version then installed and configured the plugin from the App Store. It seemed ok for a few hours, but now I am getting this error:

VRainSensor : Error!, summary section not found in history data.

Please let me know if there is anything I can do to help figure out what the issue is. Thanks!


Sent from my iPhone using Tapatalk

Offline blakem

  • Sr. Newbie
  • *
  • Posts: 47
  • Karma: +7/-0
Re: Virtual Rain Sensor
« Reply #18 on: April 27, 2014, 08:20:24 am »
@faberoptime, thank you for posting your solution.  It did shed some light on the way that weather underground forms their database.  It looks like personal weather stations only have hourly observations available in the history and no daily summary.  I need to add changes to the plugin to look at these observations when the summary is not available.

Also I looked into your case and it appears that the 2 airports near you do not report precipitation.  In your case, using the latitude and longitude for the location will probably never show anything other than 0 precipitation until I fix the plugin and you use your personal weather station for the location.

@mda, what is the location you are using?  I assume it will be the same issue that faberoptime is experiencing but it may be different.

Offline mda

  • Sr. Member
  • ****
  • Posts: 464
  • Karma: +9/-0
Re: Virtual Rain Sensor
« Reply #19 on: April 27, 2014, 02:39:51 pm »
@blakem - i sent you a PM. thanks!

Offline destinet

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #20 on: April 29, 2014, 01:43:18 pm »
Any idea of how this is usefull? Try to think but can't find a way to use it:(

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Virtual Rain Sensor
« Reply #21 on: April 29, 2014, 02:30:13 pm »
you can affect your irrigation controller.

e.g. if it rained yesterday, don't need to water today.

Offline blakem

  • Sr. Newbie
  • *
  • Posts: 47
  • Karma: +7/-0
Re: Virtual Rain Sensor
« Reply #22 on: April 29, 2014, 05:13:23 pm »
Any idea of how this is usefull? Try to think but can't find a way to use it:(
It was developed to suspend the automatic schedule of an irrigation system, but I am sure there could be many more applications. 

To use it add a trigger for a scene when the "Tripped" device variable is a value of "1" meaning it has or will rain or a value of "0" when there is no rain.

You could also use it just like a basic rain gauge by reading the "PrecipitationTotal" device variable.  For instance if you set the accumulated precipitation period to today only and the forecast to none.  You can get the total amount of precipitation that has fallen for today.

Offline BulldogLowell

  • Hero Member
  • *****
  • Posts: 1576
  • Karma: +191/-85
Re: Virtual Rain Sensor
« Reply #23 on: April 30, 2014, 10:23:50 pm »
@Bulldoglowell, I designed it so if there are 5 consecutive communication failures it will set the device into failure.  The idea was to notify the user that it is not updating.  In the latest version 2.1 I write errors to the task status bar on the UI so that feature is not really that important now.  If it becomes a nuisance it could be removed easily.  In any case if the communication issue resolves itself then the plugin will continue to function again even though it shows a device failure.  A reload will clear the failure flag.

Also worth noting there were some quirks with version 1.0 that are now resolved with version 2.1 that could have caused the device failure to report needlessly.  It should be a nonissue now but please let me know of any problems you might have with the latest.

The 5 inches of rain today reminded me to let you know all is working very well...

Again, great little plugin,  I feel bad having to tear out all that Lua and PLEG I cobbled together to do what your plugin does so elegantly. :)

Offline Faber Optime

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #24 on: May 02, 2014, 05:56:40 pm »
Apologies for the delayed reply - adventures elsewhere have kept me busy.
From the read of your latest update to original post, sounds like v2.4 may be cure for my ills - kudos for the rapid updates!
That said, looks like I'm awaiting this to be propagated via Via App update?
I'm presently still stuck on V2.2 and reinstalling showed Install Apps list still advertising v2.2 as well. :(
Say I don't suppose that you'd be prepared to attach most recent version's files to this thread to enable eager beavers such as I to do a manual, interim update prior to App being automatically updated? :)
Thanks again for all the valuable, ongoing work.

p.s. FYI my continuing testing concurs with your stated findings on my and other cases.
« Last Edit: May 02, 2014, 05:59:41 pm by faberoptime »

Offline blakem

  • Sr. Newbie
  • *
  • Posts: 47
  • Karma: +7/-0
Re: Virtual Rain Sensor
« Reply #25 on: May 02, 2014, 07:20:29 pm »
The 5 inches of rain today reminded me to let you know all is working very well...

Again, great little plugin,  I feel bad having to tear out all that Lua and PLEG I cobbled together to do what your plugin does so elegantly. :)

Wow 5 inches, that is substantial. 

Thank you, I am glad someone else could use it.  Actually I thought what you had seemed to work good, but for me I would have always wondered if it would have set when it really never rained or rained very little.

Apologies for the delayed reply - adventures elsewhere have kept me busy.
From the read of your latest update to original post, sounds like v2.4 may be cure for my ills - kudos for the rapid updates!
That said, looks like I'm awaiting this to be propagated via Via App update?
I'm presently still stuck on V2.2 and reinstalling showed Install Apps list still advertising v2.2 as well. :(
Say I don't suppose that you'd be prepared to attach most recent version's files to this thread to enable eager beavers such as I to do a manual, interim update prior to App being automatically updated? :)
Thanks again for all the valuable, ongoing work.

p.s. FYI my continuing testing concurs with your stated findings on my and other cases.

Thank you for identifying the problem with personal weather stations.  It turns out that when I called the history before it would always get the data from the nearest airport but now with v2.4 it uses the history from the station that the weather underground api returned for the current conditions.  This way the api determines the source of the history data.  I currently enter the lat long of my house and it should now get the data from the nearest weather station that is online.

One thing that I found during testing is sometimes personal weather stations go offline for a day.  In that case you will see a "N/A" for not available.

I used your location for one of my test cases and it worked with no problems.  I also did not have to adjust any clocks for the time zone difference.  The date is now completely driven by the weather location.

EDIT: Version 2.4 available in app store so attachment removed.
« Last Edit: May 05, 2014, 06:24:20 pm by blakem »

Offline Faber Optime

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #26 on: May 04, 2014, 03:01:59 am »
The 5 inches of rain today reminded me to let you know all is working very well...

Again, great little plugin,  I feel bad having to tear out all that Lua and PLEG I cobbled together to do what your plugin does so elegantly. :)

Wow 5 inches, that is substantial. 

Thank you, I am glad someone else could use it.  Actually I thought what you had seemed to work good, but for me I would have always wondered if it would have set when it really never rained or rained very little.

Apologies for the delayed reply - adventures elsewhere have kept me busy.
From the read of your latest update to original post, sounds like v2.4 may be cure for my ills - kudos for the rapid updates!
That said, looks like I'm awaiting this to be propagated via Via App update?
I'm presently still stuck on V2.2 and reinstalling showed Install Apps list still advertising v2.2 as well. :(
Say I don't suppose that you'd be prepared to attach most recent version's files to this thread to enable eager beavers such as I to do a manual, interim update prior to App being automatically updated? :)
Thanks again for all the valuable, ongoing work.

p.s. FYI my continuing testing concurs with your stated findings on my and other cases.

Thank you for identifying the problem with personal weather stations.  It turns out that when I called the history before it would always get the data from the nearest airport but now with v2.4 it uses the history from the station that the weather underground api returned for the current conditions.  This way the api determines the source of the history data.  I currently enter the lat long of my house and it should now get the data from the nearest weather station that is online.

One thing that I found during testing is sometimes personal weather stations go offline for a day.  In that case you will see a "N/A" for not available.

I used your location for one of my test cases and it worked with no problems.  I also did not have to adjust any clocks for the time zone difference.  The date is now completely driven by the weather location.

I attached the files that changed in V2.4 so install the V2.2 plugin in the app store then manually upload these 3 files.  This way it can be automatically updated in the future.  I will remove these files once the new version is approved in the app store.  Let me know how it works.  There may be more issues.

Installed fresh v2.2 sensor via app store then uploaded the three files to Vera - no worries.
WUnderground plugin details correctly pulled over (although not units?), anyhow with no error, plugin had apparently behaved as expected, with valid data shown on data tab and pws noted as source. Sweet!  ;D

So looking good and now awaiting rain. :)

Thanks again for all the work good sir!

Offline Faber Optime

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #27 on: May 09, 2014, 05:19:42 am »
Just wanted to report back that v2.4 has been working flawlessly for me just as advertised for days now. Although have only checked it irregularly, have seen both triggered when raining, untriggered latterly and triggered again on a different occasion.
Changing config and update has been working without problem and haven't seen a lua error reported since (v2.4) installation through multiple reboots.

Now a great, functional complement to the WUnderground plugin.

Top banana blakem ;D

Online Freddan101

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +12/-2
Re: Virtual Rain Sensor
« Reply #28 on: May 10, 2014, 01:26:41 am »
Would it make sense to add the past/current/forecast tempterature to the formula to indicate if watering is needed?

Offline theal

  • Jr. Member
  • **
  • Posts: 51
  • Karma: +0/-3
Re: Virtual Rain Sensor
« Reply #29 on: May 12, 2014, 11:08:30 am »
Awesome plugin and thanks for forecast fast fix with v.2.5!

Few suggestions on future development:
- display values in Dashboard plugin interface: total, past & forecast, last pull time
- pull and display all available days, not just threshold days
- separate parameter for each day (.., d-2,d-1,d0,d1,..)
- probability for each forecast day
- multiple stations/plug-ins for averaging/failover between two/several stations

Thanks again!