How Rain sensor works ?

Moderator: leecollings

Post Reply
user10
Posts: 6
Joined: Tuesday 02 July 2019 9:39
Target OS: Linux
Domoticz version:
Contact:

How Rain sensor works ?

Post by user10 »

Rain sensor - how it works ?
Hi
I try to run rain sensor, and i can't understand how it works
i use json command to update sensor.

So
Sensor idx = 10

Day 1
no rain
What should i Send to domoticz to report no rain ?

http://localhost:8080/json.htm?type=com ... svalue=0;0 ?

8:00 AM Start raining. 1 mm rain.
I should send
http://localhost:8080/json.htm?type=com ... alue=100;1 ?

next the rain is raining and milimiters increasae ,so i send
http://localhost:8080/json.htm?type=com ... alue=200;2 ?
http://localhost:8080/json.htm?type=com ... alue=300;3 ?
http://localhost:8080/json.htm?type=com ... alue=400;4 ?


after hour - now is 9:00, what shoult i sent to reset rain rate ?
http://localhost:8080/json.htm?type=com ... svalue=0;4 ?
or again
http://localhost:8080/json.htm?type=com ... alue=400;4 ?


and if rain starts falling at 9:30 i what should i send ?
http://localhost:8080/json.htm?type=com ... alue=100;5 ?
or
http://localhost:8080/json.htm?type=com ... alue=500;5 ? (500 because last rain rate was 400) ?


And next day.

if the rain doesnt raining the correct message will be
http://localhost:8080/json.htm?type=com ... svalue=0;6 ?
or
http://localhost:8080/json.htm?type=com ... svalue=0;5 ?

how get the corrent counter value ? i try

http://localhost:8080/json.htm?type=devices&rid=10 and receive

"ActTime" : 1562052122,
"AstrTwilightEnd" : "00:00",
"AstrTwilightStart" : "00:00",
"CivTwilightEnd" : "21:44",
"CivTwilightStart" : "03:30",
"DayLength" : "16:38",
"NautTwilightEnd" : "22:60",
"NautTwilightStart" : "02:15",
"ServerTime" : "2019-07-02 09:22:02",
"SunAtSouth" : "12:37",
"Sunrise" : "04:18",
"Sunset" : "20:56",
"app_version" : "4.10717",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "0",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 19,
"HardwareName" : "WeatherStation",
"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal" : 15,
"HaveTimeout" : false,
"ID" : "140F2",
"LastUpdate" : "2019-07-02 09:21:45",
"Name" : "WeatherStation Rain Guage",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"Rain" : "0",
"RainRate" : "0",
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "TFA",
"Timers" : "false",
"Type" : "Rain",
"TypeImg" : "rain",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "10"
}
],
"status" : "OK",
"title" : "Devices"
}


