Author Topic: Virtual Rain Sensor  (Read 41333 times)

Offline blakem

  • Sr. Newbie
  • *
  • Posts: 49
  • Karma: +7/-0
Re: Virtual Rain Sensor
« Reply #135 on: May 26, 2017, 08:19:32 pm »
I am not on UI7 yet so I cannot answer but it sounds like you have the right idea.

Sent from my A0001 using Tapatalk


Offline icare

  • Jr. Member
  • **
  • Posts: 78
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #136 on: May 27, 2017, 02:53:00 pm »
The following code I use to switch ON/OFF the sprinkler based on a start/stop schedule and treshold set in vrain plugin:
-- Get current status sprinkler switch
local switch_status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", id_sprinkler)

-- If switch is ON THEN switch it off
if (switch_status == "1")
then
-- Turn Sprinkler OFF
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "0"}, id_sprinkler)
return true
else
--Switch Sprinkler ON depending on vrain
--Force update virtual rain sensor(this step optional)
luup.call_action("urn:upnp-org:serviceId:VRainSensor", "Update", {}, id_vrain)
--Get current state virtual rain sensor
local rain = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1","Tripped", id_vrain)
if (rain == "0")
then
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },id_sprinkler)
-- Register action in database
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "3"}, 0)
return true

else
return false
end
end

Offline williams2353

  • Sr. Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #137 on: May 27, 2017, 03:47:44 pm »
"I would try to do a reboot or power off and see if it allows you to either continue the uninstall or allows you to install."

I tried that, still no luck.  Also tried a different browser, same results.



Offline williams2353

  • Sr. Newbie
  • *
  • Posts: 21
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #138 on: May 28, 2017, 08:38:51 am »
Here is what the apps.mios.com page returns when I try to uninstall the Virtual Rain Sensor:


Offline rjspindler

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #139 on: July 17, 2017, 11:20:55 am »
Icons not displaying, please advise.  Installed app v3.2 on VeraEdge/UI7 from the Install Apps menu.

Offline kwieto

  • Hero Member
  • *****
  • Posts: 539
  • Karma: +20/-11
Re: Virtual Rain Sensor
« Reply #140 on: September 11, 2017, 09:15:34 am »
I have the same problem - no icon displaying

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1103
  • Karma: +52/-21
Re: Virtual Rain Sensor
« Reply #141 on: September 11, 2017, 01:18:07 pm »
I have customized this app with my own icons. I did not like the default ones but it appears the that they are also no longer reachable. I suspect the server hosting them is down. Try uploading this file into the apps/develop apps/luup files. You will be pulling the icons I am hosting.
openLuup (93 devices, 122 scenes, 20 apps) controlling HomeAss + VeraPlus (133 zwave nodes, 8 Zigbee nodes, 203 devices, 34 scenes , 3 apps) Bridged to Homekit and Alexa

Offline m13kern

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #142 on: November 15, 2017, 01:05:33 am »
Hi, I have the same issue; no icons.

I have my own icons I would like to use but am new at this, what do you need to change on the code (It enters them into a default directory I have read) and how do you load just the icons into a directory?

Thanks in advance

Offline halo

  • Sr. Newbie
  • *
  • Posts: 49
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #143 on: April 23, 2018, 02:25:41 pm »
Hi,

Just wondering, if it is possible to present this plugin in ImperiHome?
Currently plugin is not recognized by ImperiHome.

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1103
  • Karma: +52/-21
Re: Virtual Rain Sensor
« Reply #144 on: April 23, 2018, 03:24:47 pm »
Hi, I have the same issue; no icons.

I have my own icons I would like to use but am new at this, what do you need to change on the code (It enters them into a default directory I have read) and how do you load just the icons into a directory?

Thanks in advance

Missed this question. Sorry if it is a bit late. Look into the json file I posted. All you have to do is to change the "img:" line and modify it to point to the icon you want. It can be either local on your vera or remote through a web host. I chose the latter. If local I recommend you type the full path.
openLuup (93 devices, 122 scenes, 20 apps) controlling HomeAss + VeraPlus (133 zwave nodes, 8 Zigbee nodes, 203 devices, 34 scenes , 3 apps) Bridged to Homekit and Alexa

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1103
  • Karma: +52/-21
