Incremental alarms syntax question **solved**

All about the standard Meteobridge devices based on mobile routers from TP-Link, D-Link, ASUS

Moderator: Mattk

mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Incremental alarms syntax question **solved**

Post by mjc775 »

[wind0wind-dmax=mph.0:0] - 24

Above is an incremental email that I have setup which triggers for every 1mph above 24mph. On very windy days when gusts reach 40-60mph I can get up to 35 alerts. To lessen the number of daily wind alerts, instead of the current configuration I would like to have it trigger every 2mph or only even numbers above 24mph. I've looked at the Condition Expressions section, however I've never been good at algebra and can't figure out which expression(s) could be used for the desired result mentioned above.

TIA.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Incremental alarms syntax question

Post by admin »

try
{* ([wind0wind-dmax=mph.0:0] - 24) / 2 *0}

Divides your integer result by two and makes an integer (zero decimals) of it.
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question

Post by mjc775 »

Thanks for the reply. Just to confirm I understand correctly, if I wanted it to fire every 5mph over 24mph would I use the following?:
{* ([wind0wind-dmax=mph.0:0] - 24) / 5 *0}
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question

Post by mjc775 »

admin wrote:try
{* ([wind0wind-dmax=mph.0:0] - 24) / 2 *0}

Divides your integer result by two and makes an integer (zero decimals) of it.
Please see attached screenshot to see if I perhaps missed something when entering your suggested syntax? Yesterday I had a peak gust of 33mph, and received alerts at 25, 30, 32 and 33mph. So obviously it's not firing alerts for even numbers or every 2 mph above 24mph.

Thank you.
Attachments
Meteobridge wind event trigger
Meteobridge wind event trigger
Screenshot 2016-03-09 00.53.01.png (49.07 KiB) Viewed 7697 times
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Incremental alarms syntax question

Post by admin »

25 / 2 = 23
30 / 2 = 15
32 / 2 = 16
33 / 2 = 17

all as expected. "*0}" does rounding.
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question **solved**

Post by mjc775 »

Sorry, maybe my original question wasn't clear...

Another example: Today I setup 2 different events, sending to 2 different email addresses.

Event 1: "[wind0wind-dmax=mph.0:0] - 24" had alerts fired at 25, 26, 27, 29, 34, 35, 37, 38
Event 2: "{* ([wind0wind-dmax=mph.0:0] - 24) / 2 *0}" had alerts fired at 25, 27, 29, 34, 35, 37 - alerts were NOT fired for 26 & 38. My request which I thought would be accomplished in Event 2 would be to only receive alerts for EVEN numbered gusts - which today would have only fired at 26 and 34mph.

Thinking about this a little more today, as wind speeds and gust increase throughout a day they don't always increment by 1mph or by odd or even numbers. Now I think it makes more sense to have alerts fired for every 5mph or more above 24mph. So today I would have received alerts at 25, 34 and 35mph. How can I have it fire alerts at 25+, 30+, 35+, 40+... and so on?

Thank you.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Incremental alarms syntax question **solved**

Post by admin »

on every even number
{* ([wind0wind-dmax=mph.0:0] - 24) / 2 - 1 *0}

every 5 degrees
{* ([wind0wind-dmax=mph.0:0] - 24) / 5 *0}
User avatar
WA4OPQ
Senior Boarder
Senior Boarder
Posts: 44
Joined: Mon Feb 29, 2016 5:36 am
Location: Tennessee, USA About 40 miles west of Nashville y'all.
Contact:

Re: Incremental alarms syntax question **solved**

Post by WA4OPQ »

On a related note: how would I make Meteobridge play nice with an incremental alarm going negative?
For example, how would I set an alarm to trigger at 20°F and increment every two degrees below that?
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question **solved**

Post by mjc775 »

Using "{* ([wind0wind-dmax=mph.0:0] - 24) / 5 *0}" I'm getting less alerts than I used to, but still not triggering at quite every 5mph or 25+, 30+, 35+, 40+...

Today's gusts (it's been a windy week)...

Event 1: "[wind0wind-dmax=mph.0:0] - 24" had alerts fired at 25, 26, 27, 28, 29, 30, 31, 32, 34, 36, 40
Event 2: "{* ([wind0wind-dmax=mph.0:0] - 24) / 5 *0}" had alerts fire at 27, 32, 40. I thought it would have fired at 25, 30, 36, 40.

Maybe we can get more information from the raise condition/clear condition history?

Event 1: 21:54:39 raise condition #1: 40 - 24 --> true (16.0000)
21:54:41 clear condition #1: 40 < 24 --> false (0.0000)

