Hallo zusammen,
ich habe einen G-Tag und möchte ein Roommate-State damit steuern. Leider wird der Roommate-Status nicht geändert wenn der G-Tag zwischen present/ absent schaltet. Woran kann das liegen?
defmod Gtag PRESENCE lan-bluetooth <BLUETOOTH-MAC> 127.0.0.1:5333 5
attr Gtag absenceThreshold 10
attr Gtag room Bewohner
attr Gtag verbose 5
defmod PersonA ROOMMATE Bewohner
attr PersonA alias PersonA
attr PersonA devStateIcon .*home:user_available:absent .*absent:user_away:home .*gone:user_ext_away:home .*gotosleep:scene_toilet:asleep .*asleep:scene_sleeping:awoken .*awoken:scene_sleeping_alternat:home .*:user_unknown:home
attr PersonA group PersonA
attr PersonA icon people_sensor
attr PersonA room Bewohner
attr PersonA rr_presenceDevices Gtag
attr PersonA rr_realname alias
attr PersonA sortby 1
attr PersonA verbose 5
attr PersonA webCmd state
Der G-Tag funktioniert - nur leider wird das Ergebnis nicht an den Roommate weitergereicht. Muss ich noch irgendwas definieren oder geht das nur über ein notify?
Leider hilft Dein define oder Dein raw hier nicht weiter.
Bitte mache jeweils von beiden Devices ein list
Gerne!
Roommate:
Internals:
DEF Bewohner
DURATIONTIMER 1552683967.40025
NAME PersonA
NOTIFYDEV global,GtagPersonA
NR 22
NTFY_ORDER 50-PersonA
READY 1
RESIDENTGROUPS Bewohner
STATE home
TYPE ROOMMATE
TYPE ROOMMATE
READINGS:
2019-03-15 15:49:54 durTimerAbsence 00:00:00
2019-03-15 15:49:54 durTimerAbsence_cr 0
2019-03-15 15:48:19 durTimerPresence 00:00:00
2019-03-15 15:48:19 durTimerPresence_cr 0
2019-03-06 18:36:57 durTimerSleep 00:00:00
2019-03-06 18:36:57 durTimerSleep_cr 0
2019-03-15 15:49:54 lastArrival 2019-03-15 15:49:54
2019-03-15 15:48:19 lastDeparture 2019-03-15 15:48:19
2019-03-15 15:49:54 lastDurAbsence 00:01:35
2019-03-15 15:49:54 lastDurAbsence_cr 2
2019-03-15 15:48:19 lastDurPresence 00:24:22
2019-03-15 15:48:19 lastDurPresence_cr 24
2019-03-15 15:48:19 lastLocation home
2019-03-11 23:14:26 lastLocationAddr -
2019-03-11 23:14:26 lastLocationLat 48.0
2019-03-11 23:14:26 lastLocationLong 11.00
2019-03-15 15:48:19 lastMood calm
2019-03-15 15:49:54 lastState absent
2019-03-15 15:49:54 location home
2019-03-11 23:14:26 locationAddr -
2019-03-15 15:30:44 locationLat 48.0
2019-03-15 15:30:44 locationLong 11.0
2019-03-11 23:14:26 locationPresence present
2019-03-15 15:49:54 mood calm
2019-03-15 15:49:54 presence present
2019-03-15 15:49:54 state home
2019-03-06 18:42:21 wayhome 0
TIMER:
PersonA_DurationTimer:
HASH PersonA
MODIFIER DurationTimer
NAME PersonA_DurationTimer
Attributes:
alias PersonA
devStateIcon .*home:user_available:absent .*absent:user_away:home .*gone:user_ext_away:home .*gotosleep:scene_toilet:asleep .*asleep:scene_sleeping:awoken .*awoken:scene_sleeping_alternat:home .*:user_unknown:home
group PersonA
icon people_sensor
room Bewohner
rr_presenceDevices GtagPersonA
rr_realname alias
sortby 1
verbose 5
webCmd state
GTAG:
Internals:
ADDRESS <MAC_ADDRESSE>
DEF lan-bluetooth <MAC_ADDRESSE> 127.0.0.1:5333 5
DeviceName 127.0.0.1:5333
FD 4
INTERVAL_NORMAL 5
INTERVAL_PRESENT 5
MODE lan-bluetooth
NAME GtagPersonA
NOTIFYDEV global
NR 59
NTFY_ORDER 50-GtagPersonA
PARTIAL
STATE present
TYPE PRESENCE
READINGS:
2019-03-15 15:23:57 command_accepted yes
2019-03-15 15:52:59 daemon lepresenced V0.83
2019-03-15 15:52:59 device_name Gigaset G-tag
2019-03-15 15:52:59 model lan-lepresenced
2019-03-15 15:52:59 presence present
2019-03-15 15:52:59 rssi -91
2019-03-15 15:52:59 state present
helper:
CURRENT_STATE present
CURRENT_TIMEOUT normal
Attributes:
absenceThreshold 10
room Bewohner
verbose 5
Beim Roommate fehlt leider der wichtige Teil. Das obere 1/4
Hab ich oben ergänzt - sorry.
Sieht gut aus so weit. Kannst Du bitte einmal schauen ob Dein Eventmonitor für Dein GTag Device auch ein Event aus spuckt.
Der Eventmonitor funktioniert bei mir leider nicht (keine Ahnung wieso), aber folgendes Notify klappt:
defmod GtagPersonA.presence notify GtagPersonA.* { \
if(Value("GtagPersonA") eq "absent") { fhem("set PersonA absent;;") ;; }\
else { fhem("set PersonA home ;;");; }\
}
Damit muss das state-Event ja schießen... ggf. noch andere Ideen? Vielen Dank!
Das muss nicht unbedingt heißen das es klappt. Roommate triggert auf das Reading state und das Reading presence.
defmod GtagPersonA.presence notify GtagPersonA.* {
Log(1,'Event ist: ' . $EVENT);
}
Schau dann mal ins Logfile von FHEM, da sollten dann die Events drin stehen
2019.03.16 20:07:32 1: Event ist: present
2019.03.16 20:07:32 1: Event ist: presence: present
2019.03.16 20:07:32 1: Event ist: daemon: lepresenced V0.83
2019.03.16 20:07:32 1: Event ist: device_name: Gigaset G-tag
2019.03.16 20:07:32 1: Event ist: model: lan-lepresenced
2019.03.16 20:07:32 1: Event ist: rssi: -90
Würde sagen alles dabei, was man braucht, oder? Sowohl state als auch presence.
Sieht gut aus. Und dennoch geht Roommate nicht auf Home bei present und nicht auf absent wenn gtag absent ist?
Da bin ich gerade Ratlos
Exakt so ist es - ich auch. Hab es mit einem Notify vorübergehend gelöst...
Hi, gibts hier schon eine Lösung?
Habe auch das Problem.
Presence Device mit Lan-ping angelegt und als Attribut bei rr_presenceDevices hinterlegt. Wird mir im Roommate auch als NOTIFYDEV angezeigt. Jedoch werden keine Statusänderungen übernommen...
Ideen?
Kannst Du mal den Eventmonitor auf machen und schauen welche Events dein presence Device wirfst.
Zitat von: CoolTux am 26 Oktober 2019, 10:10:36
Kannst Du mal den Eventmonitor auf machen und schauen welche Events dein presence Device wirfst.
Ganz normal present und absent:
2019-10-26 11:18:53.831 PRESENCE Leo_Handy present
2019-10-26 11:18:53.831 PRESENCE Leo_Handy presence: present
Zeig mal bitte ein list vom Roommate Device
Die Verlinkungen zum PRESENCE Device zeigt er sogar richtig an..
Internals:
CHANGED
DEF Bewohner
DURATIONTIMER 1572084147.24791
FUUID 5db40a36-f33f-b7e0-7474-3b50b49a856de5e6
FVERSION 20_ROOMMATE.pm:0.195330/2019-06-02
NAME Leo
NOTIFYDEV global,Leo_Handy
NR 451
NTFY_ORDER 50-Leo
READY 1
RESIDENTGROUPS Bewohner
STATE ???
SUBTYPE adult
TYPE ROOMMATE
READINGS:
2019-10-26 10:56:37 durTimerAbsence 00:00:00
2019-10-26 10:56:37 durTimerAbsence_cr 0
2019-10-26 10:56:37 durTimerPresence 00:00:00
2019-10-26 10:56:37 durTimerPresence_cr 0
2019-10-26 10:56:37 durTimerSleep 00:00:00
2019-10-26 10:56:37 durTimerSleep_cr 0
TIMER:
Leo_DurationTimer:
HASH Leo
MODIFIER DurationTimer
NAME Leo_DurationTimer
Attributes:
alias Status
devStateIcon .*home:user_available:absent .*absent:user_away:home .*gone:user_ext_away:home .*gotosleep:scene_toilet:asleep .*asleep:scene_sleeping:awoken .*awoken:scene_sleeping_alternat:home .*:user_unknown:home
group Leo
icon people_sensor
room Residents
rr_presenceDevices Leo_Handy
rr_realname group
sortby 1
webCmd state
Kannst bitte einmal den Roommate auf verbose 5 stellen und dann beim presence Device auf absent oder present gehen.
Sieht alles gut aus oder?
2019.10.26 13:58:01.483 4: ROOMMATE Leo: Syncing status with Leo_Handy = present
2019.10.26 13:58:21.589 4: ROOMMATE Leo: Syncing status with Leo_Handy = present
2019.10.26 13:58:34.809 4: ROOMMATE Leo: Syncing status with Leo_Handy = present
2019.10.26 13:58:34.817 4: ROOMMATE Leo: Syncing status with Leo_Handy = present
2019.10.26 13:58:48.265 4: ROOMMATE Leo: Syncing status with Leo_Handy = absent
2019.10.26 13:58:48.281 4: ROOMMATE Leo: Syncing status with Leo_Handy = absent
2019.10.26 13:59:09.707 4: ROOMMATE Leo: Syncing status with Leo_Handy = present
2019.10.26 13:59:09.722 4: ROOMMATE Leo: Syncing status with Leo_Handy = present
Was mir aufgefallen ist, bei Probably associated with steht das Presence Device nicht drinnen, sollte aber oder?
Nein da muss nichts vom presence Device stehen.
Irgendwie geht Dein Roommate nicht richtig. Sind auch zu wenig Readings. Hast mal den Status von Hand gestellt?
habe es jetzt manuell versucht, dann geht es.
das heißt es muss einmal ein wert gesetzt werden damit er automatisch aktualisiert..!
Mann.... da hätte ich selbst auch draufkommen können... Danke dir trotzdem!
Dann stelle bitte einmal auf gelöst.