The Data, Rain, RainRate is 0.
i made some tests and cant figure out how it works :-(
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: How Rain sensor works ?

Post by Toulon7559 »

What mark&type of rain sensor are you using?

Interfacing as rain gauge to RFXCom or to RFLinkGateway?
If Yes, you probably already read the data to a Device of Domoticz, but did you activate the Device in Setup/ List of Devices?
If No, what kind of integration/interfacing are you planning for this rain gauge towards Domoticz?
Last edited by Toulon7559 on Tuesday 02 July 2019 11:44, edited 2 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: How Rain sensor works ?

Post by emme »

rain sensor is a simple ON/OFF switch.... it is NOT a rain gauge

are you talking about a rain gauge (a device that counts mm2 of rain in a specific area....)?
for gauge you have to follow the syntax:
&nvalue=0&svalue=RAINRATE;RAINCOUNTER where
RAINRATE = amount of rain in last hour in [mm x 100]
RAINCOUNTER = continues counter of fallen Rain in [mm]
so I assume it should be:
svalue=100;100
svalue=100;200 after 1 hour
svalue=100;300 after 1 hour
and so on
The most dangerous phrase in any language is:
"We always done this way"
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: How Rain sensor works ?

Post by Toulon7559 »

@emme

You're right

Rain sensor of @user10 perhaps is a simple device like in picture.
Rain_sensor
Rain_sensor
regensensor.jpg (61.47 KiB) Viewed 2556 times
Measured value is resistance between the 'lines' on the board => analogue signal
Based on this analogue signal a schmittrigger generates a logic 0/1 dependent on setting.
Interfacing can be analogue by ADC or digital by GPIO.
Functionally it is simple indication THAT it rains, not volume of rain:
at best, the analogue signal is an indicative differentiation of drought, fog, sleeth or 'real' rain

Similar to the 'fork'-sensor used as a gimmick to control flower-watering.
Ground_probe
Ground_probe
humgrondprobe.jpg (40.4 KiB) Viewed 2551 times
Last edited by Toulon7559 on Wednesday 03 July 2019 8:58, edited 3 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: How Rain sensor works ?

Post by emme »

ok, so that is a simple ON/OFF switch....
so you have to follow the lightswitch command (so delete the rain device and create a new one as switch):
/json.htm?type=command&param=switchlight&idx=10&switchcmd=On when it rains and
/json.htm?type=command&param=switchlight&idx=10&switchcmd=Off when it stop raining
The most dangerous phrase in any language is:
"We always done this way"
user10
Posts: 6
Joined: Tuesday 02 July 2019 9:39
Target OS: Linux
Domoticz version:
Contact:

Re: How Rain sensor works ?

Post by user10 »

Toulon7559 wrote: Tuesday 02 July 2019 11:32 What mark&type of rain sensor are you using?

Interfacing as rain gauge to RFXCom or to RFLinkGateway?
If Yes, you probably already read the data to a Device of Domoticz, but did you activate the Device in Setup/ List of Devices?
If No, what kind of integration/interfacing are you planning for this rain gauge towards Domoticz?
I develop my own weather station on arduino, and build own rain guage with TCS5000 sensor
user10
Posts: 6
Joined: Tuesday 02 July 2019 9:39
Target OS: Linux
Domoticz version:
Contact:

Re: How Rain sensor works ?

Post by user10 »

emme wrote: Tuesday 02 July 2019 11:40 rain sensor is a simple ON/OFF switch.... it is NOT a rain gauge

are you talking about a rain gauge (a device that counts mm2 of rain in a specific area....)?
for gauge you have to follow the syntax:
&nvalue=0&svalue=RAINRATE;RAINCOUNTER where
RAINRATE = amount of rain in last hour in [mm x 100]
RAINCOUNTER = continues counter of fallen Rain in [mm]
so I assume it should be:
svalue=100;100
svalue=100;200 after 1 hour
svalue=100;300 after 1 hour
and so on
https://www.domoticz.com/wiki/Domoticz_API/JSON_URL

Rain
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=RAINRATE;RAINCOUNTER
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
RAINRATE = amount of rain in last hour in [mm x 100]
RAINCOUNTER = continues counter of fallen Rain in [mm]

no it is not work for me like you wrote
user10
Posts: 6
Joined: Tuesday 02 July 2019 9:39
Target OS: Linux
Domoticz version:
Contact:

Re: How Rain sensor works ?

Post by user10 »

i found https://www.domoticz.com/forum/viewtopic.php?t=7840
and gizmocuz worte
you should use/request the V_VAR1 when your node starts (powers up), so the last counter value is retrieved
dont send anything until you got this
and
you need to send to domoticz the counter value, this counter need to always increase!
i thing V_VAR is used for mysensors.
but how what parameter the v_var represents ?
"ActTime" : 1562059425,
"AstrTwilightEnd" : "00:00",
"AstrTwilightStart" : "00:00",
"CivTwilightEnd" : "21:44",
"CivTwilightStart" : "03:30",
"DayLength" : "16:38",
"NautTwilightEnd" : "22:60",
"NautTwilightStart" : "02:15",
"ServerTime" : "2019-07-02 11:23:45",
"SunAtSouth" : "12:37",
"Sunrise" : "04:18",
"Sunset" : "20:56",
"app_version" : "4.10717",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "600;6",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 19,
"HardwareName" : "StacjaPogody",
"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal" : 15,
"HaveTimeout" : false,
"ID" : "14114",
"LastUpdate" : "2019-07-02 11:17:33",
"Name" : "Rain",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"Rain" : "3.0",
"RainRate" : "6",
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "TFA",
"Timers" : "false",
"Type" : "Rain",
"TypeImg" : "rain",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "10"
I create new Rain Device
In domoticz i see
Rate =0 mm/h and 0
IDX = 197
i send
http://localhost:8080/json.htm?type=com ... svalue=0;0
domoticz update last seen time and Show Rate = 0 mm/h, 0
rain starts at 15:10 and will rain to 15:34.
i will send several update command
http://localhost:8080/json.htm?type=com ... alue=100;1
http://localhost:8080/json.htm?type=com ... alue=200;2
http://localhost:8080/json.htm?type=com ... alue=300;3
http://localhost:8080/json.htm?type=com ... alue=400;4
http://localhost:8080/json.htm?type=com ... alue=500;5
till now, everything works fine.
Rate = 5 mm/h, and 5 in top right corner.

at 15:49 rain stops.
what should i send to say domoticz the rain is stopped ?
http://localhost:8080/json.htm?type=com ... svalue=0;5
or
http://localhost:8080/json.htm?type=com ... alue=500;5

I thing correct will be http://localhost:8080/json.htm?type=com ... alue=500;5
because 15:49 is in the same hour as rain. so i report that the last send value is still correct.

but on 16:00 I should send
http://localhost:8080/json.htm?type=com ... svalue=0;5
because there is no Rain after 16:00
am i correct ?
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: How Rain sensor works ?

Post by emme »

I assume it is RAINRATE
The most dangerous phrase in any language is:
"We always done this way"
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: How Rain sensor works ?

Post by Toulon7559 »

I develop my own weather station on arduino, and build own rain guage with TCS5000 sensor
For 'TCS5000' no Google-hit which seems near your application.

Just curious, and perhaps you can explain a bit more the setup of your rain gauge.

Do you mean TCRT5000 as a 'switch/count'-sensor?
Then possibly the application of a 'general' counter-interface for Domoticz is more appropriate:
see Wiki and Forum.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest