Is it gonna rain within the next X minutes?

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
bertbigb
Posts: 137
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: Is it gonna rain within the next X minutes?

Post by bertbigb » Sunday 21 May 2017 12:27

I have the feeling that you didn't understood the instructions quite well.
This script shouldn't run like a so-called time or device script.
It is a script you fire from crontab at regular times. So to provide more help I would like to know the full path and name of the script. Make sure the script is disabled in the domoticz event screen. Ad the script to your crontab and fire it. Let's see what happens.


Verzonden vanaf mijn iPhone met Tapatalk
Best regards Bert

Synology DS1515+ - DSM 6.1
Raspberry PI2 - B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon

poudenes
Posts: 279
Joined: Wednesday 08 March 2017 10:42
Target OS: Linux
Domoticz version: 3.7392
Location: Amsterdam
Contact:

Re: Is it gonna rain within the next X minutes?

Post by poudenes » Sunday 21 May 2017 16:07

bertbigb wrote:I have the feeling that you didn't understood the instructions quite well.
This script shouldn't run like a so-called time or device script.
It is a script you fire from crontab at regular times. So to provide more help I would like to know the full path and name of the script. Make sure the script is disabled in the domoticz event screen. Ad the script to your crontab and fire it. Let's see what happens.


Verzonden vanaf mijn iPhone met Tapatalk
Clear answer. I will add it to crontab and see what happens
RPi3 with OSMC - RPi3 with Domoticz - Dashticz - MiLight - Nanolead Aurora - KaKu - Logitech Hamony - Nest - RFLink

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Is it gonna rain within the next X minutes?

Post by Derik » Wednesday 07 June 2017 18:49

Dear all. I use the sript from the wiki. [ is this the latest version ? ]

Use the build in Lua script in blockley..
Works fine.
Only 1 thing the script is running every second:

Code: Select all

2017-06-07 18:48:10	Voorlopig blijft het droog!
2017-06-07 18:48:10	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:08	Voorlopig blijft het droog!
2017-06-07 18:48:07	Voorlopig blijft het droog!
2017-06-07 18:48:06	Voorlopig blijft het droog!
2017-06-07 18:48:05	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:01	Voorlopig blijft het droog!
2017-06-07 18:47:58	Voorlopig blijft het droog!
2017-06-07 18:47:57	Voorlopig blijft het droog!
2017-06-07 18:47:56	Voorlopig blijft het droog!
2017-06-07 18:47:56	Voorlopig blijft het droog!
Or more..
Is there a solution for..
Looks not the best option for my Domoticz system..

Is there perhaps a sleep @ the end possible?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
jvdz
Posts: 1068
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Is it gonna rain within the next X minutes?

Post by jvdz » Wednesday 07 June 2017 19:04

So you used the build in editor and probably have selected to act on each event instead of just time events ( every minute)?
It is the dropdown box underneath the Lua selection box.

Jos

BarryT
Posts: 222
Joined: Tuesday 31 March 2015 22:06
Target OS: Raspberry Pi
Domoticz version: beta
Location: east netherlands
Contact:

Re: Is it gonna rain within the next X minutes?

Post by BarryT » Wednesday 07 June 2017 19:23

Derik wrote:Dear all. I use the sript from the wiki. [ is this the latest version ? ]

Use the build in Lua script in blockley..
Works fine.
Only 1 thing the script is running every second:

Code: Select all

2017-06-07 18:48:10	Voorlopig blijft het droog!
2017-06-07 18:48:10	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:09	Voorlopig blijft het droog!
2017-06-07 18:48:08	Voorlopig blijft het droog!
2017-06-07 18:48:07	Voorlopig blijft het droog!
2017-06-07 18:48:06	Voorlopig blijft het droog!
2017-06-07 18:48:05	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:03	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:02	Voorlopig blijft het droog!
2017-06-07 18:48:01	Voorlopig blijft het droog!
2017-06-07 18:47:58	Voorlopig blijft het droog!
2017-06-07 18:47:57	Voorlopig blijft het droog!
2017-06-07 18:47:56	Voorlopig blijft het droog!
2017-06-07 18:47:56	Voorlopig blijft het droog!
Or more..
Is there a solution for..
Looks not the best option for my Domoticz system..

Is there perhaps a sleep @ the end possible?
Did u use lua as time or device?
6x Raspberry 3B
A lot of scripts, switches and sensors :)

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Is it gonna rain within the next X minutes?

Post by Derik » Wednesday 07 June 2017 19:38

i use all:
ScreenShot010.jpg
ScreenShot010.jpg (41.78 KiB) Viewed 1287 times
I do not understand the different s between all this option...
Perhaps someone can ex plane the dombo here :-)

