Hallo Zusammen,
habe mir für meine DOIF ein readingsGroup gebaut.
Funktioniert soweit auch schon, aber leider bekomme ich den Geräten nicht ihr individuelles Icon zugeordnet.
Wo habe ich mein Denkfehler?
Danke und Grüße
Internals:
DEF Waschmaschine_Status:state,cmd Waeschetrockner_Status:state,cmd
NAME rg_SteckdosenKellerStatus
NR 1158
NTFY_ORDER 50-rg_SteckdosenKellerStatus
STATE Initialized
TYPE readingsGroup
mayBeVisible 1
Content:
Waeschetrockner_Status 1
Waschmaschine_Status 1
Content2:
DEVICES:
ARRAY(0x33cf4c8)
ARRAY(0x34f00c0)
Fhem:
lastDefChange 1364
last_update 1478978681.12828
Helper:
DEF
mapping %ALIAS
Positions:
Waeschetrockner_Status.cmd 2:2
Waeschetrockner_Status.state 2:1
Waschmaschine_Status.cmd 1:2
Waschmaschine_Status.state 1:1
Valueformat:
state.cmd_1 fertig
state.cmd_2 aktiv
state.cmd_3 ausgeschaltet
state.cmd_4 Zeitschaltung
Valueicon:
cmd.0 scene_washing_machine@black
cmd.1 scene_washing_machine@green
cmd.2 scene_washing_machine@red
cmd.3 scene_washing_machine@blue
cmd.4 scene_washing_machine@orange
Values:
formated:
ARRAY(0x39f14a0)
ARRAY(0x33ab520)
orig:
ARRAY(0x355e858)
ARRAY(0x37df190)
prefixsuffix:
ARRAY(0x38cd7f0)
ARRAY(0x3356af0)
Attributes:
alias Waschküche Status
group Übersicht
mapping %ALIAS
notime 1
room Keller
sortby 0001001
valueFormat {'state.cmd_3' => 'ausgeschaltet','state.cmd_1' => 'fertig','state.cmd_2' => 'aktiv', 'state.cmd_4' => 'Zeitschaltung'}
valueIcon {'cmd.0' => 'scene_washing_machine@black', 'cmd.1' => 'scene_washing_machine@green', 'cmd.2' => 'scene_washing_machine@red', 'cmd.3' => 'scene_washing_machine@blue', 'cmd.4' => 'scene_washing_machine@orange'}
mit der Abfrage
{if ($DEVICE =~m"Waschmaschine" && $READING eq "cmd") {'cmd.0' => 'scene_washing_machine@black','cmd.1' => 'scene_washing_machine@green','cmd.2' => 'scene_washing_machine@red', 'cmd.3' => 'scene_washing_machine@blue','cmd.4' => 'scene_washing_machine@orange'} elsif ($DEVICE =~m"Waeschetrockner" && $READING eq "cmd") {'cmd.0' => 'scene_clothes_dryer@black','cmd.1' => 'scene_clothes_dryer@green','cmd.2' => 'scene_clothes_dryer@red','cmd.3' => 'scene_clothes_dryer@blue'}}
kommt leider Fehlermeldung
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.0) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@black) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.1) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@green) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.2) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@red) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.3) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@blue) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.4) in void context at (eval 1188527) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.0) in void context at (eval 1188528) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@black) in void context at (eval 1188528) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.1) in void context at (eval 1188528) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@green) in void context at (eval 1188528) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (cmd.2) in void context at (eval 1188528) line 1.
2016.11.12 20:10:09 1: PERL WARNING: Useless use of a constant (scene_washing_machine@red) in void context at (eval 1188528) line 1.
usw.
kenn bei DOIF nur state cmd_x, also mit Untrerstrich und nicht mit Punkt
Wenn du bei valueIcon und der Abfrage cmd.x in cmd_x änderst.... vielleicht hilf's
Danke für den Tipp, Problem quasi gleich.
Quasi deshalb, weil Waschmaschine unverändert aber Waeschetrockner
nur noch 3 Fehlermeldungen liefert und die fehlende Variante exakt die war, die angezeigt wurde
und das war in dem Fall korrekt.
Es gibt ja beide Readings: cmd und cmd_nr
Grüße
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (cmd_nr.0) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_washing_machine@black) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (cmd_nr.1) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_washing_machine@green) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (cmd_nr.2) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_washing_machine@red) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (cmd_nr.3) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_washing_machine@blue) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (cmd_nr.4) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_clothes_dryer@black) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_clothes_dryer@green) in void context at (eval 1220374) line 1.
2016.11.13 05:33:36 1: PERL WARNING: Useless use of a constant (scene_clothes_dryer@red) in void context at (eval 1220374) line 1.
ich habs bei mir mal nachgestellt und bekomme auch diese FM. In der RG wird bei beiden Einträgen immer das Symbol Waschmaschine angezeigt.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("scene_washing_machine@green") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("cmd.2") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("scene_washing_machine@red") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("cmd.3") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("scene_washing_machine@blue") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("cmd.4") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("scene_clothes_dryer@black") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("scene_clothes_dryer@green") in void context at (eval 145395) line 1.
2016.11.13 17:24:59 1: PERL WARNING: Useless use of a constant ("scene_clothes_dryer@red") in void context at (eval 145395) line 1.
Wo hast Du deine Abfrage eingetragen ?
RG Attribut valueStyle ?
seit ein paar tagen kann man als key auch device.reading.value verwenden. d.h. der umweg über perl code ist nicht mehr nötig.
ansonsten kommt die meldung vermutlich daher das kein return im code ist.
etwas übersichtlicher wäre es in der alten version vermutlich so:{ 'Waschmaschine.cmd' => '{...}', 'Waeschetrockner.cmd' => '{...}' }
gruss
andre
Zitat{ 'Waschmaschine.cmd' => '{...}', 'Waeschetrockner.cmd' => '{...}' }
Danke das war der Tipp.
Dachte eigentlich, dass ich diese Variante schon mal ausprobiert habe aber anscheinend nicht korrekt umgesetzt.
Jetzt passt es jedenfalls.
Danke und Grüße