FHEM Forum

FHEM => Automatisierung => Thema gestartet von: mfeske am 25 Oktober 2015, 18:51:18

Titel: ein ROOMMATE in zwei RESIDENTS
Beitrag von: mfeske am 25 Oktober 2015, 18:51:18
Hallo zusammen,

der vielleicht typische deutsche Haushalt, zwei Erwachsende und zwei Kinder. Ich würde dies gerne in 4 ROOMMATE (für jede Person eins und 3 RESIDENTS Eltern, Kinder und Bewohner einteilen. Erstellen von RESIDENTS funktioniert ja wie im Wiki, auch das Erstellen der ROOMMATE, aber wie kann ich jetzt den ROOMMATE einem weiteren RESIDENTS hinzufügen? Wenn ich dafür addRoommate wir ja versucht noch ein neuer ROOMMATE zu erzeugen der aber bereits besteht.

Gruß
Micha
Titel: ein ROOMMATE in zwei RESIDENTS
Beitrag von: Loredo am 25 Oktober 2015, 21:16:38
Schau mal in die fhem.cfg.demo, dort ist genau dieses Beispiel drin.

Grundsätzlich einfach die define-Definition der Roommate Devices ändern und alle Residents Devices dort mit Komma getrennt eintragen.

Wichtig ist, dass zunächst alle Residents Devices angelegt werden und dann die Roommates, damit diese sich dort auch registrieren können. Dabei kommt es auf die Speicherreihenfolge in fhem.cfg an.

Gruß
Julian
Titel: Antw:ein ROOMMATE in zwei RESIDENTS
Beitrag von: mfeske am 25 Oktober 2015, 21:44:09
Hallo Loredo,

so einfach es in das define einzutragen hatte ich es mir erhofft. Aber es scheint nicht zu funktionieren. Ich habe erst die RESIDENTS angelegt Bewohner, Eltern, Kinder. Dann habe ich die ROOMMATE angelegt Michael, Dana, Janic, Tania. Michael und Dana über Eltern. Hat auf Anhieb auch funktioniert. Ich habe dann die fhem.cfg geänder und ", Bewohner" ergänzt. Eine Änderung de Zustandes von Michael oder Dana wirkt sich aber nur auf Eltern, nicht auf Bewohner aus.

define michael
define rr_location_michael ROOMMATE Eltern, Bewohner
attr rr_location_michael alias Michael
attr rr_location_michael 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 rr_location_michael group location
attr rr_location_michael icon people_sensor
attr rr_location_michael room Haus,Residents
attr rr_location_michael rr_realname group
attr rr_location_michael sortby 1
attr rr_location_michael webCmd state


list RESIDENTS
Internals:
   NAME       Eltern
   NR         387
   NTFY_ORDER 50-Eltern
   ROOMMATES  rr_location_michael,rr_location_dana
   STATE      absent
   TYPE       RESIDENTS
   Readings:
     2015-10-25 21:34:18   lastActivity    absent
     2015-10-25 21:34:18   lastActivityBy  location
     2015-10-25 21:34:18   lastActivityByDev rr_location_michael
     2015-10-25 21:34:00   lastArrival     2015-10-25 21:34:00
     2015-10-25 21:34:17   lastDeparture   2015-10-25 21:34:17
     2015-10-25 21:34:00   lastDurAbsence  00:02:20
     2015-10-25 21:34:00   lastDurAbsence_cr 2
     2015-10-25 21:34:17   lastDurPresence 00:00:17
     2015-10-25 21:34:17   lastDurPresence_cr 0
     2015-10-25 21:34:17   lastState       home
     2015-10-25 21:34:17   presence        absent
     2015-10-25 21:34:17   residentsAbsent 2
     2015-10-25 21:34:17   residentsAbsentDevs rr_location_michael,rr_location_dana
     2015-10-25 21:34:17   residentsAbsentNames location,location
     2015-10-11 21:35:25   residentsAsleep 0
     2015-10-11 21:35:25   residentsAsleepDevs -
     2015-10-11 21:35:25   residentsAsleepNames -
     2015-10-11 21:35:25   residentsAwoken 0
     2015-10-11 21:35:25   residentsAwokenDevs -
     2015-10-11 21:35:25   residentsAwokenNames -
     2015-10-18 12:16:26   residentsGone   0
     2015-10-18 12:16:26   residentsGoneDevs -
     2015-10-18 12:16:26   residentsGoneNames -
     2015-10-11 21:35:37   residentsGotosleep 0
     2015-10-11 21:35:37   residentsGotosleepDevs -
     2015-10-11 21:35:37   residentsGotosleepNames -
     2015-10-25 21:34:17   residentsHome   0
     2015-10-25 21:34:17   residentsHomeDevs -
     2015-10-25 21:34:17   residentsHomeNames -
     2015-10-25 18:58:37   residentsTotal  2
     2015-10-25 21:34:17   residentsTotalAbsent 2
     2015-10-25 21:34:17   residentsTotalAbsentDevs rr_location_michael,rr_location_dana
     2015-10-25 21:34:17   residentsTotalAbsentNames location,location
     2015-10-11 21:35:25   residentsTotalGuests 0
     2015-10-11 21:35:25   residentsTotalGuestsAbsent 0
     2015-10-11 21:35:25   residentsTotalGuestsAbsentDevs -
     2015-10-11 21:35:25   residentsTotalGuestsAbsentNames -
     2015-10-11 21:35:25   residentsTotalGuestsPresent 0
     2015-10-11 21:35:25   residentsTotalGuestsPresentDevs -
     2015-10-11 21:35:25   residentsTotalGuestsPresentNames -
     2015-10-25 21:34:17   residentsTotalPresent 0
     2015-10-25 21:34:17   residentsTotalPresentDevs -
     2015-10-25 21:34:17   residentsTotalPresentNames -
     2015-10-11 21:35:25   residentsTotalWakeup 0
     2015-10-11 21:35:25   residentsTotalWakeupDevs -
     2015-10-11 21:35:25   residentsTotalWakeupNames -
     2015-10-11 21:35:25   residentsTotalWayhome 0
     2015-10-11 21:35:25   residentsTotalWayhomeDevs -
     2015-10-11 21:35:25   residentsTotalWayhomeNames -
     2015-10-25 21:34:17   state           absent
Attributes:
   alias      Eltern
   devStateIcon .*home:status_available:absent .*absent:status_away_1:home .*gone:status_standby:home .*none:control_building_empty .*gotosleep:status_night:asleep .*asleep:status_night:awoken .*awoken:status_available:home .*:user_unknown:home
   group      Home State
   icon       control_building_filled
   room       Haus,Residents
   webCmd     state

Internals:
   NAME       Bewohner
   NR         388
   NTFY_ORDER 50-Bewohner
   STATE      home
   TYPE       RESIDENTS
   Readings:
     2015-10-18 13:36:49   lastActivity    home
     2015-10-18 13:36:49   lastActivityBy  location_michael
     2015-10-18 13:36:49   lastActivityByDev location_michael
     2015-10-18 12:44:31   lastArrival     2015-10-18 12:44:31
     2015-10-18 12:44:29   lastDeparture   2015-10-18 12:44:29
     2015-10-18 12:44:31   lastDurAbsence  00:00:02
     2015-10-18 12:44:31   lastDurAbsence_cr 0
     2015-10-18 12:44:29   lastDurPresence 00:00:06
     2015-10-18 12:44:29   lastDurPresence_cr 0
     2015-10-18 12:44:31   lastState       absent
     2015-10-18 12:44:31   presence        present
     2015-10-18 13:36:49   residentsAbsent 0
     2015-10-18 13:36:49   residentsAbsentDevs -
     2015-10-18 13:36:49   residentsAbsentNames -
     2015-10-11 21:35:25   residentsAsleep 0
     2015-10-11 21:35:25   residentsAsleepDevs -
     2015-10-11 21:35:25   residentsAsleepNames -
     2015-10-11 21:35:25   residentsAwoken 0
     2015-10-11 21:35:25   residentsAwokenDevs -
     2015-10-11 21:35:25   residentsAwokenNames -
     2015-10-18 12:16:47   residentsGone   0
     2015-10-18 12:16:47   residentsGoneDevs -
     2015-10-18 12:16:47   residentsGoneNames -
     2015-10-11 21:35:37   residentsGotosleep 0
     2015-10-11 21:35:37   residentsGotosleepDevs -
     2015-10-11 21:35:37   residentsGotosleepNames -
     2015-10-18 13:36:49   residentsHome   4
     2015-10-18 13:36:49   residentsHomeDevs location_janic,location_tania,location_michael,location_dana
     2015-10-18 13:36:49   residentsHomeNames location_janic,location_tania,location_michael,location_dana
     2015-10-18 12:42:07   residentsTotal  4
     2015-10-18 13:36:49   residentsTotalAbsent 0
     2015-10-18 13:36:49   residentsTotalAbsentDevs -
     2015-10-18 13:36:49   residentsTotalAbsentNames -
     2015-10-11 21:35:25   residentsTotalGuests 0
     2015-10-11 21:35:25   residentsTotalGuestsAbsent 0
     2015-10-11 21:35:25   residentsTotalGuestsAbsentDevs -
     2015-10-11 21:35:25   residentsTotalGuestsAbsentNames -
     2015-10-11 21:35:25   residentsTotalGuestsPresent 0
     2015-10-11 21:35:25   residentsTotalGuestsPresentDevs -
     2015-10-11 21:35:25   residentsTotalGuestsPresentNames -
     2015-10-18 13:36:49   residentsTotalPresent 4
     2015-10-18 13:36:49   residentsTotalPresentDevs location_janic,location_tania,location_michael,location_dana
     2015-10-18 13:36:49   residentsTotalPresentNames location_janic,location_tania,location_michael,location_dana
     2015-10-11 21:35:25   residentsTotalWakeup 0
     2015-10-11 21:35:25   residentsTotalWakeupDevs -
     2015-10-11 21:35:25   residentsTotalWakeupNames -
     2015-10-11 21:35:25   residentsTotalWayhome 0
     2015-10-11 21:35:25   residentsTotalWayhomeDevs -
     2015-10-11 21:35:25   residentsTotalWayhomeNames -
     2015-10-18 12:44:31   state           home
Attributes:
   alias      Bewohner
   devStateIcon .*home:status_available:absent .*absent:status_away_1:home .*gone:status_standby:home .*none:control_building_empty .*gotosleep:status_night:asleep .*asleep:status_night:awoken .*awoken:status_available:home .*:user_unknown:home
   group      Home State
   icon       control_building_filled
   room       Haus,Residents
   webCmd     state


list ROOMMATE
Internals:
   DEF        Eltern, Bewohner
   NAME       rr_location_michael
   NR         391
   NTFY_ORDER 50-rr_location_michael
   RESIDENTGROUPS Eltern,
   STATE      absent
   TYPE       ROOMMATE
   Readings:
     2015-10-25 21:40:17   durTimerAbsence 00:06:00
     2015-10-25 21:40:17   durTimerAbsence_cr 6
     2015-10-25 21:31:40   durTimerPresence 00:00:00
     2015-10-25 21:31:40   durTimerPresence_cr 0
     2015-10-20 12:19:50   durTimerSleep   00:00:00
     2015-10-20 12:19:50   durTimerSleep_cr 0
     2015-10-25 21:34:05   lastArrival     2015-10-25 21:34:05
     2015-10-25 21:34:17   lastDeparture   2015-10-25 21:34:17
     2015-10-25 21:34:05   lastDurAbsence  00:02:25
     2015-10-25 21:34:05   lastDurAbsence_cr 2
     2015-10-25 21:34:17   lastDurPresence 00:00:12
     2015-10-25 21:34:17   lastDurPresence_cr 0
     2015-10-25 21:34:17   lastLocation    home
     2015-10-25 21:34:17   lastMood        calm
     2015-10-25 21:34:17   lastState       home
     2015-10-25 21:34:17   location        underway
     2015-10-25 21:34:17   mood            -
     2015-10-25 21:34:17   presence        absent
     2015-10-25 21:34:17   state           absent
     2015-10-20 12:20:02   wakeup          0
     2015-10-20 12:19:50   wayhome         0
   Timer:
     Rr_location_michael_autogone:
       HASH       rr_location_michael
       MODIFIER   AutoGone
       NAME       rr_location_michael_AutoGone
     Rr_location_michael_durationtimer:
       HASH       rr_location_michael
       MODIFIER   DurationTimer
       NAME       rr_location_michael_DurationTimer
Attributes:
   alias      Michael
   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      location
   icon       people_sensor
   room       Haus,Residents
   rr_realname group
   sortby     1
   webCmd     state

Internals:
   DEF        Eltern, Bewohner
   NAME       rr_location_dana
   NR         401
   NTFY_ORDER 50-rr_location_dana
   RESIDENTGROUPS Eltern,
   STATE      absent
   TYPE       ROOMMATE
   Readings:
     2015-10-25 21:41:11   durTimerAbsence 00:07:00
     2015-10-25 21:41:11   durTimerAbsence_cr 7
     2015-10-25 21:31:30   durTimerPresence 00:00:00
     2015-10-25 21:31:30   durTimerPresence_cr 0
     2015-10-25 18:58:37   durTimerSleep   00:00:00
     2015-10-25 18:58:37   durTimerSleep_cr 0
     2015-10-25 21:34:00   lastArrival     2015-10-25 21:34:00
     2015-10-25 21:34:11   lastDeparture   2015-10-25 21:34:11
     2015-10-25 21:34:00   lastDurAbsence  00:02:30
     2015-10-25 21:34:00   lastDurAbsence_cr 3
     2015-10-25 21:34:11   lastDurPresence 00:00:11
     2015-10-25 21:34:11   lastDurPresence_cr 0
     2015-10-25 21:34:11   lastLocation    home
     2015-10-25 21:34:11   lastMood        calm
     2015-10-25 21:34:11   lastState       home
     2015-10-25 21:34:11   location        underway
     2015-10-25 21:34:11   mood            -
     2015-10-25 21:34:11   presence        absent
     2015-10-25 21:34:11   state           absent
     2015-10-25 18:59:02   wakeup          0
     2015-10-25 18:58:37   wayhome         0
   Timer:
     Rr_location_dana_autogone:
       HASH       rr_location_dana
       MODIFIER   AutoGone
       NAME       rr_location_dana_AutoGone
     Rr_location_dana_durationtimer:
       HASH       rr_location_dana
       MODIFIER   DurationTimer
       NAME       rr_location_dana_DurationTimer
Attributes:
   alias      Dana
   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      location
   icon       people_sensor
   room       Haus,Residents
   rr_realname group
   sortby     1
   webCmd     state
Titel: Antw:ein ROOMMATE in zwei RESIDENTS
Beitrag von: Loredo am 27 Oktober 2015, 12:45:18
wie gesagt, maßgeblich ist die Reihenfolge der Devices in der fhem.cfg.


Gruß
Julian
Titel: Antw:ein ROOMMATE in zwei RESIDENTS
Beitrag von: Loredo am 27 Oktober 2015, 12:47:21
an den INTERNALS beim RESIDENTS Device kannst du aber auch sehen, dass die ROOMMATE Geräte sich entsprechend registriert haben.


Gruß
Julian
Titel: Antw:ein ROOMMATE in zwei RESIDENTS
Beitrag von: Loredo am 27 Oktober 2015, 12:48:54
Nochwas: Natürlich kein Leerzeichen bei den Devicenamen im Define, nur mit Komma trennen :-)


Gruß
Julian