Only the inline lua option looks great because Domoticz save this in the Db, easy for my daily backup


edit:
And what settings do i need for the other script?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
jvdz
Posts: 1068
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Is it gonna rain within the next X minutes?

Post by jvdz » Wednesday 07 June 2017 20:03

Pretty strait forward:
All simply means the script will run on each event.( all below)
Device will be triggered when an Device is updated
Time events will run each minute on the minute
Variable event is triggered when a variable is change.

So, did you change it to Time?
Jos

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Is it gonna rain within the next X minutes?

Post by Derik » Wednesday 07 June 2017 20:09

Sorry for my not smart question only scripts is not my thing i believe..

changed to time
Works every minute..

Thanks guys!!!
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Is it gonna rain within the next X minutes?

Post by Derik » Friday 09 June 2017 10:00

mmmm 1 script working ok.The text is changing...
Only the other script the dummy switch is not changing..
Did change the decimals...
set it to time
ScreenShot015.jpg
ScreenShot015.jpg (153.21 KiB) Viewed 1254 times
Raining here: als bakken uit de lucht
Only no switch that says Rain expacted
ScreenShot016.jpg
ScreenShot016.jpg (64.5 KiB) Viewed 1254 times
Then i hope the data is correct:
ScreenShot017.jpg
ScreenShot017.jpg (58.29 KiB) Viewed 1254 times
Now it is raining like ...

Ho do i read the data.
What are the time's where the script is talking about?
It is gonna rain for how long is this warning?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Is it gonna rain within the next X minutes?

Post by Derik » Friday 09 June 2017 10:40

mmm

Now there is a switch:
ScreenShot018.jpg
ScreenShot018.jpg (98.48 KiB) Viewed 1247 times
Very late...
But there he switched on...

Is there some setting that he can switch faster?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Is it gonna rain within the next X minutes?

Post by EdwinK » Saturday 29 July 2017 20:06

(I believe the script I use is from this topic)

When it is going to rain it shows the following image
Screen Shot 2017-07-29 at 19.54.35.png
(image from my install, with Dashticz)
Screen Shot 2017-07-29 at 19.54.35.png (27.33 KiB) Viewed 951 times
Now this is clear, it's goingt to be WET!, but what is that number 152 meaning (depending on rain), and often the numbers in the brackets are somewhat like (0.00009), so it doesn't mean very much to me. Is it possible to change this a bit. Such as 'severe rain' to 'very light rain' or such or at least a round figure.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

ropske
Posts: 248
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Is it gonna rain within the next X minutes?

Post by ropske » Sunday 30 July 2017 9:37

I dont know where they grab the data from, but i think it is from buienradar. If so, the number 152 will probably be the result of the buienrader widget, please read below to have some more information (its in dutch):

Neerslagdata op basis van coördinaten
Op basis van de door u gewenste coördinaten (latitude en longitude) kunt u de neerslag tot twee uur vooruit ophalen in tekstvorm. De data wordt iedere 5 minuten geüpdatet. Op deze pagina kunt u de neerslag in tekst vinden. De waarde 0 geeft geen neerslag aan (droog), de waarde 255 geeft zware neerslag aan. Gebruik de volgende formule voor het omrekenen naar de neerslagintensiteit in de eenheid millimeter per uur (mm/u):
Neerslagintensiteit = 10^((waarde-109)/32)
Ter controle: een waarde van 77 is gelijk aan een neerslagintensiteit van 0,1 mm/u.

ropske
Posts: 248
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Is it gonna rain within the next X minutes?

Post by ropske » Sunday 30 July 2017 9:38

For example, you can use:
https://br-gpsgadget-new.azurewebsites. ... 2&lon=3.16

just fill in your latitude and longitude

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Is it gonna rain within the next X minutes?

Post by Derik » Sunday 30 July 2017 9:57

Dear scriptwriter...? ,,,
In this script is a write to log option.

I heard from gizmocuz that this script is write something to my log every 4-5 seconds!!!
Is this correct?
Is it possible to remove this part?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
EdwinK
Posts: 921
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Is it gonna rain within the next X minutes?

Post by EdwinK » Sunday 30 July 2017 10:04

ropske wrote:I dont know where they grab the data from, but i think it is from buienradar. If so, the number 152 will probably be the result of the buienrader widget, please read below to have some more information (its in dutch):

