Ich habe das "peer" wohl noch nicht richtig verstanden

Begonnen von ujaudio, 03 Januar 2016, 15:03:21

Vorheriges Thema - Nächstes Thema

ujaudio

Ich steuere abhängig davon, ob der Ventilator der Dunstabzugshaube läuft oder nicht einen weiteren Ventilator im langen Abluftkanal. Das funktioniert auch einwandfrei. Ich bin wie in http://www.fhemwiki.de/wiki/HM-ES-PMSw1-Pl_Funk-Schaltaktor_1-fach_mit_Leistungsmessung beschrieben vorgegangen. Soweit so gut. Ein Punkt ist mir allerdings noch unklar. Im Wiki steht:
set HM-ES-PMSw1-Pl_Senl peerChan 0 hm_aktor set
und an anderer Stelle:
wird ein Event mit dem Wert 0 gesendet (daraus machen wir später im Aktor ein off)
Da mir nicht klar war,wie ich im Aktor aus der 0 ein off machen kann, habe ich mir anders beholfen. Ich habe das Peering nicht mir dem Aktor gemacht, sondern mal ohne darüber nachzudenken mit einem Kanal der VCCU. Und ein DOIF schaltet dann den Aktor.

Wie würde denn "ein Wissender" die Aufgabe lösen?
Einen lieben Gruß
Jürgen

franky08

ZitateventMap
Replace event names and set arguments. The value of this attribute consists of a list of space separated values, each value is a colon separated pair. The first part specifies the "old" value, the second the new/desired value. If the first character is slash(/) or comma(,) then split not by space but by this character, enabling to embed spaces. Examples:
attr store eventMap on:open off:closed
attr store eventMap /on-for-timer 10:open/off:closed/
set store open
The explicit variant of this attribute has the following syntax:
attr store eventMap { dev=>{"on"=>"open"}, usr=>{"open"=>"on"} }
attr store eventMap { dev=>{"^on(-for-timer)?(.*)"=>"open$2"}, usr=>{"^open(.*)"=>"on$1"}, fw=>{"^open(.*)"=>"open"} }
This variant must be used, if the mapping is not symmetrical, the first part (dev) representing the device to user mapping, i.e. if the device reports on 100 or on-for-timer 100, the user will see open 100. The second part (usr) is the other direction, if the user specified open 10, the device will receive on 10. On both occasions the key will be first compared directly with the text, and if it is not equal, then it will be tried to match it as a regexp. When using regexps in the usr part with wildcards, the fw part must be filled with the exact same keys to enable a correct display in the FHEMWEB set dropdown list in the detail view.
eventMap ist dein Freund

VG
Frank
Debian Bookworm auf HUNSN / Debian Bullseye auf 2.ter HUNSN F2F an 2x RaspiB
mit FHEM aktuell
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu, raspmatic_rpi3, HMIP-HCU1

ujaudio

Wieder etwas dazu gelernt.

Da bei mir entweder der Wert 20 oder der Wert 80 erzeugt wird, brauche ich nur ein
attr mySwitch eventMap on:80 off:20
und kann direkt mit mySwitch peeren.

Die weiteen Fragen, die sich mir daraus ergeben, kann ich mir selber erarbeiten, z.B. hat mySwitch dan den Status on oder den Status 80?
Einen lieben Gruß
Jürgen