Hallo,
folgendes notify ist bei mir definiert:
define HzgThermostatBuero_notify_1 notify HzgThermostat.*:battery:.low { fhem "set teleBot _msg @++++++++++ @++++++++++ Batterie leer bei $NAME";;;; }
attr HzgThermostatBuero_notify_1 devStateIcon low:10px-kreis-gelb off:10px-kreis-rot ok:10px-kreis-gruen
attr HzgThermostatBuero_notify_1 stateFormat battery
attr HzgThermostatBuero_notify_1 verbose 1
# DEF HzgThermostat.*:battery:.low { fhem "set teleBot _msg @++++++++++ @++++++++++ Batterie leer bei $NAME";; }
# FUUID 5ce84ec9-f33f-a625-9eb6-830fc44baabff9ee
# NAME HzgThermostatBuero_notify_1
# NOTIFYDEV HzgThermostat.*
# NR 150
# NTFY_ORDER 50-HzgThermostatBuero_notify_1
# REGEXP HzgThermostat.*:battery:.low
# STATE battery
# TRIGGERTIME 1742191243.30495
# TYPE notify
# eventCount 266
# READINGS:
# 2025-03-20 17:59:55 statStateDay active: 18:00:00 active_Count: 1
# 2025-03-19 23:59:55 statStateDayLast active: 24:00:00 active_Count: 1
# 2025-03-20 17:59:55 statStateHour active: 00:00:00 active_Count: 1
# 2025-03-20 17:59:55 statStateHourLast active: 01:00:00 active_Count: 1
# 2025-03-20 17:59:55 statStateMonth active: 19d 18:00:00 active_Count: 1
# 2025-02-28 23:59:55 statStateMonthLast active: 28d 00:00:00 active_Count: 1
# 2025-03-20 17:59:55 statStateYear active: 78d 18:00:00 active_Count: 1
# 2024-12-31 23:59:55 statStateYearLast active: 278d 07:03:30 active_Count: 1 (since: 2024-03-28_16:56:25)
# 2025-03-09 16:19:00 state active
# 2025-03-17 07:00:43 triggeredByDev HzgThermostatWohnzimmer
# 2025-03-17 07:00:43 triggeredByEvent battery: low
# helper:
# _98_statistics myStatDevice
#
setstate HzgThermostatBuero_notify_1 battery
setstate HzgThermostatBuero_notify_1 2025-03-20 17:59:55 statStateDay active: 18:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2025-03-19 23:59:55 statStateDayLast active: 24:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2025-03-20 17:59:55 statStateHour active: 00:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2025-03-20 17:59:55 statStateHourLast active: 01:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2025-03-20 17:59:55 statStateMonth active: 19d 18:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2025-02-28 23:59:55 statStateMonthLast active: 28d 00:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2025-03-20 17:59:55 statStateYear active: 78d 18:00:00 active_Count: 1
setstate HzgThermostatBuero_notify_1 2024-12-31 23:59:55 statStateYearLast active: 278d 07:03:30 active_Count: 1 (since: 2024-03-28_16:56:25)
setstate HzgThermostatBuero_notify_1 2025-03-09 16:19:00 state active
setstate HzgThermostatBuero_notify_1 2025-03-17 07:00:43 triggeredByDev HzgThermostatWohnzimmer
setstate HzgThermostatBuero_notify_1 2025-03-17 07:00:43 triggeredByEvent battery: low
damit soll mir mein Telegram-Bot die entsprechende Nachricht auf Telegramm zukommen lassen.
man sieht auch, dass das letzte Event am 17.3 um 07:00:43 erkannt wurde, und das notify angetriggert.
Aber ich sehe leider keine Nachricht im Telegramm.
Führe ich set teleBot _msg @+++++++++ @++++++++++ Batterie leer bei $NAME";
in der Eingabezeile aus, kommt "Batterie leer bei $NAME" genau so auf Telegram an.
Laut Log-Datei wurde davor und danach aber jeweils eine andere Nachricht erfolgreich gesendet:
2025-03-17_06:14:05 teleBot _msg @++++++++++ @++++++++++ Kamera hat Bewegung erkannt
2025-03-17_06:14:05 teleBot sentMsgResult: SUCCESS
2025-03-17_06:14:05 teleBot sentMsgId: 18027
2025-03-17_06:14:05 teleBot sentMsgPeerId: ++++++++++
2025-03-17_06:14:05 teleBot sentMsgResult: SUCCESS
2025-03-17_06:14:05 teleBot sentMsgId: 18028
2025-03-17_06:14:05 teleBot sentMsgPeerId: ++++++++++
2025-03-17_07:11:56 teleBot _msg @++++++++++ @++++++++++ Kamera hat Bewegung erkannt
2025-03-17_07:11:56 teleBot sentMsgResult: SUCCESS
2025-03-17_07:11:56 teleBot sentMsgId: 18029
2025-03-17_07:11:56 teleBot sentMsgPeerId: ++++++++++
2025-03-17_07:11:57 teleBot sentMsgResult: SUCCESS
2025-03-17_07:11:57 teleBot sentMsgId: 18030
2025-03-17_07:11:57 teleBot sentMsgPeerId: ++++++++++
Meiner Meinung nach hat das früher aber genauso auch funktioniert.
Wo liegt denn mein Fehler?
Vielen Dank für die Hilfe...
Wolfgang
Hallo Wolfgang,
probiere es Mal mit \@ bei den Empfängern
define HzgThermostatBuero_notify_1 notify HzgThermostat.*:battery:.low { fhem "set teleBot _msg \@++++++++++ \@++++++++++ Batterie leer bei $NAME";;;; }[\code]
Habs mal geändert...
wie triggere ich denn die entsprechende Nachricht dann?
trigger HzgThermostatBuero battery:low
oder anders?
Ein Device, was das auslösen soll:
define HzgThermostatBuero CUL_HM 3F8344
attr HzgThermostatBuero .mId 00AD
attr HzgThermostatBuero IODev Funkantenne
attr HzgThermostatBuero actCycle 004:00
attr HzgThermostatBuero actStatus alive
attr HzgThermostatBuero alias Thermostat Büro
attr HzgThermostatBuero autoReadReg 5_readMissing
attr HzgThermostatBuero devStateIcon low:10px-kreis-gelb off:10px-kreis-rot ok:10px-kreis-gruen
attr HzgThermostatBuero event-min-interval .*:900
attr HzgThermostatBuero event-on-change-reading .*
attr HzgThermostatBuero event-on-update-reading .*
attr HzgThermostatBuero expert defReg,allReg,rawReg,templ
attr HzgThermostatBuero firmware 1.3
attr HzgThermostatBuero model HM-TC-IT-WM-W-EU
attr HzgThermostatBuero msgRepeat 1
attr HzgThermostatBuero room Büro,Heizung,System
attr HzgThermostatBuero serialNr MEQ1571498
attr HzgThermostatBuero stateFormat battery
attr HzgThermostatBuero subType thermostat
attr HzgThermostatBuero verbose 1
attr HzgThermostatBuero webCmd getConfig:clear msgEvents
# DEF 3F8344
# FUUID 5ce84eb9-f33f-a625-c910-4dc5076d284ebed3
# Funkantenne_MSGCNT 12961
# Funkantenne_RAWMSG A0CD784703F834400000000E620::-59.5:Funkantenne
# Funkantenne_RSSI -59.5
# Funkantenne_TIME 2025-03-20 18:52:52
# IODev Funkantenne
# LASTInputDev Funkantenne
# MSGCNT 12961
# NAME HzgThermostatBuero
# NOTIFYDEV global
# NR 39
# NTFY_ORDER 48-HzgThermostatBuero
# STATE ok
# TYPE CUL_HM
# channel_01 HzgStatusBuero
# channel_02 HzgSetBuero
# channel_03 unused_HzgFensterKontaktBuero
# channel_06 unused_HzgFernBuero
# channel_07 HzgVentilBuero.out
# eventCount 13231
# lastMsg No:D7 - t:70 s:3F8344 d:000000 00E620
# protLastRcv 2025-03-20 18:52:52
# protRcv 12961 last_at:2025-03-20 18:52:52
# protSnd 12 last_at:2025-03-20 06:19:41
# protState CMDs_done
# rssi_at_Funkantenne cnt:12961 min:-88 max:-53.5 avg:-59.17 lst:-59.5
# Helper:
# DBLOG:
# measured-temp:
# mySQLDB:
# TIME 1742491046.18007
# VALUE 23.0
# statMeasured-tempDayAvgLast:
# mySQLDB:
# TIME 1742425195.12538
# VALUE 23.3
# statMeasured-tempHourAvgLast:
# mySQLDB:
# TIME 1742489995.11431
# VALUE 22.9
# READINGS:
# 2025-03-09 16:29:03 Activity alive
# 2025-01-13 08:31:49 CommandAccepted yes
# 2024-03-28 16:56:16 D-firmware 1.3
# 2024-03-28 16:56:16 D-serialNr MEQ1571498
# 2025-03-20 06:19:40 IODev Funkantenne
# 2024-03-31 09:51:09 PairedTo 0xF11034
# 2024-03-31 09:51:09 R-btnLock off
# 2024-03-31 09:51:09 R-burstRx on
# 2024-03-31 09:51:09 R-cyclicInfoMsg on
# 2024-03-31 09:51:09 R-cyclicInfoMsgDis 1
# 2024-03-31 09:51:09 R-globalBtnLock off
# 2024-03-31 09:51:09 R-localResDis off
# 2024-03-31 09:51:09 R-lowBatLimitRT 2.2 V
# 2024-03-31 09:51:09 R-modusBtnLock off
# 2024-03-31 09:51:09 R-pairCentral 0xF11034
# 2024-03-31 09:51:09 RegL_00. 00:00 01:01 02:01 09:01 0A:F1 0B:10 0C:34 0F:00 11:01 12:16 16:00 18:00 19:00 1A:00
# 2024-09-26 20:41:57 RegL_07.
# 2025-03-20 18:17:26 battery ok
# 2025-03-20 18:17:26 batteryLevel 2.5
# 2025-03-09 14:55:18 cfgState ok
# 2025-03-20 06:19:41 commState CMDs_done
# 2025-03-20 18:17:26 desired-temp 21.0
# 2025-03-20 18:17:26 measured-temp 23.0
# 2024-10-23 09:23:56 powerOn 2024-10-23 09:23:56
# 2024-10-23 09:23:56 recentStateType info
# 2025-03-20 18:52:52 statMeasured-tempDay Min: 22.6 Avg: 23.0 Max: 23.5
# 2025-03-20 18:52:52 statMeasured-tempDayAvg 23.0
# 2025-03-19 23:59:55 statMeasured-tempDayAvgLast 23.3
# 2025-03-19 23:59:55 statMeasured-tempDayLast Min: 22.2 Avg: 23.3 Max: 24.2
# 2025-03-20 18:52:52 statMeasured-tempHour Min: 22.8 Avg: 23.0 Max: 23.0
# 2025-03-20 18:52:52 statMeasured-tempHourAvg 23.0
# 2025-03-20 17:59:55 statMeasured-tempHourAvgLast 22.9
# 2025-03-20 17:59:55 statMeasured-tempHourLast Min: 22.8 Avg: 22.9 Max: 23.0
# 2025-03-20 18:52:52 statMeasured-tempMonth Min: 21.4 Avg: 23.4 Max: 25.3
# 2025-03-20 18:52:52 statMeasured-tempMonthAvg 23.4
# 2025-02-28 23:59:55 statMeasured-tempMonthAvgLast 23.3
# 2025-02-28 23:59:55 statMeasured-tempMonthLast Min: 22.0 Avg: 23.3 Max: 24.5
# 2025-03-20 18:52:52 statMeasured-tempYear Min: 15.9 Avg: 23.2 Max: 25.3
# 2024-12-31 23:59:55 statMeasured-tempYearLast Min: 18.7 Avg: 23.9 Max: 26.9 (since: 2024-03-28_17:10:59 )
# 2025-03-20 06:19:41 state CMDs_done
# 2025-03-20 06:19:41 time-request -
# helper:
# HM_CMDNR 215
# PONtest 1
# _98_statistics myStatDevice
# lastMsgTm 1742493172.92094
# mId 00AD
# peerFriend -
# peerOpt -:thermostat
# regLst 0
# rxType 6
# supp_Pair_Rep 0
# cmds:
# TmplKey :no:1741533544.85012
# TmplTs 1741533544.85012
# cmdKey 0:1:0::HzgThermostatBuero:00AD:01:
# cmdLst:
# assignHmKey noArg
# clear [({msgErrors}|msgEvents|rssi|attack|trigger|register|oldRegs|readings|all)]
# deviceRename -newName-
# fwUpdate -filename- [-bootTime-]
# getConfig noArg
# getDevInfo noArg
# getRegRaw (List0|List1|List2|List3|List4|List5|List6|List7) [-peerChn-]
# inhibit [(on|{off})]
# raw -data- [...]
# regBulk -list-.-peerChn- -addr1:data1- [-addr2:data2-]...
# regSet [(prep|{exec})] -regName- -value- [-peerChn-]
# reset noArg
# sysTime noArg
# tplDel -tplDel-
# tplSet_0 -tplChan-
# unpair noArg
# lst:
# condition slider,0,1,255
# peer
# peerOpt
# tplChan
# tplDel
# tplPeer
# rtrvLst:
# cmdList [({short}|long)]
# deviceInfo [({short}|long)]
# list [({normal}|full)]
# param -param-
# reg -addr- -list- [-peerChn-]
# regList noArg
# regTable noArg
# regVal -addr- -list- [-peerChn-]
# saveConfig [-filename-]
# tplInfo noArg
# expert:
# def 1
# det 1
# raw 1
# tpl 1
# io:
# flgs 0
# newChn +3F8344,00,00,00
# nextSend 1742493173.02027
# rxt 0
# vccu
# p:
# 3F8344
# 00
# 00
# 00
# prefIO:
# mRssi:
# mNo D7
# io:
# Funkantenne:
# -53.5
# -53.5
# peerIDsH:
# prt:
# bErr 0
# sProc 0
# rspWait:
# q:
# qReqConf
# qReqStat
# role:
# dev 1
# prs 1
# rssi:
# at_Funkantenne:
# avg -59.1776869068743
# cnt 12961
# lst -59.5
# max -53.5
# min -88
# shRegW:
# 07 02
# tmpl:
#
setstate HzgThermostatBuero ok
setstate HzgThermostatBuero 2025-03-09 16:19:04 .associatedWith HzgSetBuero,HzgStatusBuero,HzgThermostatBuero,HzgVentilBuero.out,unused_HzgFensterKontaktBuero,unused_HzgFernBuero,HzgThermostatBuero
setstate HzgThermostatBuero 2025-03-20 18:52:52 .protLastRcv 20250320185252
setstate HzgThermostatBuero 2025-03-09 16:29:03 Activity alive
setstate HzgThermostatBuero 2025-01-13 08:31:49 CommandAccepted yes
setstate HzgThermostatBuero 2024-03-28 16:56:16 D-firmware 1.3
setstate HzgThermostatBuero 2024-03-28 16:56:16 D-serialNr MEQ1571498
setstate HzgThermostatBuero 2025-03-20 06:19:40 IODev Funkantenne
setstate HzgThermostatBuero 2024-03-31 09:51:09 PairedTo 0xF11034
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-btnLock off
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-burstRx on
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-cyclicInfoMsg on
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-cyclicInfoMsgDis 1
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-globalBtnLock off
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-localResDis off
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-lowBatLimitRT 2.2 V
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-modusBtnLock off
setstate HzgThermostatBuero 2024-03-31 09:51:09 R-pairCentral 0xF11034
setstate HzgThermostatBuero 2024-03-31 09:51:09 RegL_00. 00:00 01:01 02:01 09:01 0A:F1 0B:10 0C:34 0F:00 11:01 12:16 16:00 18:00 19:00 1A:00
setstate HzgThermostatBuero 2024-09-26 20:41:57 RegL_07.
setstate HzgThermostatBuero 2025-03-20 18:17:26 battery ok
setstate HzgThermostatBuero 2025-03-20 18:17:26 batteryLevel 2.5
setstate HzgThermostatBuero 2025-03-09 14:55:18 cfgState ok
setstate HzgThermostatBuero 2025-03-20 06:19:41 commState CMDs_done
setstate HzgThermostatBuero 2025-03-20 18:17:26 desired-temp 21.0
setstate HzgThermostatBuero 2025-03-20 18:17:26 measured-temp 23.0
setstate HzgThermostatBuero 2024-10-23 09:23:56 powerOn 2024-10-23 09:23:56
setstate HzgThermostatBuero 2024-10-23 09:23:56 recentStateType info
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempDay Min: 22.6 Avg: 23.0 Max: 23.5
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempDayAvg 23.0
setstate HzgThermostatBuero 2025-03-19 23:59:55 statMeasured-tempDayAvgLast 23.3
setstate HzgThermostatBuero 2025-03-19 23:59:55 statMeasured-tempDayLast Min: 22.2 Avg: 23.3 Max: 24.2
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempHour Min: 22.8 Avg: 23.0 Max: 23.0
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempHourAvg 23.0
setstate HzgThermostatBuero 2025-03-20 17:59:55 statMeasured-tempHourAvgLast 22.9
setstate HzgThermostatBuero 2025-03-20 17:59:55 statMeasured-tempHourLast Min: 22.8 Avg: 22.9 Max: 23.0
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempMonth Min: 21.4 Avg: 23.4 Max: 25.3
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempMonthAvg 23.4
setstate HzgThermostatBuero 2025-02-28 23:59:55 statMeasured-tempMonthAvgLast 23.3
setstate HzgThermostatBuero 2025-02-28 23:59:55 statMeasured-tempMonthLast Min: 22.0 Avg: 23.3 Max: 24.5
setstate HzgThermostatBuero 2025-03-20 18:52:52 statMeasured-tempYear Min: 15.9 Avg: 23.2 Max: 25.3
setstate HzgThermostatBuero 2024-12-31 23:59:55 statMeasured-tempYearLast Min: 18.7 Avg: 23.9 Max: 26.9 (since: 2024-03-28_17:10:59 )
setstate HzgThermostatBuero 2025-03-20 06:19:41 state CMDs_done
setstate HzgThermostatBuero 2025-03-20 06:19:41 time-request -
Dieses Notify kommt aber ohne die \@ aus:
define notify_fhem_reload notify global:INITIALIZED set teleBot _msg @345191095 @2024443488 fhem newly started - just now !
attr notify_fhem_reload comment Meldet sich, wenn fhem neu gestartet wurde
attr notify_fhem_reload verbose 1
# DEF global:INITIALIZED set teleBot _msg @345191095 @2024443488 fhem newly started - just now !
# FUUID 5ce84ebc-f33f-a625-d262-ef84399d97909d21
# NAME notify_fhem_reload
# NOTIFYDEV global
# NR 93
# NTFY_ORDER 50-notify_fhem_reload
# REGEXP global:INITIALIZED
# STATE 2025-03-09 16:19:03
# TRIGGERTIME 1741533544.60998
# TYPE notify
# READINGS:
# 2025-03-09 16:18:59 state active
# 2025-03-09 16:19:03 triggeredByDev global
# 2025-03-09 16:19:03 triggeredByEvent INITIALIZED
#
setstate notify_fhem_reload 2025-03-09 16:19:03
setstate notify_fhem_reload 2025-03-09 16:18:59 state active
setstate notify_fhem_reload 2025-03-09 16:19:03 triggeredByDev global
setstate notify_fhem_reload 2025-03-09 16:19:03 triggeredByEvent INITIALIZED
Was passiert denn, wenn Du es wie von Dir vorgeschlagen versuchst? Schau doch mal in den parallel geöffneten event monitor
ZitatDieses Notify kommt aber ohne die \@ aus:
Dort wird aber kein Perl ausgeführt.
Hallo,
das mit dem Perl-Befehl habe ich bereits korrigiert (sollte ja nicht notwendig sein, wenn es beim anderen notify ohne geht?):
defmod HzgThermostatBuero_notify_1 notify HzgThermostat.*:battery:.low set teleBot _msg @xxxxxxxxxx @xxxxxxxxxx Batterie leer bei $NAME
Ich glaube aber, dass mein Suchmuster nicht auslöst...,
Ich weiß aber auch nicht, wie ich das Testtrigger-Kommando schreiben sollte, damit er genau dem entspricht, was nachher vom device kommt.
Ich habe gerade mal die Events mitprotokolliert, und dann das notify anpassen lassen:
defmod HzgThermostatBuero_notify_1 notify HzgThermostat.*:battery:.low|HzgThermostatBuero:battery:.ok set teleBot _msg @345191095 @2024443488 Batterie leer bei $NAME
attr HzgThermostatBuero_notify_1 devStateIcon low:10px-kreis-gelb off:10px-kreis-rot ok:10px-kreis-gruen
attr HzgThermostatBuero_notify_1 stateFormat battery
attr HzgThermostatBuero_notify_1 verbose 5
aber da bekomme ich auch keine Nachricht...
Probiere es doch einfach mal damit, was in Deinem notify steht...
trigger HzgThermostatBuero battery: low
und achte darauf, was danach im notify in den readings triggeredByDev und triggeredByEvent steht
Zitat von: betateilchen am 20 März 2025, 19:52:57Probiere es doch einfach mal damit, was in Deinem notify steht...
trigger HzgThermostatBuero battery: low
und achte darauf, was danach im notify in den readings triggeredByDev und triggeredByEvent steht
Danke für den Tipp..., es geht jetzt...
Das mit dem Leerzeichen vor dem " low" oder dem " ok" habe ich wohl übersehen.
Nachdem ich vom Bürothermostat das Event für "battery ok" rauskopiert habe, und es angepasst habe auf alle Thermostate, habe ich versucht, dieses Event am Bürothermostat selber zu erzeugen.
Just in dem Augenblick kam dann aber vom Wohnzimmerthermostat das gleiche Event, und die Nachricht wurde gesendet.
na sowas... kaum macht mans richtig, schon klappts...
Zitat von: betateilchen am 20 März 2025, 20:19:26na sowas... kaum macht mans richtig, schon klappts...
ja ja ;D
Heute früh hat mein notify von meiner Fernbedienung nicht mehr funktioniert, weil sich da etwas verstellt hatte:
defmod FBSchwarz_Btn_01_notify_1 notify FBSchwarz:FBSchwarz_Btn_01.Short set AlleRolladen assignHmKey
statt
define FBSchwarz_Btn_01_notify_1 notify FBSchwarz:FBSchwarz_Btn_01.Short set AlleRolladen up
ich wüßte aber nicht, dass ich dort den modify-Button zum Ändern gedrückt hätte...
zumal ich dort bestimmt nicht drin war...
Wie kann so was passieren?
Viele Grüße
Wolfgang
Zitat von: wowogiengen am 21 März 2025, 17:27:17Wie kann so was passieren?
Im Event Monitor versehentlich die falsche Zeile markiert und auf "Create/Modify device" geklickt.
Deshalb benenne ich solche automatisch generierten notify grundsätzlich nach dem Anlegen um.