(gelöst) state on statt dim...

Begonnen von PingPong, 20 Januar 2018, 07:46:06

Vorheriges Thema - Nächstes Thema

PingPong

Hallo zusammen,

bräuchte mal wieder Eure Hilfe.
Habe ein Device, welchen den Status dimxx% ausgibt.
Jetzt würde ich diesen gerne umbiegen auf "on".

Internals:
   CHANGED   
   DEF        0E5C000000261884  IODev=OsramGateway
   ID         0E5C000000261884
   INTERVAL   
   IODev      OsramGateway
   NAME       LIGHTIFY0E5C000000261884
   NR         21
   STATE      dim06%
   TYPE       HUEDevice
   desired    1
   type       Color temperature tight
   uniqueid   0E5C000000261884
   READINGS:
     2018-01-20 07:44:48   bri             5
     2018-01-20 06:39:33   colormode       ct
     2018-01-20 06:39:33   ct              370 (2702K)
     2018-01-20 07:44:48   onoff           1
     2018-01-20 07:44:48   pct             2
     2018-01-20 06:39:33   reachable       1
     2018-01-20 06:39:33   rgb             ffc698
     2018-01-20 07:44:48   state           dim06%
   helper:
     alert     
     bri        5
     colormode  ct
     ct         370
     devtype   
     effect     
     hue        -1
     on         1
     pct        2
     reachable  1
     rgb        ffc698
     sat        -1
     transitiontime 0
     type       2
     update_timeout -1
     xy         
Attributes:
   IODev      OsramGateway
   Kellertreppe Kellertreppe
   alias      FlurUG_Treppe
   color-icons 2
   devStateIcon {(HUEDevice_devStateIcon($name),"toggle")}
   group      Beleuchtung
   icon       light_stairs
   room       09_Flur,91_LightifyDevices
   structure  alleLampen_innen
   webCmd     pct:on:off


Hintergrund ist, dass ich diesen gerne in einer structure nutzen möchte.
Habt Ihr nen Tipp für mich?

VG
Marc

CoolTux

Dafür gibt es das map Attribut
_map pct:^[1-9][0-9]{0,2}:on pct:^0$:off

Schau dir die Commandref zu structure an
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

PingPong

Danke für die schnelle Antwort...
Ja, das hatte ich auch schon gesehen.
Leider scheiter ich echt an der Transferleistung vom "pct" zu "dim" 🤔

CoolTux

Da musst Du nichts tranferieren
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

PingPong

hmmm... ok...
hatte ein Device übersehen... Jetzt bei allen exakt so gesetzt... und es klappt... auch wenn ich es noch nicht verstehe.
Trotzdem erstmal ganz lieben Dank für Deine Hilfe.

binford6000

Zitatund es klappt... auch wenn ich es noch nicht verstehe.
Moin pingpong, ich bin auch gerade an dem Thema und bin auf diesen Thread gestoßen. Mit
onoff:[1]{1}:on onoff:[0]{1}:off
würde es (bei dir) auch funktonieren.

<struct_type>_map mappt ein Reading so, dass es structure als on/off versteht.
Im o.g. Fall also vom Reading "onoff" eine "1" für "on" und eine "0" für "off". Das Gleiche funktioiert wie bei cooltux auch mit dem pct Reading.
Hier wird aus dem Reading pct eine Zahl "1-999" als "on" und eine "0" als "off" an die structure übergeben.
VG Sebastian

choetzu

hmm, ich habe genau die selbe Situation, komme aber irgendwie nicht auf das gewünschte Resultat.....

ich habe 2 HUEDevices und ein Structure.

HUEDevice1
defmod HUEDevice1 HUEDevice 1  IODev=HUEBridge
attr HUEDevice1 userattr HUE HUE_map structexclude
attr HUEDevice1 HUE_map pct:^[1-9][0-9]{0,2}:on pct:^0$:off
attr HUEDevice1 IODev HUEBridge
attr HUEDevice1 alias Office
attr HUEDevice1 color-icons 2
attr HUEDevice1 devStateIcon on:ios_on_fill@blue off:ios_off_fill@gray
attr HUEDevice1 group Dimmer
attr HUEDevice1 icon light-bulb
attr HUEDevice1 model LCT015
attr HUEDevice1 room 03_Licht,HUEDevice
attr HUEDevice1 subType extcolordimmer
attr HUEDevice1 webCmd on:off:pct



Das selbe gilt für HUEDevice2.. Genau identisch.

Structure ist wie folgt:
defmod HUE_Structure structure HUE HUEDevice1 HUEDevice2
attr HUE_Structure clientstate_behavior relative
attr HUE_Structure clientstate_priority An|On|on Aus|Off|off


Irgendetwas übersehe ich... Komm aber nicht drauf...
Raspi3, EnOcean, Zwave, Homematic