Neerslagdata op basis van coördinaten
Op basis van de door u gewenste coördinaten (latitude en longitude) kunt u de neerslag tot twee uur vooruit ophalen in tekstvorm. De data wordt iedere 5 minuten geüpdatet. Op deze pagina kunt u de neerslag in tekst vinden. De waarde 0 geeft geen neerslag aan (droog), de waarde 255 geeft zware neerslag aan. Gebruik de volgende formule voor het omrekenen naar de neerslagintensiteit in de eenheid millimeter per uur (mm/u):
Neerslagintensiteit = 10^((waarde-109)/32)
Ter controle: een waarde van 77 is gelijk aan een neerslagintensiteit van 0,1 mm/u.

Thanks. Yes, the data comes from buienradar. Will read the link.
Running latest BETA on a Pi-3 | Toon Thermostat | RFxcom | Dashticz V2 |

User avatar
jvdz
Posts: 1068
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Is it gonna rain within the next X minutes?

Post by jvdz » Sunday 30 July 2017 10:09

EdKo66 wrote: Now this is clear, it's goingt to be WET!, but what is that number 152 meaning (depending on rain), and often the numbers in the brackets are somewhat like (0.00009), so it doesn't mean very much to me. Is it possible to change this a bit. Such as 'severe rain' to 'very light rain' or such or at least a round figure.
This is described in the initial post of this thread. :)
Derik wrote:Dear scriptwriter...? ,,,
In this script is a write to log option.

I heard from gizmocuz that this script is write something to my log every 4-5 seconds!!!
Is this correct?
Is it possible to remove this part?
Huh? Have you looked at the script at all? It retrieved the JSON info from Buienradar which is written to a file when ran and only make domoticz log entries when debug is set.
I am running a similar LUA script based on this code that is ran by CRONTAB as I don't want any script ran by the Domoticz event system that could potentially hold it up for few seconds.

Jos

User avatar
sincze
Posts: 729
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.8153
Location: Netherlands
Contact:

Re: Is it gonna rain within the next X minutes?

Post by sincze » Sunday 30 July 2017 11:34

jvdz wrote: I am running a similar LUA script based on this code that is ran by CRONTAB as I don't want any script ran by the Domoticz event system that could potentially hold it up for few seconds.

Jos
I totally agree with you on "I don't want any script ran by the Domoticz event system that could potentially hold it up for few seconds." It caused serious issues with other events.

I moved away from the internal event handling and rewrote this 'Buienradar' in php :lol: with the usage of Pass2PHP described on the forum as well. Have to say it works pretty nice. It has been raining quite a lot these days and the screens moved to a safe position thanks to this idea. And the Buienradar API ofcourse.
Using Pass2php since 2016-12
LAN: RFLink, P1-Port, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266, Xiaomi Gateway
Solar: Omnik Inverter, PVOutput
Video: Kodi clients with Harmony HUB
Sensors: You name it I probably got 1.

ropske
Posts: 248
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Is it gonna rain within the next X minutes?

Post by ropske » Sunday 30 July 2017 12:03

sincze wrote:
jvdz wrote: I am running a similar LUA script based on this code that is ran by CRONTAB as I don't want any script ran by the Domoticz event system that could potentially hold it up for few seconds.

Jos
I totally agree with you on "I don't want any script ran by the Domoticz event system that could potentially hold it up for few seconds." It caused serious issues with other events.

I moved away from the internal event handling and rewrote this 'Buienradar' in php :lol: with the usage of Pass2PHP described on the forum as well. Have to say it works pretty nice. It has been raining quite a lot these days and the screens moved to a safe position thanks to this idea. And the Buienradar API ofcourse.

In PHP? Hmm, sounds familiar :lol:

ropske
Posts: 248
Joined: Tuesday 12 August 2014 5:37
Target OS: Raspberry Pi
Domoticz version: V3_8394
Location: Rumbeke,Belgium
Contact:

Re: Is it gonna rain within the next X minutes?

Post by ropske » Tuesday 08 August 2017 18:17

Show me sincze :p

JaapKoppejan
Posts: 4
Joined: Monday 08 February 2016 11:15
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Is it gonna rain within the next X minutes?

Post by JaapKoppejan » Thursday 31 August 2017 15:55

I wonder if the result in mm/hour is correctly calculated now in the script. The reason for my doubt is the non-linear relation between the variable ' Rain' (as the result of the function ' IsItGonnaRain') and the conversion to mm/hour in the formula [mm/h] = 10^(([rain]-109)/32).

Because of this non-linearity, there is a difference in result if we first take the average of the 'rainlines' in the function ' IsItGonnaRain' and then do the conversion to mm/h (as it is now implemented), or (alternatively) first convert a rainline to mm/h and then take the average.

Personally I would expect that the latter approach would provide more accurate results. Is there any documentation available on the buienradar gadget that provides background information?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests