New functionnality wish: sensor value triggers alarm

Discussion of the Meteohub software package

Moderator: Mattk

Post Reply
36260
Expert Boarder
Expert Boarder
Posts: 91
Joined: Sun Feb 17, 2008 11:17 am
Location: Saint Pierre de Jards - France

New functionnality wish: sensor value triggers alarm

Post by 36260 »

Hello,
If I'm not wrong there is no way to send an email notification that would be triggered by a sensor value going above or below a certain value during a certain period of time. Is it something that could be considered in a relative short period of time?
Nicolas
Mr_Tomtom
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: Fri Apr 13, 2012 11:25 pm

Re: New functionnality wish: sensor value triggers alarm

Post by Mr_Tomtom »

Hi Nicolas

actually, it is not possible to send email as alert from the webgui. I wish also a alarm-function to start some scripts in case of alert.

Now, i make a workaround to lift the sunblinds in case that the wind is over 30kmh. I wrote a script, that i schedule in the cron of the meteohub appliance. But, every update, the crontab is initialised. So, after an update, i need to add the script again. Remember that!

Here my code:

Code: Select all

#!/bin/bash

trigger=30
sensorname=last15m_wind0_gustspeedmax_kmh
sensor=$(wget -q -O - "$@" http://127.0.0.1/meteograph.cgi?text=$sensorname | awk 'NR==1 { print $1 }')

eib_host=10.195.1.101
eib_device=1/6/99

true=$(echo  "$sensor >= $trigger" | bc)
echo "Wind ist aktuell: " $sensor
echo "True: " $true
if  [ $true = 1 ]; then
        ssh root@$eib_host "groupswrite  ip:127.0.0.1 $eib_device 1"
        echo "Alarm"
else
        echo "OK"
        ssh root@$eib_host "groupswrite  ip:127.0.0.1 $eib_device 0"
fi
Maybe you can "recycle" it.

Greets
Tom
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: New functionnality wish: sensor value triggers alarm

Post by wfpost »

Mr_Tomtom wrote: But, every update, the crontab is initialised. So, after an update, i need to add the script again. Remember that!
if you add your crontab entries before
## start section written by meteohub

then your section is retained even after an update :!:

see my crontab >>>
#
##webcam wf
11 3 * * * /home/meteohub/scriptswf/wcdate.sh
*/10 5-20 * * * /home/meteohub/scriptswf/wc.sh
3 3 * * * /home/meteohub/scriptswf/triggersunset2
*/20 0-6 * * * /home/meteohub/scriptswf/woanight
*/20 7-23 * * * /home/meteohub/scriptswf/woa
42 8,22 * * * /home/meteohub/scriptswf/wswincm
22 0 1 * * /home/meteohub/scriptswf/monate
##daily email
0 0 * * * sleep 3; sh /home/meteohub/scriptswf/honsolgen
59 23 * * * sleep 44; sh /home/meteohub/scriptswf/emailwf
0 9 * * * sleep 40; sh /home/meteohub/scriptswf/emailjf
59 23 * * * sleep 40; sh /home/meteohub/scriptswf/emailjf
55 23 28-31 * * /home/meteohub/scriptswf/emailmonth
57 23 31 12 * /home/meteohub/scriptswf/emailyear
##twitter
0 */1 * * * /home/meteohub/scriptswf/twitter
1 */1 * * * /home/meteohub/scriptswf/twitter_mucMH
59 */1 * * * /home/meteohub/scriptswf/twitter_data
#
## start section written by meteohub
*/10 * * * * sleep 12; /home/meteohub/meteonet
#- "moonphase" "6 */12 * * *" "moon.png" 0
36260
Expert Boarder
Expert Boarder
Posts: 91
Joined: Sun Feb 17, 2008 11:17 am
Location: Saint Pierre de Jards - France

Re: New functionnality wish: sensor value triggers alarm

Post by 36260 »

Thanks fellows for the tips it is certainly worth trying them. However it would be much much more confortable to have a gui to do that. What I'm looking for is to send an email as well when the condition is triggered. :idea:
Post Reply