Guten Abend,
vorweg gesagt ich hab bereits eine Funktionierende Batterie Abfrage
Internals:
DEF .*.wakeup:.notification get $NAME battery
NAME nZWaveGetBattery
NR 186
NTFY_ORDER 50-nZWaveGetBattery
REGEXP .*.wakeup:.notification
STATE 2018-02-14 05:25:08
TYPE notify
READINGS:
2018-02-12 19:26:33 state active
Attributes:
Per DOIF wird das Notifiy Sonntags aktiviert und Montags wieder Deaktiert, damit nur einmal die Woche der Batterie Stand abgefragt wird.
Aber:
Ich bekomme derzeit weder eine Benachrichtigung wenn a) eine Batterie fast alle (10% oder weniger) oder b) ein Gerät sich schon länger nicht mehr gemeldet hat (vermutlich Batterie alle)
An a) habe ich versucht zu Arbeiten
Internals:
CFGFN
DEF ([":battery"] <= 10) (set Puschover_Dienst msg 'FHEM' 'Batterielevel Niedrig - $DEVICE' "" 0 "")
NAME BatterieWarnung
NR 7801
NTFY_ORDER 50-BatterieWarnung
STATE cmd_1
TYPE DOIF
READINGS:
2018-02-14 05:25:09 Device ZE.Batterie
2018-02-14 05:25:09 cmd 1
2018-02-14 05:25:09 cmd_event ZE.Batterie
2018-02-14 05:25:09 cmd_nr 1
2018-02-12 19:14:50 mode enabled
2018-02-14 05:25:09 state cmd_1
Regex:
cond:
:
0:
":battery" :battery
condition:
0 EventDoIf('',$hash,'battery',0) <= 26
devices:
do:
0:
0 set Puschover_Dienst msg 'FHEM' 'Batterielevel Niedrig - $DEVICE' "" 0 ""
1:
helper:
DOIF_Readings_events
DOIF_eventas
event WZ.Tuer.battery: <html><img class='icon 10px-kreis-rot' src="/fhem/images/default/10px-kreis-rot.png" alt="25" title="25"></html>
globalinit 1
last_timer 0
sleeptimer -1
timerdev ZE.Batterie
timerevent WZ.Tuer.battery: <html><img class='icon 10px-kreis-rot' src="/fhem/images/default/10px-kreis-rot.png" alt="25" title="25"></html>
triggerDev ZE.Batterie
timerevents:
WZ.Tuer.battery: <html><img class='icon 10px-kreis-rot' src="/fhem/images/default/10px-kreis-rot.png" alt="25" title="25"></html>
timereventsState:
WZ.Tuer.battery: <html><img class='icon 10px-kreis-rot' src="/fhem/images/default/10px-kreis-rot.png" alt="25" title="25"></html>
triggerEvents:
WZ.Tuer.battery: <html><img class='icon 10px-kreis-rot' src="/fhem/images/default/10px-kreis-rot.png" alt="25" title="25"></html>
triggerEventsState:
WZ.Tuer.battery: <html><img class='icon 10px-kreis-rot' src="/fhem/images/default/10px-kreis-rot.png" alt="25" title="25"></html>
internals:
itimer:
readings:
trigger:
uiState:
uiTable:
Attributes:
do always
Dies hatte allerdings zur Folge dass ich für jedes Gerät (derzeit keines unter 10%) eine Batterie Warnung bekommen habe. Ich hab es schon ein paar mal umgestellt aber glaube derzeit hab ich einfach nicht den Kopf dafür.
Kann mir jemand konkret bei a) weiterhelfen? Bei nem Tipp zu B wäre ich auch nicht abgeneigt...
Vielen Dank.
Hi,
gib mal noch bitte ein list ZE.Batterie
Gruß Otto
Anbei das list
Internals:
DEF .*:[Bb]attery
.*:[Bb]atteryLevel
NAME ZE.Batterie
NR 87
NTFY_ORDER 50-ZE.Batterie
STATE Initialized
TYPE readingsGroup
mayBeVisible 1
CONTENT:
AMADCommBridge 1
AT_Backup 1
Andre_Handy 1
Andre_Handy_DOIF 1
BatterieAbfrage 1
BatterieWarnung 1
BatteryLowPushover 1
BatteryNotifyAktivieren 1
Beamer_Modus_DOIF 1
Beamer_Modus_Dummy 1
Beamer_Modus_Dummy_notify 1
Beamer_Modus_dummy_Reset 1
Beamer_Modus_notify 1
DASH_JAL_ALLE 1
DOIF_Windgeschwindigkeit 1
DOIFtools 1
DOIFtoolsLog 1
DU.Andre_Handy 1
DU.Natalia_Handy 1
Dash_Jal_Wohnen 1
Dashboard1 1
EZ.Jalousie 1
EZ_SZ_K1_AUT 1
FHEM.Alexa 1
FHEM.Alexa.DOIF 1
FHEM.Alexa.Status 1
FL_EG.Bewegung 1
FL_EG.Haustuer 1
FL_EG.Haustuer_Binary_unbenutzt 1
FL_EG.Kanal1 1
FL_EG.Licht1 1
FL_EG.Licht1_ALT 1
FL_EG.LichtAn 1
FL_EG.LichtAus 1
FL_EG.LichtAutomatik 1
FL_EG.LichtStatusBeiBewegung 1
FL_EG.Temperatur_Haustuer 1
FL_OG.Licht 1
FL_OG.Licht_ALT 1
FileLog_EZ.Jalousie 1
FileLog_FL_EG.Bewegung 1
FileLog_FL_EG.Bewegung1 1
FileLog_FL_EG.Haustuer 1
FileLog_FL_EG.Haustuer_Binary_unbenutzt 1
FileLog_FL_EG.Kanal1 1
FileLog_FL_EG.Licht1 1
FileLog_FL_EG.Licht1_ALT 1
FileLog_FL_EG.Schalter_Licht_Modul 1
FileLog_FL_EG.Temperatur_Haustuer 1
FileLog_FL_OG.Licht 1
FileLog_FL_OG.Licht_ALT 1
FileLog_GWC.Fenster_Reed 1
FileLog_K1.Jalousie 1
FileLog_K2.Jalousie 1
FileLog_KL.Flut_Alarm_Haupthahn 1
FileLog_KL.Flut_Alarm_Keller2 1
FileLog_KL.Flut_Binary1 1
FileLog_KL.Flut_Temp_Haupthahn 1
FileLog_KL.Flut_Temp_Keller2 1
FileLog_KUE.Jalousie_G 1
FileLog_KUE.Jalousie_K 1
FileLog_SZ.Jalousie 1
FileLog_WC_EG.Fenster 1
FileLog_WC_EG.Temperatur 1
FileLog_WZ.Jalousie_Fenster 1
FileLog_WZ.Jalousie_Tuer 1
FileLog_WZ.Temperatur_Tuer 1
FileLog_WZ.Tuer 1
FileLog_Wetter_Kirchlengern 1
FritzBox 1
GHoma_Ausschalten 1
GWC.Fenster_Reed 1
Haustuer_Geoeffnet 1
Jal_ohne_Ost 1
JallousieAlle_ohne_WZ 1
JalousieAlle 1
JalousieAlle_AUT 1
JalousieWohnen 1
Jalousie_Down 1
JalousienAutomatik 1
JalousienAutomatik__Kueche 1
K1.Jalousie 1
K2.Jalousie 1
KL.Flut_Alarm_Haupthahn 1
KL.Flut_Alarm_Keller2 1
KL.Flut_Binary1 1
KL.Flut_Binary_Keller2 1
KL.Flut_Temp_Haupthahn 1
KL.Flut_Temp_Keller2 1
KUE.Jalousie_G 1
KUE.Jalousie_K 1
KUE_JAL_G_AUT 1
KUE_JAL_K_AUT 1
Keller_Wasser 1
Kino_Modus 1
LCARS_EG 1
LCARS_GARTEN 1
LCARS_KG 1
LCARS_OG 1
LCARS_STATUS 1
Logfile 1
Mediaplayer_Modus 1
Mediaplayer_Modus_Off 1
Menue_EG 1
Menue_Garten 1
Menue_KG 1
Menue_OG 1
Menue_Status 1
MyAlexa 1
NAS_WOL 1
NRW_Feiertage 1
Nas_Starten 1
Natalia_Handy 1
Natalia_Handy_DOIF 1
Puschover_Dienst 1
Rolladenautomatik 1
SYS_Homebridge 1
SZ.Jal_Runter 1
SZ.Jalousie 1
Steam_Modus 1
Steam_Modus_off 1
TC_TWILIGHT 1
TabletSamsung 1
USV_1 1
Ueberschrift_Beleuchtung 1
UniFi 1
VorschauProplanta 1
WC_EG.Fenster 1
WC_EG.Fenster_Watchdog 1
WC_EG.Fenster_kalt 1
WC_EG.Temperatur 1
WEB 1
WEB_127.0.0.1_55206 1
WEB_127.0.0.1_55208 1
WEB_192.168.178.20_51455 1
WEB_192.168.178.20_51631 1
WEB_192.168.178.20_51637 1
WEBhabridge 1
WEBphone 1
WEBtablet 1
WZ.Jalousie_Fenster 1
WZ.Jalousie_Tuer 1
WZ.Jalousie_Tuer_Stop 1
WZ.Stehlampe 1
WZ.Temperatur_Tuer 1
WZ.Tuer 1
WZ.Tuer_Jalousie_Hoch 1
WetterProplanta 1
WetterUpdate 1
Wetter_Kirchlengern 1
Wifi_GHoma 1
Wifi_MediaPlayer 1
Wifi_Steam 1
Wind_Jalousie_Auf 1
Windgeschwindigkeit 1
Windgeschwindigkeit_Wind 1
Wohnzimmer 1
Xbox360_Modus 1
ZE.Activity 1
ZE.Batterie 1
ZWAVE1 1
allowed_WEB 1
allowed_WEBhabridge 1
allowed_WEBphone 1
allowed_WEBtablet 1
autocreate 1
corner1_bl 1
corner1_br 1
corner1_tl 1
corner1_tr 1
eventTypes 1
global 1
harmony_49301864 1
harmony_49301865 1
harmony_49301866 1
harmony_49301867 1
harmony_49301868 1
harmony_49301869 1
harmony_49301870 1
harmony_49301871 1
harmony_49327217 1
harmony_49728629 1
initialUsbCheck 1
lcars.WZ.Fenster_Jalousie 1
line1_l 1
line2_b 1
nZWaveGetBattery 1
n_DASH_JAL_ALLE 1
notify_fhem_reload 1
telnetPort 1
weblink_wetter_kirchlengern 1
winOpen.CloseNotify 1
winOpen.OpenNotify 1
CONTENT2:
DEVICES:
ARRAY(0x2efea30)
ARRAY(0x2efac28)
ARRAY(0x3505598)
ARRAY(0x2efb270)
ARRAY(0x36e7c18)
ARRAY(0x3610988)
ARRAY(0x362c598)
ARRAY(0x34f9148)
ARRAY(0x3602f00)
ARRAY(0x35b5be0)
ARRAY(0x36f3190)
ARRAY(0x3719200)
ARRAY(0x3603ce8)
ARRAY(0x371b828)
ARRAY(0x35036c8)
ARRAY(0x3921bd0)
ARRAY(0x3753c58)
ARRAY(0x2e0b550)
ARRAY(0x396b0e0)
ARRAY(0x36732b0)
ARRAY(0x381c250)
ARRAY(0x3346180)
ARRAY(0x3977648)
ARRAY(0x3910268)
ARRAY(0x3589e00)
ARRAY(0x392a590)
ARRAY(0x33adae0)
ARRAY(0x33ad9a8)
ARRAY(0x3700e48)
ARRAY(0x37bae38)
ARRAY(0x1f73f30)
ARRAY(0x385a140)
ARRAY(0x30da760)
ARRAY(0x3925858)
ARRAY(0x3728688)
ARRAY(0x3865ea8)
ARRAY(0x33c4098)
ARRAY(0x38186f0)
ARRAY(0x390fcf0)
ARRAY(0x34fd370)
ARRAY(0x366f710)
ARRAY(0x3397400)
ARRAY(0x3441c80)
ARRAY(0x365a618)
ARRAY(0x38c4058)
ARRAY(0x382bba8)
ARRAY(0x35520e0)
ARRAY(0x36ec300)
ARRAY(0x3a11210)
ARRAY(0x382afd8)
ARRAY(0x38cf3d8)
ARRAY(0x3940f00)
ARRAY(0x382f0e8)
ARRAY(0x3940540)
ARRAY(0x3853630)
ARRAY(0x35eeb50)
ARRAY(0x38db780)
ARRAY(0x39d68f8)
ARRAY(0x390f900)
ARRAY(0x38cc558)
ARRAY(0x34b5368)
ARRAY(0x35fa7c8)
ARRAY(0x38d9fc8)
ARRAY(0x36e0d90)
ARRAY(0x36ea758)
ARRAY(0x36f8260)
ARRAY(0x39a9b98)
ARRAY(0x36e1a88)
ARRAY(0x3943198)
ARRAY(0x2efb548)
ARRAY(0x3701658)
ARRAY(0x39d0630)
ARRAY(0x38182d0)
ARRAY(0x3929ea0)
ARRAY(0x35e69e0)
ARRAY(0x34ffa00)
ARRAY(0x36f3f68)
ARRAY(0x34bb628)
ARRAY(0x398a5c8)
ARRAY(0x390dbe0)
ARRAY(0x368efb0)
ARRAY(0x39217c0)
ARRAY(0x35b5a78)
ARRAY(0x35e2550)
ARRAY(0x3924d88)
ARRAY(0x38173b0)
ARRAY(0x34bd940)
ARRAY(0x354b6c8)
ARRAY(0x35a46c0)
ARRAY(0x366ec18)
ARRAY(0x37b6fc0)
ARRAY(0x3867418)
ARRAY(0x33c3be8)
ARRAY(0x37029d0)
ARRAY(0x36a6b28)
ARRAY(0x384e990)
ARRAY(0x30b3f80)
ARRAY(0x3922ee0)
ARRAY(0x381b168)
ARRAY(0x38589b8)
ARRAY(0x2effea8)
ARRAY(0x3485638)
ARRAY(0x3983bf8)
ARRAY(0x37b6ff0)
ARRAY(0x34c0d38)
ARRAY(0x3504300)
ARRAY(0x2efb180)
ARRAY(0x34fd160)
ARRAY(0x3601318)
ARRAY(0x3970770)
ARRAY(0x3447298)
ARRAY(0x360d0e0)
ARRAY(0x392ac28)
ARRAY(0x35d6550)
ARRAY(0x3922970)
ARRAY(0x36e1bc0)
ARRAY(0x36f6db8)
ARRAY(0x39a8cb0)
ARRAY(0x39f6088)
ARRAY(0x2465538)
ARRAY(0x35dc9d8)
ARRAY(0x3918c08)
ARRAY(0x396c4c8)
ARRAY(0x3441908)
ARRAY(0x354b4a0)
ARRAY(0x34b8460)
ARRAY(0x38c9e68)
ARRAY(0x38ca4c8)
ARRAY(0x38c2e80)
ARRAY(0x370e540)
ARRAY(0x3926b50)
ARRAY(0x35bba98)
ARRAY(0x36f7058)
ARRAY(0x3690700)
ARRAY(0x35b31f8)
ARRAY(0x34ff1d0)
ARRAY(0x372bda0)
ARRAY(0x384eee8)
ARRAY(0x36214f0)
ARRAY(0x3663648)
ARRAY(0x3523a20)
ARRAY(0x3957560)
ARRAY(0x392a8e0)
ARRAY(0x3984198)
ARRAY(0x2f08058)
ARRAY(0x2e1ee08)
ARRAY(0x3394000)
ARRAY(0x2efc768)
ARRAY(0x3682ef8)
ARRAY(0x3588c40)
ARRAY(0x2f04438)
ARRAY(0x2efc340)
ARRAY(0x2f40478)
ARRAY(0x2f03a70)
ARRAY(0x33c2758)
ARRAY(0x3629ae0)
ARRAY(0x2efaf88)
ARRAY(0x39947d0)
ARRAY(0x36f7db0)
ARRAY(0x3912178)
ARRAY(0x2f38738)
ARRAY(0x3674030)
ARRAY(0x35dfa70)
ARRAY(0x3678938)
ARRAY(0x37191d0)
ARRAY(0x3994128)
ARRAY(0x2e182a8)
ARRAY(0x3983ce8)
ARRAY(0x390cff0)
ARRAY(0x35049b0)
ARRAY(0x34b90c0)
ARRAY(0x36590f0)
ARRAY(0x3503ad8)
ARRAY(0x35a6818)
ARRAY(0x394f3f8)
ARRAY(0x3672460)
ARRAY(0x35256d0)
ARRAY(0x3929538)
ARRAY(0x2e0b400)
ARRAY(0x3503880)
ARRAY(0x3858718)
ARRAY(0x3818e30)
ARRAY(0x3394b30)
ARRAY(0x3828438)
ARRAY(0x3824cd8)
ARRAY(0x38cc930)
ARRAY(0x3447960)
ARRAY(0x3832a08)
ARRAY(0x3854bd8)
ARRAY(0x36729c8)
ARRAY(0x36e1b90)
ARRAY(0x30da8f8)
ARRAY(0x33bd378)
ARRAY(0x36f2788)
ARRAY(0x33bd408)
ARRAY(0x33bd468)
ARRAY(0x33bd4c8)
ARRAY(0x33bd528)
ARRAY(0x33bd588)
ARRAY(0x33bd5e8)
ARRAY(0x33bd648)
ARRAY(0x33bd6a8)
ARRAY(0x33bd708)
ARRAY(0x33bd768)
ARRAY(0x33bd7c8)
ARRAY(0x33bd828)
ARRAY(0x33bd888)
ARRAY(0x33bd8e8)
ARRAY(0x33bd948)
ARRAY(0x38d7b80)
ARRAY(0x38d7be0)
ARRAY(0x38d7c40)
ARRAY(0x38d7ca0)
ARRAY(0x38d7d00)
ARRAY(0x38d7d60)
ARRAY(0x38d7dc0)
ARRAY(0x38d7e20)
ARRAY(0x38d7e80)
ARRAY(0x38d7ee0)
ARRAY(0x38d7f40)
ARRAY(0x38d7fa0)
ARRAY(0x38d8000)
ARRAY(0x38d8060)
ARRAY(0x38d80c0)
ARRAY(0x38d8120)
ARRAY(0x38d8180)
ARRAY(0x38d81e0)
ARRAY(0x38d8240)
ARRAY(0x38d82a0)
ARRAY(0x38d8300)
ARRAY(0x38d8360)
ARRAY(0x38d83c0)
ARRAY(0x38d8420)
ARRAY(0x38d8480)
ARRAY(0x38d84e0)
ARRAY(0x38d8540)
ARRAY(0x38d85a0)
ARRAY(0x38d8600)
ARRAY(0x38d8660)
ARRAY(0x38d86c0)
ARRAY(0x38d8720)
ARRAY(0x38d8780)
ARRAY(0x38d87e0)
ARRAY(0x38d8840)
ARRAY(0x38d88a0)
ARRAY(0x38d8900)
ARRAY(0x38d8960)
ARRAY(0x38d89c0)
ARRAY(0x38d8a20)
ARRAY(0x38d8a80)
ARRAY(0x38d8ae0)
ARRAY(0x381e528)
ARRAY(0x381e588)
ARRAY(0x381e5e8)
ARRAY(0x381e648)
ARRAY(0x381e6a8)
ARRAY(0x381e708)
ARRAY(0x381e768)
ARRAY(0x381e7c8)
ARRAY(0x381e828)
ARRAY(0x381e888)
ARRAY(0x381e8e8)
ARRAY(0x381e948)
ARRAY(0x381e9a8)
ARRAY(0x381ea08)
ARRAY(0x381ea68)
ARRAY(0x381eac8)
ARRAY(0x381eb28)
ARRAY(0x39b9bf0)
ARRAY(0x39ab328)
ARRAY(0x3824b88)
ARRAY(0x39aa8e8)
ARRAY(0x36037c0)
ARRAY(0x38cc7c8)
ARRAY(0x37023d0)
ARRAY(0x3674480)
ARRAY(0x39c59b8)
ARRAY(0x3926f88)
ARRAY(0x36e0ca0)
ARRAY(0x360be78)
ARRAY(0x3942f70)
ARRAY(0x380aae8)
ARRAY(0x382ca28)
ARRAY(0x382c680)
ARRAY(0x3820238)
ARRAY(0x3941020)
ARRAY(0x399b480)
ARRAY(0x382c8d8)
ARRAY(0x3595518)
ARRAY(0x39aedb8)
ARRAY(0x397eb08)
ARRAY(0x392ec88)
ARRAY(0x38c53f0)
ARRAY(0x38cf4c8)
ARRAY(0x39d9340)
ARRAY(0x39ffda0)
ARRAY(0x382c5f0)
ARRAY(0x382c860)
ARRAY(0x382a138)
ARRAY(0x38c49e8)
ARRAY(0x3826af8)
ARRAY(0x39f3c90)
ARRAY(0x38c6338)
ARRAY(0x39c1658)
ARRAY(0x38cd1c0)
ARRAY(0x38336e8)
ARRAY(0x3820688)
ARRAY(0x39ad770)
ARRAY(0x382dab0)
ARRAY(0x382cb60)
ARRAY(0x3837208)
ARRAY(0x30b36e0)
ARRAY(0x33bcbe0)
ARRAY(0x39b9bd8)
ARRAY(0x3965bf8)
ARRAY(0x398e868)
ARRAY(0x3833928)
ARRAY(0x3824190)
ARRAY(0x39b8b08)
ARRAY(0x38ce9e0)
ARRAY(0x3658808)
ARRAY(0x38c2ef8)
ARRAY(0x39e0f38)
ARRAY(0x39b9ae8)
ARRAY(0x344b0d0)
ARRAY(0x3687f38)
ARRAY(0x3441db8)
ARRAY(0x36e6af8)
ARRAY(0x356f1d8)
ARRAY(0x382cef0)
ARRAY(0x35b9a78)
ARRAY(0x3865a70)
ARRAY(0x344a2f0)
ARRAY(0x35f8688)
ARRAY(0x3822640)
ARRAY(0x399d020)
ARRAY(0x3690a18)
ARRAY(0x39d1c80)
ARRAY(0x360bcf8)
ARRAY(0x3933158)
ARRAY(0x344afe0)
ARRAY(0x3624f20)
ARRAY(0x372b8c0)
ARRAY(0x33b6378)
ARRAY(0x35957a8)
ARRAY(0x3448158)
ARRAY(0x3866250)
ARRAY(0x3697ab0)
ARRAY(0x39152d8)
ARRAY(0x384f730)
ARRAY(0x3697900)
ARRAY(0x39aa780)
ARRAY(0x3855460)
ARRAY(0x3925d80)
ARRAY(0x38df8a0)
ARRAY(0x339d3b0)
ARRAY(0x382c560)
ARRAY(0x3852da8)
ARRAY(0x382ca70)
ARRAY(0x38c8d68)
ARRAY(0x382ddc8)
ARRAY(0x382d900)
ARRAY(0x382c728)
ARRAY(0x39b9758)
ARRAY(0x34b6028)
ARRAY(0x3852dd8)
ARRAY(0x397c940)
ARRAY(0x382bb60)
ARRAY(0x2efed00)
ARRAY(0x382b530)
ARRAY(0x36ed508)
ARRAY(0x397b300)
ARRAY(0x365a750)
ARRAY(0x37ba398)
ARRAY(0x36e0a90)
ARRAY(0x38cc900)
ARRAY(0x3826858)
ARRAY(0x3832e00)
ARRAY(0x36e2040)
ARRAY(0x34419b0)
ARRAY(0x39d8468)
ARRAY(0x3877678)
ARRAY(0x3828dd0)
ARRAY(0x3446f98)
ARRAY(0x3728f58)
ARRAY(0x38ce5f0)
fhem:
lastDefChange 23
last_update 1518626443.23581
helper:
DEF
valueFormat { return "0" if( $VALUE < 25 );return "25" if( $VALUE < 50 ); return "50" if( $VALUE < 75 ); return "75" if( $VALUE < 90 );return "100"}
positions:
FL_EG.Bewegung.battery 27:1
FL_EG.Haustuer.battery 28:1
KL.Flut_Alarm_Haupthahn.battery 84:1
KL.Flut_Alarm_Keller2.battery 85:1
WC_EG.Fenster.battery 128:1
WZ.Tuer.battery 143:1
valueIcon:
battery.0 10px-kreis-rot
battery.100 10px-kreis-gruen
battery.25 10px-kreis-rot
battery.50 10px-kreis-gelb
battery.75 10px-kreis-gruen
values:
formated:
undef
ARRAY(0x3987938)
orig:
undef
ARRAY(0x3524b30)
prefixsuffix:
undef
ARRAY(0x36e2f48)
Attributes:
notime 1
room Zentral
valueFormat { return "0" if( $VALUE < 25 );return "25" if( $VALUE < 50 ); return "50" if( $VALUE < 75 ); return "75" if( $VALUE < 90 );return "100"}
valueIcon {'battery.0' => '10px-kreis-rot','battery.25' => '10px-kreis-rot','battery.50' => '10px-kreis-gelb','battery.75' => '10px-kreis-gruen','battery.100' => '10px-kreis-gruen'}
Sorry, Readingsgroup keine Ahnung.
Aus meiner Sicht sieht das list komisch aus, aber das ist ohne Hintergrund. ich habe davon keine Ahnung.
Der zugehörige Event der das DOIF getriggert hat hat nicht annähernd etwas mit Deiner Abfrage zu tun (<=10)
Ich denke Du verbrauchst mit dem DOIF derzeit nur Strom.
Ich kann Dir da nicht helfen, ich habe einfach die Lösung aus dem Wiki mit einem notify. Die funktioniert bei mir.
Gruß Otto
Bin jetzt auch nicht der readingsgroup-Experte, aber sieht so aus, als würde die readingsgroup dein DOIF triggern, da musst du besser einschränken...
In der DOIF Doku habe ich das gefunden. Ist das einzige was ich noch beitragen kann:
ZitatStatusanzeige: Alle Devices, deren Batterie nicht ok ist:
define di_battery DOIF
attr di_battery state [@":battery":battery:$_ ne "ok","alle OK"]
oder etwas Ressourcen schonender:
define di_bat DOIF ([08:00|1]) (set Puschover_Dienst msg 'FHEM' 'Batterielevel Niedrig - [@"":battery:$_ ne "ok","alle OK"]' "" 0 "")
attr di_bat do always
Montags um 8:00 Uhr gibt es die Meldung von welchen Devices Batterien nicht ok sind, sonst "alle ok".
Hab es erstmal deaktiviert und schaue es mir heute Abend nochmal an. Danke für die Hilfe :)
Hallo Xell1984,
ich hab folgende Readingsgroup, die als Liste Batteriesymbole farbig anzeigt:
defmod Battery.State readingsGroup .*:[Bb]attery
attr Battery.State room CUL_HM,Mobile
attr Battery.State valueFormat { \
return "0" if( $VALUE eq "low" );; \
return "100" if( $VALUE eq "ok" );; \
return "25" if( $VALUE < 2.1 );; \
return "50" if( $VALUE < 2.3 );; \
return "75" if( $VALUE < 2.5 );; \
return "100"}
attr Battery.State valueIcon { \
'battery.0' => 'measure_battery_0@red', \
'battery.100' => 'measure_battery_100@green', \
'Battery.0' => 'measure_battery_0@red', \
'Battery.100' => 'measure_battery_100@green', \
'batteryLevel.0' => 'measure_battery_0@red', \
'batteryLevel.25' => 'measure_battery_25@red', \
'batteryLevel.50' => 'measure_battery_50@orange', \
'batteryLevel.75' => 'measure_battery_75@green', \
'batteryLevel.100' => 'measure_battery_100@green'}
Alamierung geht folgendermaßen, ich geb zu, dass ich eine Sammelleidenschaft für Benachrichtigungssysteme habe, und es sind hier noch nicht mal alle verwendet.
Getestet und funktioniert:
defmod BatteryLow.notify notify .*:[Bb]attery {if($EVENT !~ m/ok/) \
{fhem "set Pushover.Nachricht msg 'FHEM Batteriewarnung' '$NAME $EVENT';; \
set PushNotifier.Nachricht message FHEM Batteriewarnung _$NAME _$EVENT;; \
set Pushbullet.Nachricht message $NAME $EVENT | FHEM Batteriewarnung";; \
DebianMail('xxxyyy@home.com', 'FHEM Batteriewarnung', $NAME.': '.$EVENT);; \
DebianMail('aaabbb@yahoo.net', 'FHEM Batteriewarnung', $NAME.': '.$EVENT);; \
DebianMail('cccddd@netberg.de', 'FHEM Batteriewarnung', $NAME.': '.$EVENT);; \
Log 3, "$NAME : Batteriewarnung $EVENT";;}}
attr BatteryLow.notify icon measure_voltage
attr BatteryLow.notify room CUL_HM
Viele Grüße Gisbert
Hatte jetzt erst wieder Zeit gefunden:
Wenn ich das notifiy aus dem Wiki übernehme bzw. z.B. das von gisbert dann funktioniert es einwandfrei (per trigger WZ.Tuer:ok bzw. trigger WZ.Tuer:low getestet).
Meine Devices sagen aber nicht ok oder low sondern geben Werte aus.
Wenn ich statt
.*:[Bb]attery:.* { if($EVENT !~ m/ok/) {
{ fhem ("set Puschover_Dienst msg FHEM Batteriewarnung, $NAME.': '.$EVENT")};
Log 3, "$NAME: Batteriewarnung $EVENT";
}
}
nun
.*:[Bb]attery:.* { if($EVENT <= 10) {
{ fhem ("set Puschover_Dienst msg FHEM Batteriewarnung, $NAME.': '.$EVENT")};
Log 3, "$NAME: Batteriewarnung $EVENT";
}
}
statt entspricht nicht OK nun kleiner gleich 10 eingebe dann bekomme ich bei jeder Batterie Meldung eine Benachrichtigung. Wo liegt der Fehler?
Anbei ein Gerät
Internals:
DEF c27c12b2 14
IODev ZWAVE1
NAME WZ.Tuer
NR 128
STATE closed
TYPE ZWave
ZWaveSubDevice no
homeId c27c12b2
nodeIdHex 0e
READINGS:
2018-02-13 05:48:29 SEND_DATA failed:00
2017-02-24 13:22:21 UNPARSED BASIC 032000ff
2018-02-28 12:46:45 basicSet 0
2018-02-25 02:11:02 battery 26 %
2018-02-13 05:48:29 configDeactivateTransmissionOfFrame9 Groups1And2Sent
2018-02-13 05:48:31 configForcedLevelOfDimmingGroup1 255
2018-02-13 05:48:32 configInsensitivenessToTemperature12 8
2018-02-13 05:48:33 configIntervalBetweenSuccessive10 1
2018-02-13 05:48:36 configSceneActivation ScenesDisabled
2018-02-04 14:49:46 config_15 0
2016-08-21 16:53:22 mcCapability_01 SENSOR_BINARY
2016-08-21 16:53:22 mcCapability_02 SENSOR_MULTILEVEL
2016-08-21 16:53:21 mcEndpoints total 2, different
2016-08-21 16:53:22 model FIBARO System FGK101 Door Opening Sensor
2016-08-21 16:53:22 modelConfig fibaro/fgk001.xml
2016-08-21 16:53:22 modelId 010f-0700-1000
2018-02-28 12:46:44 reportedState closed
2018-02-28 12:46:44 state closed
2018-03-02 00:18:56 timeToAck 0.873
2018-03-02 00:18:56 transmit OK
2018-03-02 00:18:53 wakeup notification
2018-02-13 05:48:27 wakeupReport interval 86400 target 1
Attributes:
IODev ZWAVE1
classes SENSOR_BINARY SENSOR_ALARM MULTI_CHANNEL ASSOCIATION MANUFACTURER_SPECIFIC CONFIGURATION VERSION BATTERY CRC_16_ENCAP WAKE_UP FIRMWARE_UPDATE_MD MARK SCENE_ACTIVATION BASIC
devStateIcon open:fts_window_1w_open@red closed:fts_window_1w@green
group Türen und Fenster
neighborListPos 169.68017330854454,92.53541599223173
room Wohnzimmer
userattr winOpenMaxTrigger winOpenTimer winOpenTimer2 winOpenType:Fenster,Türe winOpenName
vclasses ASSOCIATION:2 BATTERY:1 CONFIGURATION:1 CRC_16_ENCAP:1 FIRMWARE_UPDATE_MD:1 MANUFACTURER_SPECIFIC:1 MULTI_CHANNEL:3 SCENE_ACTIVATION:1 SENSOR_ALARM:1 SENSOR_BINARY:1 VERSION:1 WAKE_UP:1
winOpenType Türe
Nochmals Danke.
Dein Event enthält sicher keine Zahl -> battery 26 %
Wie sieht den der Event aus? Du loggst ihn ja mit.
Lt logfile
2018-03-02_17:16:13 WC_EG.Fenster battery: 75 %
Hab $Event abgeändert auf $EVTPART1
.*:[Bb]attery:.* { if($EVTPART1 <= 30) {
{ fhem ("set Puschover_Dienst msg FHEM Batteriewarnung, $NAME.': '.$EVENT")};
Log 3, "$NAME: Batteriewarnung $EVENT";
}
}
Trigger funktioniert bisher. Bei 2 Geräten die eine Batterie Meldung abgegeben haben kam es richtigerweise nicht zur Benachrichtigung. Bin bei den andren Geräten gespannt. Liegt noch im Sendstack und wartet auf das das wakeup notifications.
Hab da auch ein ähnliches Problem..
Ich möchte sowohl auf das "ok" bzw. "low" meiner HM Komponeten als auch auf die 0 bzw 100 Prozent meiner zigbee Geräte triggern und eine Mail schicken aber leider will das nicht.
define n_batt_chk notify .*:[Bb]attery:.* {if(($EVENT !~ m/ok/i) or ($EVENT = 0)) {\
my $AttComment=AttrVal($NAME,"comment",0);;\
#Log 3, "comment ist $AttComment";;\
if ($AttComment ne 1) {\
my $DNAME = AttrVal($NAME,"alias",$NAME);;\
Log 3, 'about to use DebianMail';;\
{ DebianMail('vorname.nachname@mail.com','FHEM Batteriewarnung', "$DNAME -> $EVENT") };;\
Log 3,"Bat $DNAME $EVENT";;\
fhem "attr $NAME comment 1";;\
}\
}elsif(($EVENT =~ m/ok/i) or ($EVENT = 100)) {\
if (AttrVal("$NAME","comment",0) eq 1){\
fhem("setreading $NAME lastBatChange ".localtime);;\
fhem("deleteattr $NAME comment")\
}\
}\
}
LG
Daniel
Vielleicht ist ja das interessant: https://forum.fhem.de/index.php/topic,82637.msg747514.html#msg747514
(und wenn es nur ist um sich Code-Teile zu "klauen" ;) )
Gruß, Joachim
Hallo Daniel,
ich versuche mal deinen Code zu erklären, Du hast leider nicht gesagt was er tun soll.
Also triggern tut das notify auf alles was irgendwie :battery: im Event hat.
Der if Zweig fragt ob 0 oder nicht ok:
falls das Attribute comment nicht 1 enthält wird eine Mail gesendet und das attribute comment auf 1 gesetzt
Der elsif zweig fragt ob ok oder 100.
falls das attribute comment eine 1 enthält wird ein Reading gesetzt und das attribute comment gelöscht
Von Mail im elsif Zweig steht nicht im Gegensatz zu deiner Einleitung.
Und attribute setzen und löschen im Code ist - :-[ :-[ :-[
Gruß Otto
Versuch doch mal das Modul Homemode, das hat eine Batterieüberwachung out of the box drin. Bin mir aber nicht sicher, ob Zigbee unterstützt wird, sollte aber kein Problem sein.
Danke für eure Antworten...
Der Ursprungscode war ja auch "geklaut" und bezog sich nur auf HM-Komponenten mit battery ok bzw. low und hat auch funktioniert.
Er hat auch verhindert dass bei battery low das email mehrfach/immer wieder gesendet wird.
Das hatte ber zur Folge, das bei der Inbetriebnahme von zigbee Komponenten mit 100 Prozent Batterie immer sofort eine email ausgelöst wurde (da ungleich OK), welches ich nun mit or ($EVENT = 0)
bzw. ($EVENT = 100)
verhindern wollte.
if(($EVENT !~ m/ok/i) or ($EVENT = 0)) -> soll bei battery low oder battery 0 email senden
elsif(($EVENT =~ m/ok/i) or ($EVENT = 100)) -> soll comment löschen und das Reading lastBatChange mit dem aktuellen Datum befüllen.
Das funktioniert aber nur mit den HM-Komponenten (ok, low), nicht aber mit den zigbee (0, 100), da tut sich nichts - eigentlich wollte ich anstatt 0 auf <=5 vergleichen.
Güße
Daniel
Hallo Daniel,
hast Du Dir mal so einen zigbee Event angeschaut? Kannst Du einen posten?!
Gruß Otto
Hallo Otto:
Event Monitor:
2020-01-21 22:40:39 HUEDevice VibrationTest1 battery: 88
lt. Log-File der zigbee Komponete:
2020-01-21_22:15:48 VibrationTest1 orientation: 1,80,10
2020-01-21_22:15:48 VibrationTest1 vibrationstrength: 2
2020-01-21_22:15:48 VibrationTest1 tiltangle: 6
2020-01-21_22:15:48 VibrationTest1 vibration: 0
2020-01-21_22:40:39 VibrationTest1 reachable: 1
2020-01-21_22:40:39 VibrationTest1 temperature: 23
2020-01-21_22:40:39 VibrationTest1 battery: 88
LG Daniel
Naja ich denke der $EVENT auf den Du scharf bist ist dieser hier: "battery: 88"
Du könntest mal mitloggen, aber ich denke $EVTPART1 könnte den Wert enthalten ;) $EVENT enthält auf alle Fälle keine Zahl (bzw. nicht nur)
Hallo Otto;
$EVTPART1 hab ich auch schon versucht, kann aber aus meiner Sicht nicht helfen weil ja das Reading battery nur eine Zahl enthält.
Irgendwie muss es am "or" liegen?
LG Daniel
geht auch mit "nur" zigbee (HUEDevice) nicht :-[
define n_batt_chk notify .*:[Bb]attery:.* {if($EVENT = 0) {\
my $AttComment=AttrVal($NAME,"comment",0);;\
#Log 3, "comment ist $AttComment";;\
if ($AttComment ne 1) {\
my $DNAME = AttrVal($NAME,"alias",$NAME);;\
Log 3, 'about to use DebianMail';;\
{ DebianMail('vorname.nachname@mail.com','FHEM Batteriewarnung', "$DNAME -> $EVENT") };;\
Log 3,"Bat $DNAME $EVENT";;\
fhem "attr $NAME comment 1";;\
}\
}elsif($EVENT = 100) {\
if (AttrVal("$NAME","comment",0) eq 1){\
fhem("setreading $NAME lastBatChange ".localtime);;\
fhem("deleteattr $NAME comment")\
}\
}\
}
LG Daniel
Ja sorry, ich war blind. Liegt nicht am or es liegt am Operator = -> ==
https://perldoc.perl.org/perlop.html#Operator-Precedence-and-Associativity
Merke
= Zuweisung: linke Tasche = rechte Tasche
== Vergleich: links gleich rechts?
;D ;D ;D
Zitat von: Otto123 am 22 Januar 2020, 09:01:13
Merke
= Zuweisung: linke Tasche = rechte Tasche
== Vergleich: links gleich rechts?
;D ;D ;D
Hi Otto,
so philosophisch schon am (frühen) Morgen ;)
Aber das ist sehr einleuchtend formuliert :)
Gruß, Joachim
Und ich bleibe dabei:
2020-01-21 22:40:39 HUEDevice VibrationTest1 battery: 88
$NAME ist VibrationTest1
In $EVENT steht battery: 88
In $EVTPART1 steht 88
Kannst Du mit diesem Ausführungsteil überprüfen:
{Log 1, "Name $NAME Gesamter Event $EVENT Teil0 $EVTPART0 Teil1 $EVTPART1"}
Gruß Otto
Hallo;
Otto du hattest in beiden Dingen recht, so funktioniert es jetzt:
define n_batt_chk notify .*:[Bb]attery:.* {if (($EVENT =~ m/low/i) or ($EVTPART1 == 3)) {\
my $AttComment=AttrVal($NAME,"comment",0);;\
#Log 3, "comment ist $AttComment";;\
if ($AttComment ne 1) {\
my $DNAME = AttrVal($NAME,"alias",$NAME);;\
Log 3, 'about to use DebianMail';;\
{ DebianMail('vorname.nachname@mail.com','FHEM Batteriewarnung', "$DNAME -> $EVENT") };;\
Log 3,"Bat $DNAME $EVENT";;\
fhem "attr $NAME comment 1";;\
}\
}elsif (($EVENT =~ m/ok/i) or ($EVTPART1 == 100)) {\
if (AttrVal("$NAME","comment",0) eq 1){\
fhem("setreading $NAME lastBatChange ".localtime);;\
fhem("deleteattr $NAME comment")\
}\
}\
}
DANKE
Ich frag nochmal nach: Warum setzt Du ein Attribute? Warum nimmst Du kein Reading?
attribute setzen verändert die config, Readings werden im state File gespeichert.
Gruß Otto
Hallo Otto;
Wie ich schon erwähnt hatte, habe ich den Ursprungscode übernommen und mich damit ehrlich gesagt nicht weiter auseinander gesetzt. Auch mangels Kenntnis.
Hättest du diesbezüglich einen Optimierungstipp für mich?
Danke
Daniel
Naja, ich würde es einfach anstatt ins attr comment in ein reading comment schreiben?
ReadingsVal statt AttrVal
setreading statt attr
deletereading statt deleteattr
Gruß Otto
Hallo Otto;
Hab ich mit Readings umgesetzt und funktioniert perfekt. ;D
define n_batt_chk notify .*:[Bb]attery:.* {if (($EVENT =~ m/low/i) or ($EVTPART1 == 3)) {\
my $ReadingsComment=ReadingsVal($NAME,"comment",0);;\
#Log 3, "comment ist $ReadingsComment";;\
if ($ReadingsComment ne 1) {\
my $DNAME = ReadingsVal($NAME,"alias",$NAME);;\
Log 3, 'about to use DebianMail';;\
{ DebianMail('vorname.nachname@mail.com','FHEM Batteriewarnung', "$DNAME -> $EVENT") };;\
Log 3,"Bat $DNAME $EVENT";;\
fhem "setreading $NAME comment 1";;\
}\
}elsif (($EVENT =~ m/ok/i) or ($EVTPART1 == 100)) {\
if (ReadingsVal("$NAME","comment",0) eq 1){\
fhem("setreading $NAME lastBatChange ".localtime);;\
fhem("deletereading $NAME comment")\
}\
}\
}
Danke nochmal für die Unterstützung und die Tipps!
Gruß Daniel
Gibt's eigentlich irgenwo eine Nomenklaturerklärung der verwendeten Operatoren bei der Batteriewarnung: ($EVENT !~ m/ok/) oder ($EVENT =~ m/low/i), denn wenn ich ($EVENT <= /50/) verwende wird immer ausgelöst und bei ($EVENT <= 50) gar nie.
Ich hätte gerne einfach auch eine Warnung gemacht, wenn ZigBee Geräte bei battery 0 - 100 ausgeben, so in diesem Sinn:
.*:[Bb]attery:.* { if(($EVENT !~ m/ok/) and ($EVENT <= /50/)) {
{ DebianMail('xyt@x.net', 'HFHEM Batteriewarnung', $NAME.': '.$EVENT)};
Log 3, "$NAME : Batteriewarnung $EVENT";
}
}
Zitat von: chaot4ever am 08 Oktober 2020, 13:37:05
Gibt's eigentlich irgenwo eine Nomenklaturerklärung der verwendeten Operatoren bei der Batteriewarnung: ($EVENT !~ m/ok/) oder ($EVENT =~ m/low/i), denn wenn ich ($EVENT <= /50/) verwende wird immer ausgelöst und bei ($EVENT <= 50) gar nie.
Ich hätte gerne einfach auch eine Warnung gemacht, wenn ZigBee Geräte bei battery 0 - 100 ausgeben, so in diesem Sinn:
.*:[Bb]attery:.* { if(($EVENT !~ m/ok/) and ($EVENT <= /50/)) {
{ DebianMail('xyt@x.net', 'HFHEM Batteriewarnung', $NAME.': '.$EVENT)};
Log 3, "$NAME : Batteriewarnung $EVENT";
}
}
Evtl. das hier interessant: https://forum.fhem.de/index.php/topic,82637.msg747514.html#msg747514
Wenn ZigBee noch nicht drin sein sollte (glaube aber, dass es drin ist), einfach einen vorhandenen Block kopieren und anpassen ;)
(oder einfach einen nicht benötigten vorhandenen anpassen)
EDIT: wobei der Thread mit ZWave losging / um ZWave geht...
Gruß, Joachim
Zitat von: chaot4ever am 08 Oktober 2020, 13:37:05
Gibt's eigentlich irgenwo eine Nomenklaturerklärung der verwendeten Operatoren bei der Batteriewarnung:
Ja - aber hat eigentlich nichts mit der Batteriewarnung an sich zu tun sondern mit der Programmiersprache perl (bspw.):
https://de.wikibooks.org/wiki/Perl-Programmierung:_Operatoren und
https://de.wikibooks.org/wiki/Perl-Programmierung:_Regul%C3%A4re_Ausdr%C3%BCcke
@alanblack: Danke für den Link, das vereinfacht die Geschichte:
.*:[Bb]attery:.* { if(($EVENT !~ m/ok/) and ($EVENT !~ m/100/) and ($EVENT !~ m/[2-9][0-9]/)){
{ DebianMail('xyt@x.net', 'FHEM Batteriewarnung', $NAME.': '.$EVENT)};
Log 3, "$NAME : Batteriewarnung $EVENT";
}
}
So läuft alles entweder mit battery low/ok UND mit battery kleiner 20/100.
Danke!