HUE Farbtemperatur automatisch dem Tag anpassen

Begonnen von Loredo, 16 April 2014, 20:24:28

Vorheriges Thema - Nächstes Thema

Loredo


Ich habe 2 kleine Notifies, die dafür sorgen, dass die Farbtemperatur meiner Hue Bulbs immer entsprechend des Tagesverlaufs angepasst werden.
Vielleicht findet es ja noch jemand nützlich.



# correct HUE color temperature according to twilight in case I change to colormode "ct"
#
define n_HUE_ct.cm notify HUE_HUEDevice.*:colormode:.*ct {
  my $light=ReadingsVal("Twilight","light",0);
  if ($light == 6 ) {fhem "set $NAME:FILTER=pct!=0 color 6500"}
  elsif ($light < 6 && $light > 0 ) {fhem "set $NAME:FILTER=pct!=0 color 3400"}
  elsif ($light == 0 ) {fhem "set $NAME:FILTER=pct!=0 color 2300"}
}
attr n_HUE_ct.cm room System

# correct HUE color temperature according to twilight in case Twilight light value changes
#
define n_HUE_ct notify Twilight:light.*(0|1|5|6) {
   my $color;
   if ($EVTPART1 == 6){$color = 6500}
   elsif ($EVTPART1 < 6 && $EVTPART1 > 0){$color = 3400}
   else {$color = 2300}

   my @devices=devspec2array("TYPE=HUEDevice");

   foreach(@devices) {
      if ( ReadingsVal($_,"pct",0) > 0 ) {
         fhem "set $_:FILTER=colormode=ct ct $color : transitiontime 3000";
      }
   }
}
attr n_HUE_ct room System
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

Loredo

Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

m.zielinski

Ich nutze schon eine weile deine notifys. Mir fehlt da noch, dass beim einschalten einer
Lampe die colortemp pasend zur Uhrzeit eingestellt wird und nicht auf den wert des letzten Abend...