Event 2: 21:54:41 raise condition #2: 3 --> true (3.0000)
21:54:41 clear condition #2: 40 < 24 --> false (0.0000)

Looking at today's data the only thing that makes sense to me at this point is maybe there was a gust of 22mph (which I don't get alerted about). Then the alerts at 27, 32 and 40 make sense.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Incremental alarms syntax question **solved**

Post by admin »

WA4OPQ wrote:On a related note: how would I make Meteobridge play nice with an incremental alarm going negative?
For example, how would I set an alarm to trigger at 20°F and increment every two degrees below that?
easy math:

Code: Select all

{* (21 - [wind0wind-dmax=mph.0:0]) / 2 *0}
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question

Post by mjc775 »

I'm still trying to figure out why some of my alerts are not firing at specific values when using incremental alarms that are not set to fire at every 1 increment, but rather every 4 or every 10. Below is data from two very windy days this month, where I pose some questions in red. Since wind gusts don't always increment 1 mph higher than the previous dmax, I show "Event 1" for reference to my questions for Events 2 & 3...

Saturday 3/12:

Event 1: "[wind0wind-dmax=mph.0:0] - 24" had alerts fired at 25, 28, 29, 30, 31, 32, 35, 36, 39, 43, 44
Event 2: "{* ([wind0wind-dmax=mph.0:0] - 24) / 4 *0}" had alerts fired at 28, 30, 35, 39, 43. Why did it fire at 30 instead of 32 (28+4)?

Monday 3/21:

Event 1: "[wind0wind-dmax=mph.0:0] - 24" had alerts fired at 26, 28, 32, 33, 36, 37, 41, 42, 45, 46, 51
Event 2: "{* ([wind0wind-dmax=mph.0:0] - 24) / 4 *0}" had alerts fired at 26, 32, 36, 41, 42, 46, 51. Why was an alert fired at 42 after it already fired at 41?
Event 3: "{* ([wind0wind-dmax=mph.0:0] - 39) / 10 *0}" had an alert fired at 45. Why where alerts not fired at 41 and 51 instead of just 45?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Incremental alarms syntax question **solved**

Post by admin »

the "*0}" ending does a rounding to an integer. If you want to have a truncation like cutting off the decimals please use "*t}".

Code: Select all

{* ([wind0wind-dmax=mph.0:0] - 24) / 4 *0}
gives a values as follows:
24, 25 ->0
26, 27, 28, 29 -> 1
30, 31, 32, 33 -> 2

Code: Select all

{* ([wind0wind-dmax=mph.0:0] - 24) / 4 *t}
gives a values as follows:
24, 25, 26, 27 ->0
28, 29, 30, 31 -> 1
32, 33, 34, 35 -> 2
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question

Post by mjc775 »

Thanks. I think I've got the gist of it now. I was missing the fact that I don't get an alert when the value is 0. So to receive alerts when gusts reach 25mph or higher I've changed my template to:

Code: Select all

{* ([wind0wind-dmax=mph.0:0] - 21) / 4 *t}
which should fire alerts when wind gusts incrementally hit 25-29, 30-33, 34-37, 38-41, 42-46, 47-50, and so on.

Code: Select all

{* ([wind0wind-dmax=mph.0:0] - 30) / 10 *t}
...should fire incremental alerts at 40-49, 50-59, 60-69, and so on...

The next big wind event will show if my template is right now.
mjc775
Junior Boarder
Junior Boarder
Posts: 25
Joined: Thu May 22, 2014 10:49 am
Location: Reno, NV USA

Re: Incremental alarms syntax question **solved**

Post by mjc775 »

admin wrote:the "*0}" ending does a rounding to an integer. If you want to have a truncation like cutting off the decimals please use "*t}".

Code: Select all

{* ([wind0wind-dmax=mph.0:0] - 24) / 4 *t}
gives a values as follows:
24, 25, 26, 27 ->0
28, 29, 30, 31 -> 1
32, 33, 34, 35 -> 2
"*t" isn't firing any alerts. I'm using...

Code: Select all

{* ([wind0wind-dmax=mph.0:0] - 21) / 4 *t}
Today so far I've had gusts of 25, 26, 27, 28, 30, 31. When I click the "i" icon I get:

16:20:12 raise condition #3: {* (31 - 21) / 4 *[t]} --> false (0.0000)
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7874
Joined: Mon Oct 01, 2007 10:51 pm

Re: Incremental alarms syntax question **solved**

Post by admin »

mjc775 wrote:{* (31 - 21) / 4 *[t]}
When you put square brackets around the "t" it will no work...
Post Reply