We have moved at community.getvera.com

Author Topic: Virtual Rain Sensor  (Read 54002 times)

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Virtual Rain Sensor
« Reply #150 on: June 03, 2018, 12:00:19 pm »
Last time the one or the other of the wunderground-updates during a day delivers wrong values. In this cases the field "TodaysDate" is wrong (at this time 1/3/2018).
So the trip/untrip result is wrong.

I didn't want to change the original app. Instead I addded a lua check into the scene switching the irrigation system (-> if TodaysDate is wrong then ignore the change of trip):

local TodaysDate=luup.variable_get("urn:upnp-org:serviceId:VRainSensor","TodaysDate",<deviceNr>)
local m=os.date("%m")
local M=tonumber(m)
local d=os.date("%d")
local D=tonumber(d)
local sArg=mySplit(TodaysDate,"/")
if M ~= tonumber(sArg[1]) or D ~= tonumber(sArg[2]) then
 return false
end

Interesting but this does not help you get the correct data until the next poll and still gives you the wrong status on the device. Why not update the plugin instead?
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline pit

  • Sr. Newbie
  • *
  • Posts: 45
  • Karma: +3/-0
Re: Virtual Rain Sensor
« Reply #151 on: June 04, 2018, 09:46:18 am »
I've tried to get correct data with a sudden manual update, but this didn't work immediatetely in all cases -and there is a time limit for updates. So my way is to ignore incorrect data untill a poll delivers correct data.

The wrong state on the virtual rain sensor device is not a problem for me. Critical for me is the state of the relay switch, which controls the irrigation system. Ths relay switch is triggered by all trips/untrips of the virtual rain sensor, but only changed if the TodaysDate in that moment is correct.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Virtual Rain Sensor
« Reply #152 on: June 04, 2018, 11:42:12 pm »
I've tried to get correct data with a sudden manual update, but this didn't work immediatetely in all cases -and there is a time limit for updates. So my way is to ignore incorrect data untill a poll delivers correct data.

The wrong state on the virtual rain sensor device is not a problem for me. Critical for me is the state of the relay switch, which controls the irrigation system. Ths relay switch is triggered by all trips/untrips of the virtual rain sensor, but only changed if the TodaysDate in that moment is correct.

Well the whole purpose of the update is to avoid doing this. It will retry to get the new data every minute until it gets it and you do not need to use some complicated code to ignore the bad data in your Luup scene. You also don?t need to stop your irrigation from turning on when the data is incorrect since you have obtained correct data before so it will use the previous dataset until it gets a new valid one.
« Last Edit: June 22, 2018, 10:05:39 am by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline nelieto060

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-1
Re: Virtual Rain Sensor
« Reply #153 on: June 22, 2018, 07:37:15 am »
I don't have an answer for you. But I am suggesting some rain sensor which can give you an accurate result.

Offline nelieto060

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-1
Re: Virtual Rain Sensor
« Reply #154 on: June 22, 2018, 07:41:26 am »
I don't have an answer for you. But I am suggesting some rain sensor which can give you an accurate result.

Offline unissani

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #155 on: September 12, 2018, 08:05:08 am »
Hi,
is this service from Wunderground no longer free?

https://www.wunderground.com/weather/api

"To improve our services and enhance our relationship with our users, we will no longer provide free weather API keys as part of our program. If you have been directed to download our Weather Underground free API key by a third party provider, please contact your vendor for resolution"

Any alternative?
Thanks
Uri

Offline jswim788

  • Hero Member
  • *****
  • Posts: 809
  • Karma: +58/-2
Re: Virtual Rain Sensor
« Reply #156 on: September 12, 2018, 02:09:39 pm »
If you already have an account it appears to continue working for now.  If you don't have an account, see: http://forum.micasaverde.com/index.php?topic=84948.0

OpenWeather and DarkSky appear to be the top 2 choices.

Offline Mike Yeager

  • Hero Member
  • *****
  • Posts: 603
  • Karma: +11/-12
Re: Virtual Rain Sensor
« Reply #157 on: September 13, 2018, 04:13:36 pm »
I use DarkSky with a 2 minute polling interval. It's quite accurate for my needs and I've even coded a variable rain delay for the irrigation system off of it. I'd be happy to share it, but you'd have to re-engineer it for Vera as I've moved that off to my Home Assistant instance.

Offline icare

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #158 on: March 07, 2019, 09:17:15 am »
As a PWS uploading to wunderground, I have been furnished with a new key. However, the new API key is  32 characters long. The older key format was only 16 characters long. Using the new key, the sensor reports back "wrong-key" although the key is functioning in the following statement:
https://api.weather.com/v2/pws/observations/current?stationId=STATIONID&format=json&units=m&apiKey=32charlong
Is there is format restriction built into Vtainsensor inhiiting from accepting the new key?

Offline warren64c

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #159 on: March 09, 2019, 05:19:01 pm »
Has anyone figured this out?  I have the same problem not accepting a longer key.....

Offline HSD99

  • Sr. Member
  • ****
  • Posts: 384
  • Karma: +21/-0
Re: Virtual Rain Sensor
« Reply #160 on: March 09, 2019, 07:14:44 pm »
As a PWS uploading to wunderground, I have been furnished with a new key. However, the new API key is  32 characters long. The older key format was only 16 characters long. Using the new key, the sensor reports back "wrong-key" although the key is functioning in the following statement:
https://api.weather.com/v2/pws/observations/current?stationId=STATIONID&format=json&units=m&apiKey=32charlong
Is there is format restriction built into Vtainsensor inhiiting from accepting the new key?
How did you get your new key? I also have a PWS uploading to WU.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Virtual Rain Sensor
« Reply #161 on: March 10, 2019, 11:36:19 pm »
As of March 5th The WU service completely stopped working so my plugin has been disabled. When I get the time in the spring, I may try to get this plugin to connect to another service. I don't really have the time needed to work on it right now.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline HSD99

  • Sr. Member
  • ****
  • Posts: 384
  • Karma: +21/-0
Re: Virtual Rain Sensor
« Reply #162 on: March 11, 2019, 01:58:33 pm »
As of March 5th The WU service completely stopped working so my plugin has been disabled. When I get the time in the spring, I may try to get this plugin to connect to another service. I don't really have the time needed to work on it right now.

Same here. Last update was March 5.

Offline Don Phillips

  • Hero Member
  • *****
  • Posts: 1464
  • Karma: +41/-36
Re: Virtual Rain Sensor
« Reply #163 on: March 11, 2019, 08:00:11 pm »
I had the same experience. I am using the Virtual Temperature plug-in since that is critical for thermostat heating/cooling setting in PLEG. With a predicted high of 68F Thursday, I expect the thermostat will change to cooling mode. 

The sky conditions was helpful for turning on/off exterior lights earlier/later when cloudy or rainy. I ended up removing the WU plug-in altogether.

If someone can figure out how to get to the sky conditions data in Vera, that would be awesome.
Vera 3, 1.7.1040, CT101, Everspring Motion, GE/Jasco Switch/Dimmer, Leviton outlet, AeonLabs sensor, NuTone garage door, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual/Multi Switch, LB60Z-1 bulb, Hue, Alexa, Zooz 4-1

Offline Mike Yeager

  • Hero Member
  • *****
  • Posts: 603
  • Karma: +11/-12
Re: Virtual Rain Sensor
« Reply #164 on: March 12, 2019, 12:09:53 am »
Use DarkSky. You can poll the API every 3-5 minutes and it gives you all the data you need...