FHEM Forum

FHEM => Automatisierung => Thema gestartet von: Pati_Alpha am 28 Dezember 2019, 13:45:11

Titel: [SOLVED] Modul Structure mit wildcards in der clientstate_priority
Beitrag von: Pati_Alpha am 28 Dezember 2019, 13:45:11
Hey,

ich nutze seit kurzem IKEA Tradfri Birnen. Funktioniert so weit auch gut.
Ich habe allerdings einige Structures, welche Lampen zusammenfassen.
Ist nun aber eine Tradfri auf 50% ist ihr Status nicht on oder an, sondern "dim50%".

Ich habe es dann erstmal versucht mit: clientstate_priority on|dim50% off
Das funktioniert auch. Nun ist aber das dumme natürlich: Es gibt auch noch 97 andere dim-Werte (von 1 bis 99).

Versucht habe ich schon: clientstate_priority on|dim.* off
Das hat aber leider nicht funktioniert. :(

Könnt ihr mir hier weiterhelfen?

Viele Grüße
Patrick
Titel: Antw:Modul Structure mit wildcards in der clientstate_priority
Beitrag von: rudolfkoenig am 28 Dezember 2019, 14:10:51
fhem> { "on|dim".join("% off|dim",(1..99))."% off" }
on|dim1% off|dim2% off|dim3% off|dim4% off|dim5% off|dim6% off|dim7% off|dim8% off|dim9% off|dim10% off|dim11% off|dim12% off|dim13% off|dim14% off|dim15% off|dim16% off|dim17% off|dim18% off|dim19% off|dim20% off|dim21% off|dim22% off|dim23% off|dim24% off|dim25% off|dim26% off|dim27% off|dim28% off|dim29% off|dim30% off|dim31% off|dim32% off|dim33% off|dim34% off|dim35% off|dim36% off|dim37% off|dim38% off|dim39% off|dim40% off|dim41% off|dim42% off|dim43% off|dim44% off|dim45% off|dim46% off|dim47% off|dim48% off|dim49% off|dim50% off|dim51% off|dim52% off|dim53% off|dim54% off|dim55% off|dim56% off|dim57% off|dim58% off|dim59% off|dim60% off|dim61% off|dim62% off|dim63% off|dim64% off|dim65% off|dim66% off|dim67% off|dim68% off|dim69% off|dim70% off|dim71% off|dim72% off|dim73% off|dim74% off|dim75% off|dim76% off|dim77% off|dim78% off|dim79% off|dim80% off|dim81% off|dim82% off|dim83% off|dim84% off|dim85% off|dim86% off|dim87% off|dim88% off|dim89% off|dim90% off|dim91% off|dim92% off|dim93% off|dim94% off|dim95% off|dim96% off|dim97% off|dim98% off|dim99% off
:)
Titel: Antw:Modul Structure mit wildcards in der clientstate_priority
Beitrag von: Pati_Alpha am 28 Dezember 2019, 14:16:29
:D Ja, über den Holzhammer hab ich auch schon nachgedacht...
Anders geht es nicht, oder? :/
Titel: Antw:Modul Structure mit wildcards in der clientstate_priority
Beitrag von: sinus61 am 28 Dezember 2019, 17:51:53
Bei einem HUEDevice gibt es ja das Reading onoff, was entweder 0 oder 1 ist. Und dann halt <struct_type>_map onoff bei den Membern der structure setzen.
Titel: Antw:Modul Structure mit wildcards in der clientstate_priority
Beitrag von: Pati_Alpha am 29 Dezember 2019, 16:33:56
Das klingt gut.
Vielleicht behebt das auch mein 2. Problem mit dem struct, was ich erst seit jetzt habe:
In FHEM wird es zwar als "on" gemeldet, aber seit ich den Status auf "dim" erweitert habe, wird es nicht mehr als "on" in HomeKit angezeigt.
Aber ich probiere erstmal deine Lösung. :) Danke!

EDIT: Das Problem mit HomeKit war zu lösen per "homebridgeMapping: On=state,valueOn=on,valueOff=off,cmdOn=on,cmdOff=off"

EDIT 2: Mein generelles Problem wurde jetzt gelöst per:
<struct_type>_map: onoff:1:on onoff:0:off
bzw. im Klartext:
room_map: onoff:1:on onoff:0:off

Danke nochmal! :)