Re: Virtual Rain Sensor
« Reply #145 on: May 09, 2018, 11:51:54 am »
I discovered a potential bug coming from the wunderground API. For the station I chose, it intermittently sends data from the past which causes the plugin to get wrong information.
Specifically I often get TodaysDate as 1/3/2018 while we are in May. I have made some changes to the plugin so that the time update polled from the API cannot go back in time. PM me if anybody wants it.

Edit:

As posted in various forums, the WU API frequently sends garbage data with wrong dates and some times wrong forecast. When this happens the VRainSensor is wrongly tripped and can lead your plants to dry up if you rely on it for your irrigation. :).

I modified the plugin in order to make it even more resilient. It will not update it's data if it get's garbage out of the API and instead will retry every minute until it gets good data. I tested it on Openluup but should have no problem working on UI7.
« Last Edit: May 11, 2018, 09:01:51 pm by rafale77 »
openLuup (93 devices, 122 scenes, 20 apps) controlling HomeAss + VeraPlus (133 zwave nodes, 8 Zigbee nodes, 203 devices, 34 scenes , 3 apps) Bridged to Homekit and Alexa

Offline Ryanoc75

  • Jr. Member
  • **
  • Posts: 57
  • Karma: +0/-0
Re: Virtual Rain Sensor
« Reply #146 on: May 20, 2018, 09:08:54 pm »
Hey Raf,

  Thanks for making those changes.  To install, should I assume I just unzip open the Openluup folder and then drag and drop all 6 files in Develop Apps - luup files - upload files.  Is the D_VrainSensor.json file in that folder the same as the one 2 posts before?

Thanks   
Vera3 2gig Thermostat, Kwickset door lock, DSC Alarm Panel wiznet - IT100, 7 DSC motion Sens 4 DSC 3way sen, 5 DSC door cont,  Aeon HEM pwr mon, Aeon 4in1 multi sens, 8 GE dimmers, 8 GE switches, 15 Intermatic plugs, GC100 Wifi, 2 F/F Sens, 5 HA07 RFremotes, Siri Homekit Bridge 10 Cams, 4 SmrtSwitch

Offline bwillette

  • Sr. Newbie
  • *
  • Posts: 40
  • Karma: +2/-0
Re: Virtual Rain Sensor
« Reply #147 on: May 20, 2018, 10:15:45 pm »
As posted in various forums, the WU API frequently sends garbage data with wrong dates and some times wrong forecast. When this happens the VRainSensor is wrongly tripped and can lead your plants to dry up if you rely on it for your irrigation. :).

I modified the plugin in order to make it even more resilient. It will not update it's data if it get's garbage out of the API and instead will retry every minute until it gets good data. I tested it on Openluup but should have no problem working on UI7.

Thank you so much for contributing this back. I?ve been having problems related to this as well!

Offline rafale77

  • Hero Member
  • *****
  • Posts: 1103
  • Karma: +52/-21
Re: Virtual Rain Sensor
« Reply #148 on: May 21, 2018, 01:30:59 am »
Hey Raf,

  Thanks for making those changes.  To install, should I assume I just unzip open the Openluup folder and then drag and drop all 6 files in Develop Apps - luup files - upload files.  Is the D_VrainSensor.json file in that folder the same as the one 2 posts before?

Thanks   

I would recommend replacing all the files with the ones in the Zip file just to be sure even though I don't think I made any changes to the device json. All the files belong in the same folder indeed. Unless you installed openLuup elsewhere, it should be in /etc/cmh-ludl
openLuup (93 devices, 122 scenes, 20 apps) controlling HomeAss + VeraPlus (133 zwave nodes, 8 Zigbee nodes, 203 devices, 34 scenes , 3 apps) Bridged to Homekit and Alexa

Offline pit

  • Sr. Newbie
  • *
  • Posts: 31
  • Karma: +2/-0
Re: Virtual Rain Sensor
« Reply #149 on: June 03, 2018, 07:52:03 am »
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
« Last Edit: June 03, 2018, 08:01:38 am by pit »