Hallo zusammen,
ich habe hier zwei LEDs an einem Firmata-Arduino in FHEM eingebunden
define D11_OUT FRM_OUT 11
attr D11_OUT IODev FIRMATA1
attr D11_OUT restoreOnReconnect on
attr D11_OUT restoreOnStartup on
attr D11_OUT room Heizung
attr D11_OUT stateFormat value
define D12_OUT FRM_OUT 12
attr D12_OUT IODev FIRMATA1
attr D12_OUT restoreOnReconnect on
attr D12_OUT restoreOnStartup on
attr D12_OUT room Heizung
attr D12_OUT stateFormat value
Diese kann ich ganz wunderbar im Webinterface per Klick oder auch per "set D11_OUT on" bzw. "set D11_OUT off" schalten.
Nun möchte ich, dass der Ausgang D12_OUT per notify geschaltet wird, wenn D11_OUT geschaltet wird (am Ende dann sogar invertiert on->off, off->on; es hapert aber derzeit an den Basics). Ich habe im Wiki, in der Code Reference und in der Anfängeranleitung gelesen und werde einfach nicht schlau daraus:
define notifierD11_OUT notify D11_OUT set D12_OUT on
geht (schaltet dann aber D12_OUT immer on, egal ob D11_OUT on oder off geschaltet wird)
define notifierD11_OUT notify D11_OUT:on set D12_OUT on
geht nicht (es passiert nichts an D12_OUT)
Log:
2013.12.31 20:11:28 5: Cmd: >set D11_OUT on<
2013.12.31 20:11:28 5: >91,08,00
2013.12.31 20:11:28 5: SW: ш
2013.12.31 20:11:28 5: Triggering D11_OUT (1 changes)
2013.12.31 20:11:28 5: Notify loop for D11_OUT value: on
2013.12.31 20:11:29 4: HTTP FHEMWEB:192.168.2.160:64038 GET /fhem?room=Heizung
define notifierD11_OUT notify D11_OUT:on.* set D12_OUT on
geht nicht (es passiert nichts an D12_OUT)
Log:
2013.12.31 20:02:34 5: Cmd: >set D11_OUT on<
2013.12.31 20:02:34 5: >91,08,00
2013.12.31 20:02:34 5: SW: ш
2013.12.31 20:02:34 5: Triggering D11_OUT (1 changes)
2013.12.31 20:02:34 5: Notify loop for D11_OUT value: on
2013.12.31 20:02:34 4: HTTP FHEMWEB:192.168.2.160:62558 GET /fhem?room=Heizung
define notifierD11_OUT notify D11_OUT set D12_OUT %
geht nicht (es passiert nichts an D12_OUT)
Hier finde ich interessant, dass er "Cmd: >set D12_OUT value: on<" macht. Es müsste ja das Kommando "set D12_OUT on" sein.
Log:
2013.12.31 20:03:56 5: Cmd: >set D11_OUT on<
2013.12.31 20:03:56 5: >91,08,00
2013.12.31 20:03:56 5: SW: ш
2013.12.31 20:03:56 5: Triggering D11_OUT (1 changes)
2013.12.31 20:03:56 5: Notify loop for D11_OUT value: on
2013.12.31 20:03:56 5: Triggering notifierD11_OUT
2013.12.31 20:03:56 5: Cmd: >set D12_OUT value: on<
2013.12.31 20:03:56 3: notifierD11_OUT return value: Unknown argument value:, choose one of on off blink on-for-timer on-till off-for-timer intervals off-till
2013.12.31 20:03:56 4: HTTP FHEMWEB:192.168.2.160:62799 GET /fhem?room=Heizung
define notifierD11_OUT notify D11_OUT set D12_OUT $EVENT
geht nicht (es passiert nichts an D12_OUT)
Hier finde ich interessant, dass er das $EVENT garnicht parst.
Log:
2013.12.31 20:05:20 5: Cmd: >set D11_OUT on<
2013.12.31 20:05:20 5: >91,08,00
2013.12.31 20:05:20 5: SW: ш
2013.12.31 20:05:20 5: Triggering D11_OUT (1 changes)
2013.12.31 20:05:20 5: Notify loop for D11_OUT value: on
2013.12.31 20:05:20 5: Triggering notifierD11_OUT
2013.12.31 20:05:20 5: Cmd: >set D12_OUT $EVENT<
2013.12.31 20:05:20 3: notifierD11_OUT return value: Unknown argument value:, choose one of on off blink on-for-timer on-till off-for-timer intervals off-till
2013.12.31 20:05:20 4: HTTP FHEMWEB:192.168.2.160:63000 GET /fhem?room=Heizung
Hat jemand von euch eine Idee, woran es hapert?
Viele Grüße und guten Rutsch!
Kai
Hi Kai,
wenn das geht define notifierD11_OUT notify D11_OUT set D12_OUT on
aber das nicht define notifierD11_OUT notify D11_OUT:on set D12_OUT on
dann stimmt etwas mit dem "STATE", also mit dem "on" (define notifierD11_OUT notify D11_OUT:on set D12_OUT on) nicht.
Gucke mal in die Eigenschaften des Ausgangs, ob es wirklich "on" oder vielleicht "On" oder "ON" ist. Denn dein zweites Beispiel müsste eigentlich gehen.
Gruß
Frank
es heisst wirklich on (siehe Screenshot) und klappt leider nicht...
(http://s1.directupload.net/images/140101/mkzo3ieb.png) (http://www.directupload.net)
Ha! ;D Es gibt hier einen Unterschied zwischen "STATE" und "state". Deshalb geht es nicht. Du müsstest es aber mit "stateFormat" hinbekommen:
ZitatstateFormat
Modifies the STATE of the device, shown by the list command or in the room overview in FHEMWEB. If not set, its value is taken from the state reading. If set, then every word in the argument is replaced by the value of the reading if such a reading for the current device exists. If the value of this attribute is enclused in {}, then it is evaluated. This attribute is evaluated each time a reading is updated.
Weiter kann ich da allerdigs nicht helfen, da ich sowas noch nicht hatte. Stöbere einfach noch weiter im Forum zu state/STATE/stateFormat .
Gruß
Frank