Hallo zusammen,
nach meinem Umstieg von HUE-Bridge auf Z2M (was eine der besten Entscheidungen war) fehlten mir nur die Lichtszenen (Sonnenuntergang, Tropendämmerung, Nordlichter usw.).
Hatte mir dann angeschaut auf welche Werte die Hue die Lampen stellt und diese dann in ein kleines Script übertragen. Ob das immer noch passt kann ich nicht sagen (keine Bridge mehr und nutze die Szenen auch schon eine Weile nicht mehr), aber wollte euch das Skript nicht vorenthalten.
Wie gesagt - kein Anspruch auf 1:1 usw. … mehr ein Denkanstoß für eigene Experimente!!
<?php
declare(strict_types=1);
################################################################################
# Script: System.ZigbeeScene.ips.php
# Version: 3.0.20231220
# Author: Heiko Wilknitz (@Pitti)
# Danke an @Stefan71 für die Scenen
#
# Simulation der Philips HUE Szenen
#
# ------------------------------- Installation ---------------------------------
#
# Entsprechend der verwendeten Leuchtmittel die Konfiguration anpassen.
#
#
# ------------------------------ Changelog -------------------------------------
#
# 02.10.2023 - Initalversion (v1.0)
# 01.12.2023 - Umbau auf Script-Bibliothek (v2.0)
# 20.12.2023 - Erweiterung um viel mehr Scenen und Aufruf via RunScript (v3.0)
#
# ----------------------------- Konfigruration ---------------------------------
#
# Global Debug Output Flag
$DEBUG = false;
#
# Scene Profil
$SCENES = [
[0, 'Konzentrieren', '', 0xFFD4B2], //Standard Szene
[1, 'Entspannen', '', 0xFF942B], //Standard Szene
[2, 'Kühl Hell', '', 0xFFCDA6], //Standard Szene
[3, 'Gedimmt', '', 0xFFA657], //Standard Szene
[4, 'Ruhephase', '', 0xFEA025], //Standard Szene
[5, 'Lesen', '', 0xFFAD66], //Standard Szene
[6, 'Energie Tanken', '', 0xFFFCF7], //Standard Szene
[7, 'Hell', '', 0xFFA657], //Standard Szene
[8, 'Nachtlicht', '', 0xFEA025], //Standard Szene
[9, 'Glitzerschnee', '', 0x2DFEDA], //Winterferien
[10, 'Nussknacker', '', 0xFEAF2A], //Winterferien
[11, 'Goldener Stern', '', 0xFE9321], //Winterferien
[12, 'Color Burst', '', 0xFE765D], //Winterferien
[13, 'Rosiger Schimmer', '', 0xFE8D91], //Winterferien
[14, 'Unter Dem Baum', '', 0xFEC05B], //Winterferien
[15, 'Lustiger', '', 0xFE2700], //Winterferien
[16, 'Stille Nacht', '', 0xFEA66E], //Winterferien
[17, 'Crystalline', '', 0x68A3FE], //Winterferien
[18, 'Festliche Stimmung', '', 0xFE5B43], //Winterferien
[19, 'Blüte', '', 0xFED97E], //Erfrischend
[20, 'Krokus', '', 0xCBBDFE], //Erfrischend
[21, 'Wertvoll', '', 0xFEFE9A], //Erfrischend
[22, 'Narzisse', '', 0xFEA927], //Erfrischend
[23, 'Sanfte Hügel', '', 0xFE9E3B], //Gemütlich
[24, 'Verträumter Sonnenuntergang', '', 0xFE92B8], //Gemütlich
[25, 'Sonnenuntergang Savanne', '', 0xFE5B20], //Gemütlich
[26, 'Rubinrotes Leuchten', '', 0xFE94AB], //Gemütlich
[27, 'Herzliche Umarmung', '', 0xFE794E], //Gemütlich
[28, 'Honolulu', '', 0xFE9934], //Gemütlich
[29, 'Goldener Teich', '', 0xFE9B20], //Gemütlich
[30, 'Tropendämmerung', '', 0x944BFE], //Gemütlich
[31, 'Miami', '', 0xFE7769], //Partystimmung
[32, 'Rio', '', 0xFE4E83], //Partystimmung
[33, 'Ibiza', '', 0xFE9138], //Partystimmung
[34, 'Tokio', '', 0x388EFE], //Partystimmung
[35, 'Fairfax', '', 0xFE584E], //Partystimmung
[36, 'Cancun', '', 0xFE4707], //Partystimmung
[37, 'Chinatown', '', 0xFE2729], //Partystimmung
[38, 'Osaka', '', 0xFEBB43], //Partystimmung
[39, 'Motown', '', 0x3800FE], //Partystimmung
[40, 'Galaxie', '', 0xEF7AFE], //Friedlich
[41, 'Blutmond', '', 0xFEB8D2], //Friedlich
[42, 'Mondlicht', '', 0xFEE7DF], //Friedlich
[43, 'Sternenlicht', '', 0x8668FE], //Friedlich
[44, 'Nordlichter', '', 0x00C6C6], //Friedlich
[45, 'Sternennebel', '', 0x680FFE], //Friedlich
[46, 'Bergbrise', '', 0xFEDD8D], //Ruhig
[47, 'Morgendämmerung am Meer', '', 0xC7B8FE], //Ruhig
[48, 'Sonntagmorgen', '', 0xFEE67B], //Ruhig
[49, 'Frühlingsblüten', '', 0xFF907B], //Ruhig
[50, 'Nebel über dem See', '', 0xFEC1AB], //Ruhig
[51, 'Frostige Morgendämmerung', '', 0xFED69B], //Ruhig
[52, 'Smaragd Insel', '', 0xCAF6FE], //Ruhig
[53, 'Anfänge', '', 0x6A81FE], //Sonnenaufgang
[54, 'Horizont', '', 0xBDA3FE], //Sonnenaufgang
[55, 'Sunflare', '', 0xFECA8C], //Sonnenaufgang
[56, 'Erstes Licht', '', 0xDEB1FE], //Sonnenaufgang
[57, 'Morgendämmerung im Tal', '', 0xFEC7C8], //Sonnenaufgang
[58, 'Smaragdähnliches Flackern', '', 0x4EECFE], //Luxuriös
[59, 'Memento', '', 0xFECE31], //Luxuriös
[60, 'Strahlend', '', 0x9356FE], //Luxuriös
[61, 'Scharlachroter Traum', '', 0xFE6294], //Luxuriös
[62, 'Amethyst Valley', '', 0x8C6DFE], //Pur
[63, 'Trübe Tage', '', 0xFED97A], //Pur
[64, 'Herbstgold', '', 0xFEDD77], //Pur
[65, 'Winterlicher Berg', '', 0xB6ECFE], //Pur
[66, 'Mystische Berge', '', 0xFECFD2], //Pur
[67, 'Mittsommersonne', '', 0xFEB43D], //Pur
[68, 'Frühlingssee', '', 0xE7FEBE], //Pur
[69, 'Wintersommerwende', '', 0xB6BEFE], //Pur
[70, 'Bernsteinblüte', '', 0xFEA749], //Üppig
[71, 'Gemalter Himmel', '', 0xFEAC8C], //Üppig
[72, 'Orangenfelder', '', 0xC1FE40], //Üppig
[73, 'Blue Planet', '', 0x2CFED8], //Üppig
[74, 'HUE Lily', '', 0xFE4879], //Üppig
[75, 'Winterschönheit', '', 0x5DEAFE], //Üppig
[76, 'Waldabenteuer', '', 0xF2FE3F], //Üppig
[77, 'Meriete', '', 0xC481FE], //Üppig
[78, 'Soho', '', 0x66FEDB], //Futuristisch
[79, 'Magneto', '', 0xFEC02C], //Futuristisch
[80, 'Disturbia', '', 0xFE273E], //Futuristisch
[81, 'Vapor Wave', '', 0xFED258], //Futuristisch
[82, 'Tyrell', '', 0xFE4EEF], //Futuristisch
[83, 'Hal', '', 0x87C2FE], //Futuristisch
[84, 'Stille Wasser', '', 0x9E78FE], //Verträumt
[85, 'Besinnlich', '', 0xFEAD4B], //Verträumt
[86, 'Sonnenuntergang', '', 0x6B8BFE], //Verträumt
[87, 'Palm Beach', '', 0xFEBCD3], //Verträumt
[88, 'Farbe des Horizonts', '', 0xFE9297], //Verträumt
[89, 'Majestätischer Morgen', '', 0xFECF5E], //Verträumt
[90, 'Blaue Lagune', '', 0xAAFEF5], //Verträumt
[91, 'Lake Placid', '', 0xFEAD91], //Verträumt
];
#
#
# Szenen-Aktionen 1:1 zum Profil [ProfilID => Farbe/Helligkeit (Z2m_Color/Z2M_Brightness)]
$ACTIONS = [
0 => [[0xFFD4B2,254]], //Konzentrieren
1 => [[0xFF942B,142]], //Entspannen
2 => [[0xFFCDA6,254]], //Kühl Hell
3 => [[0xFFA657,78]], //Gedimmt
4 => [[0xFEA025,92]], //Ruhephase
5 => [[0xFFAD66,254]], //Lesen
6 => [[0xFFFCF7,254]], //Energie Tanken
7 => [[0xFFA657,254]], //Hell
8 => [[0xFEA025,28]], //Nachtlicht
9 => [[0x3800FE,102],[0xFE9C47,102],[0xFE651A,102],[0x2DFEDA,102],[0xFE9C47,102],[0x6166FE,102],[0xFE651A,102],[0x3800FE,102],[0xFE9C47,102],[0x2DFEDA,102],[0x6166FE,102],[0x3800FE,102]], //Glitzerschnee
10 => [[0x3A53FE,102],[0xFEAF2A,102],[0x3ABBFE,102],[0x3A53FE,102],[0x3ABBFE,102],[0xFEE468,102],[0xFEAF2A,102],[0x63FEB6,102],[0xFEE468,102],[0xFEAF2A,102],[0x63FEB6,102],[0x3ABBFE,102]], //Nussknacker
11 => [[0xFE5A41,117],[0xFED24C,117],[0xFE9321,213],[0xFE271E,117],[0xFE9921,117],[0xFE9921,117],[0xFE5A41,117],[0xFE271E,117],[0xFEC23F,117],[0xFE9321,213],[0xFEC23F,117],[0xFED24C,117]], //Goldener Stern
12 => [[0x5E57FE,79],[0xFE765D,79],[0xCC1AFE,79],[0x5E57FE,79],[0xCC1AFE,79],[0xFE2747,79],[0xCC1AFE,79],[0xFEEB4C,79],[0xFE2747,79],[0xFE765D,79],[0xFEEB4C,79],[0xFE765D,79]], //Color Burst
13 => [[0xFE80BE,97],[0xFEA47C,97],[0xFEA47C,97],[0xFE80BE,97],[0xFEA47C,97],[0xFEB7A6,97],[0xFE8D91,97],[0xF97EFE,97],[0xFEB7A6,97],[0xFE8D91,97],[0xF97EFE,97],[0xFE8D91,97]], //Rosiger Schimmer
14 => [[0x0EFE51,102],[0x4FFEA2,102],[0xFEC05B,66],[0xFE311B,102],[0x0EFE51,102],[0xFE996A,102],[0xFEC437,102],[0xFE311B,102],[0xFEC437,102],[0xFEC05B,66],[0xFE996A,102],[0x4FFEA2,102]], //Unter Dem Baum
15 => [[0x4FFEA3,102],[0xFE6A54,102],[0x3800FE,254],[0xFEC651,102],[0x4FFEA3,102],[0x3887FE,102],[0xFE62B7,102],[0xFEC651,102],[0x3887FE,102],[0xFE2700,254],[0xFE62B7,102],[0xFE6A54,102]], //Lustiger
16 => [[0xFE9362,97],[0xFEBA77,97],[0xFEBA77,97],[0xFE9862,97],[0xFEBA77,97],[0xFEBA9E,97],[0xFEA66E,97],[0xFEB788,97],[0xFEBA9E,97],[0xFEA66E,97],[0xFEB788,97],[0xFE466E,97]], //Stille Nacht
17 => [[0x4992FE,84],[0xFEC0CB,84],[0xFEC0CB,84],[0x4992FE,84],[0xFEC0CB,84],[0xFEBFA3,84],[0x68A3FE,84],[0xF5BCFE,84],[0xFEBFA3,84],[0x68A3FE,84],[0xF5BCFE,84],[0x68A3FE,84]], //Crystalline
18 => [[0xFE7345,92],[0x3849FF,92],[0x3849FE,92],[0x6B03FE,92],[0x3849FE,92],[0x5907FE,92],[0xFE5B43,92],[0xFE7345,92],[0x5907FE,92],[0xFE5B43,92],[0xFE7345,92],[0xFE5B43,92]], //Festliche Stimmung
19 => [[0xFEECA4,203],[0xFEECA4,203],[0xA4D2FE,203],[0xFED97E,203],[0xC3E5FE,203],[0xFEBC43,203],[0xA4D2FE,203],[0xFEECA4,203],[0xC3E5FE,203],[0xFED97E,203],[0xFEBC43,203],[0xA4D2FE,203]], //Blüte
20 => [[0xE6FE74,203],[0xE6FE74,203],[0xFED49E,203],[0xCBBDFE,203],[0x8467FE,203],[0xFEE78B,203],[0xFED49E,203],[0xE6FE74,203],[0x8467FE,203],[0xCBBDFE,203],[0xFEE78B,203],[0xFED49E,203]], //Krokus
21 => [[0xF28BFE,203],[0xF28BFE,203],[0xFED38B,203],[0xFEFE9A,203],[0xF5AEFE,203],[0xFEDAB8,203],[0xFED38B,203],[0xF28BFE,203],[0xF5AEFE,203],[0xFEFE9A,203],[0xFEDAB8,203],[0xFED38B,203]], //Wertvoll
22 => [[0xFED33F,229],[0xFED33F,229],[0xFEA927,229],[0xFEE762,229],[0xFEE762,229],[0xFE8B1B,229],[0xFED54E,229],[0xFED33F,229],[0xFEE762,229],[0xFEA927,229],[0xFE8B1B,229],[0xFED54E,229]], //Narzisse
23 => [[0xFEAD4C,114],[0xFEAD4C,114],[0xFEB65F,114],[0xFE9E3B,114],[0xFEBE70,114],[0xFE8D33,114],[0xFEB65F,114],[0xFEAD4C,114],[0xFEBE70,114],[0xFE9E3B,114],[0xFE8D33,114],[0xFEB65F,114]], //Sanfte Hügel
24 => [[0xFE9452,129],[0xFE9452,129],[0xFE7C64,129],[0xFE92B8,129],[0xFE7D94,129],[0xFEAB58,129],[0xFE7C64,129],[0xFE9452,129],[0xFE7D94,129],[0xFE92B8,129],[0xFEAB58,129],[0xFE7C64,129]], //Verträumter Sonnenuntergang
25 => [[0xFE8041,147],[0xFE8041,147],[0xFECC59,147],[0xFE5B20,147],[0xFEA658,147],[0xFEEF87,147],[0xFECC59,147],[0xFE9452,147],[0xFE8041,147],[0xFEA658,147],[0xFE5B20,147],[0xFEEF87,147]], //Sonnenuntergang Savanne
26 => [[0xFE608A,102],[0xFE608A,102],[0xFE7C9C,102],[0xFE94AB,102],[0xFEADBE,102],[0xFEC7D3,102],[0xFE7C9C,102],[0xFE608A,102],[0xFEADBE,102],[0xFE94AB,102],[0xFEC7D3,102],[0xFE7C9C,102]], //Rubinrotes Leuchten
27 => [[0xFE994A,102],[0xFE994A,102],[0xFEAA4F,102],[0xFE794E,102],[0xFE8B47,102],[0xFE735E,102],[0xFEAA4F,102],[0xFE994A,102],[0xFE8B47,102],[0xFE794E,102],[0xFE735E,102],[0xFEAA4F,102]], //Herzliche Umarmung
28 => [[0xFE725C,102],[0xFE725C,102],[0xFE854A,102],[0xFE9934,102],[0xFECD5E,102],[0xFE3C4A,102],[0xFE854A,102],[0xFE725C,102],[0xFECD5E,102],[0xFE9934,102],[0xFE3C4A,102],[0xFE854A,102]], //Honolulu
29 => [[0xFEA223,165],[0xFEA223,165],[0xFECA41,165],[0xFE9B20,165],[0xFED248,165],[0xFEC72E,165],[0xFECA41,165],[0xFEA223,165],[0xFED248,165],[0xFE9B20,165],[0xFEC72E,165],[0xFECA41,165]], //Goldener Teich
30 => [[0xFE8519,125],[0xFE8519,125],[0xFEBAED,254],[0xFEB681,112],[0xFEBAED,254],[0xFEBAED,254],[0xFE8519,125],[0xFEB681,112],[0x944BFE,112],[0x944BFE,112],[0x944BFE,112],[0xFEB681,112]], //Tropendämmerung
31 => [[0x3848FE,203],[0x3848FE,203],[0xFE6EBC,203],[0xFE7769,203],[0x388CFE,203],[0xF967FE,203],[0xFE6EBC,203],[0x3848FE,203],[0x388CFE,203],[0xFE7769,203],[0xF967FE,203],[0xFE6EBC,203]], //Miami
32 => [[0xFE6B83,203],[0xFE6B83,203],[0xFE9751,203],[0xFE4E83,203],[0xA24EFE,203],[0xFEDA4F,203],[0xFE9751,203],[0xFE6B83,203],[0xA24EFE,203],[0xFE4E83,203],[0xFEDA4F,203],[0xFE9751,203]], //Rio
33 => [[0xFEAD45,125],[0xFEAD45,125],[0xFED44A,125],[0xFE9138,125],[0xFEEC67,125],[0xFE7D34,125],[0xFED44A,125],[0xFEAD45,125],[0xFEEC67,125],[0xFE9138,125],[0xFE7D34,125],[0xFED44A,125]], //Ibiza
34 => [[0x5600FE,120],[0x5600FE,120],[0xA612FE,120],[0x388EFE,120],[0xFE2775,120],[0xFEA022,120],[0xA612FE,120],[0x5600FE,120],[0xFE2775,120],[0x388EFE,120],[0xFEA022,120],[0xA612FE,120]], //Tokio
35 => [[0x70B9FE,158],[0x70B9FE,158],[0xFE9793,158],[0xFE584E,158],[0x38C3FE,158],[0xFE2726,158],[0xFE9793,158],[0x70B9FE,158],[0x38C3FE,158],[0xFE584E,158],[0xFE2726,158],[0xFE9793,158]], //Fairfax
36 => [[0xFE365F,203],[0xFE365F,203],[0xFE7915,203],[0xFE4707,203],[0xFE6287,203],[0xFEC135,203],[0xFE7915,203],[0xFE365F,203],[0xFE6287,203],[0xFE4707,203],[0xFEC135,203],[0xFE7915,203]], //Cancun
37 => [[0xFE7662,152],[0xFE4048,152],[0xFE4048,152],[0xFE4048,152],[0xFE4048,152],[0xFE9B20,152],[0xFE2729,152],[0xFE2E3F,152],[0xFE9B20,152],[0xFE2729,152],[0xFE2E3F,152],[0xFE2729,152]], //Chinatown
38 => [[0xFE3E88,254],[0xFE3E88,254],[0xFE83B6,254],[0xFEBB43,254],[0xFE5D5D,91],[0xFE7413,91],[0xFE83B6,254],[0xFE3E88,91],[0xFE5D5D,254],[0xFEBB43,91],[0xFE7413,254],[0xFE83B6,91]], //Osaka
39 => [[0x3A3DFE,254],[0x3A3DFE,254],[0x388BFE,135],[0x3800FE,135],[0x37E6FE,135],[0x38A7FE,135],[0x388BFE,254],[0x3A3DFE,135],[0x37E6FE,135],[0x3800FE,135],[0x38A7FE,135],[0x388BFE,135]], //Motown
40 => [[0xFE7BA1,64],[0xFE7BA1,64],[0xFE8472,64],[0xEF7AFE,64],[0xFE6CA7,64],[0xFE91B9,64],[0xFE8472,64],[0xFE7BA1,64],[0xFE6CA7,64],[0xEF7AFE,64],[0xFE91B9,254],[0xFE8472,64]], //Galaxie
41 => [[0x4235FE,53],[0x4235FE,53],[0xFEAD92,53],[0xFEB8D2,53],[0x5D70FE,254],[0xD6AFFE,254],[0xFEAD92,53],[0x4235FE,254],[0x5D70FE,53],[0xFEB8D2,53],[0xD6AFFE,53],[0xFEAD92,53]], //Blutmond
42 => [[0x3800FE,254],[0x3800FE,53],[0x3864FE,254],[0xFEE7DF,53],[0x5384FE,53],[0x81A2FE,53],[0x3864FE,53],[0x3800FE,254],[0x5384FE,53],[0xFEE7DF,53],[0x81A2FE,53],[0x3864FE,53]], //Mondlicht
43 => [[0xD691FE,63],[0xDE91FE,63],[0xFEBDB0,63],[0x8668FE,63],[0xFEB6E0,63],[0xFEC796,63],[0xFEBDB0,63],[0xD691FE,63],[0xFEB6E0,63],[0x8668FE,63],[0xFEC796,63],[0xFEBDB0,63]], //Sternenlicht
44 => [[0x384BFE,254],[0x4EFEF7,137],[0x52AEFE,137],[0x6EFEB9,69],[0x38B1FE,137],[0x52AEFE,137],[0x6EFEB9,69],[0x6EFEB9,69],[0x384BFE,254],[0x52AEFE,137],[0x6EFEB9,69],[0x52AEFE,137]], //Nordlichter
45 => [[0xB17CFE,254],[0xB17CFE,63],[0xFEB4E6,63],[0x680FFE,254],[0x95A0FE,63],[0xDEA8FE,254],[0xFEB4E6,63],[0xB17CFE,63],[0x95A0FE,254],[0x680FFE,63],[0xDEA8FE,63],[0xFEB4E6,254]], //Sternennebel
46 => [[0xADB1FE,152],[0xADB1FE,152],[0xFED7C8,152],[0xFEDD8D,152],[0x8D9FFE,152],[0x99A6FE,152],[0xFED7C8,152],[0xADB1FE,152],[0x8D9FFE,152],[0xFEDD8D,152],[0x99A6FE,152],[0xFED7C8,152]], //Bergbrise
47 => [[0xFED0DD,213],[0xFED0DD,254],[0xFEC694,213],[0xC7B8FE,254],[0xFED692,213],[0xFECBAD,213],[0xFEC694,213],[0xFED0DD,213],[0xFED692,254],[0xC7B8FE,254],[0xFECBAD,213],[0xFEC694,254]], //Morgendämmerung am Meer
48 => [[0xFEDF8D,173],[0xFEDF8D,173],[0xFEDFAA,173],[0xFEE67B,254],[0xE7FE94,173],[0xFEE6C6,173],[0xFEDFAA,254],[0xFEDF8D,173],[0xE7FE94,254],[0xFEE67B,173],[0xFEE6C6,173],[0xFEDFAA,254]], //Sonntagmorgen
49 => [[0xFE7BBF,152],[0xFEB1E6,254],[0xFE679A,213],[0xFE679A,213],[0xFEB1E6,254],[0xFE907B,152],[0xFE7DBF,152],[0xFE679A,213],[0xFEB1E6,254],[0xFE907B,152],[0xFE907B,152],[0xFEB1E6,254]], //Frühlingsblüten
50 => [[0xFECFCD,165],[0xFECFCD,254],[0x90A4FE,165],[0xFEC1AB,165],[0xFED5AD,165],[0xA9C4FE,165],[0x90A4FE,165],[0xFECFCD,165],[0xFED5AD,165],[0xFEC1AB,165],[0xA9C4FE,254],[0x90A4FE,165]], //Nebel über dem See
51 => [[0xFEC993,203],[0xFEC993,203],[0xFEF09A,203],[0xFED69B,203],[0xFDFE9C,203],[0xFEBA82,203],[0xFEF09A,203],[0xFEC993,203],[0xFDFE9C,203],[0xFED69B,203],[0xFEBA82,203],[0xFEF09A,203]], //Frostige Morgendämmerung
52 => [[0xFEF4A3,190],[0xFEF4A3,190],[0xD1FEBD,190],[0xCAF6FE,190],[0xA2FEC5,190],[0xFED169,190],[0xD1FEBD,190],[0xFEF4A3,190],[0xA2FEC5,190],[0xCAF6FE,190],[0xFED169,190],[0xD1FEBD,190]], //Smaragd Insel
53 => [[0xFEB5FB,51],[0xFEB5FB,51],[0xB798FE,51],[0x6A81FE,254],[0x4980FE,254],[0x3F7BFE,51],[0xB798FE,51],[0xFEB5FB,51],[0x4980FE,254],[0x6A81FE,254],[0x3F7BFE,254],[0xB798FE,51]], //Anfänge
54 => [[0xFEB448,129],[0xFEB448,129],[0xFEA757,129],[0xBDA3FE,129],[0x5FA2FE,129],[0x55A3FE,129],[0xFEA757,129],[0xFEB448,129],[0x5FA2FE,129],[0xBDA3FE,129],[0x55A3FE,129],[0xFEA757,129]], //Horizont
55 => [[0xFEC565,203],[0xFEC565,203],[0xFEBE59,203],[0xFECA8C,203],[0xB0C1FE,203],[0x7AB7FE,203],[0xFEBE59,203],[0xFEC565,203],[0xB0C1FE,203],[0xFECA8C,203],[0x7AB7FE,203],[0xFEBE59,203]], //Sunflare
56 => [[0xFEA744,79],[0xFEA744,254],[0xFEABC4,79],[0xDEB1FE,79],[0x8293FE,79],[0x4897FE,254],[0xFEABC4,79],[0xFEA744,79],[0x8293FE,79],[0xDEB1FE,79],[0x4897FE,79],[0xFEABC4,254]], //Erstes Licht
57 => [[0xFEBF5B,178],[0xFEBF5B,178],[0xFEB85F,178],[0xFEC7C8,254],[0x8AAAFE,178],[0x66ADFE,178],[0xFEB85F,178],[0xFEBF5B,178],[0x8AAAFE,178],[0xFEC7C8,178],[0x66ADFE,178],[0xFEB85F,178]], //Morgendämmerung im Tal
58 => [[0xDAFEC6,102],[0x389FFE,102],[0x389FFE,102],[0xDAFEC6,102],[0x389FFE,102],[0x8AFEFA,102],[0x4EECFE,102],[0x3AC5FE,102],[0x8AFEFA,102],[0x4EECF5,102],[0x3AC5FE,102],[0x4EECFE,102]], //Smaragdähnliches Flackern
59 => [[0x547EFE,102],[0x547EFE,102],[0x4C48FE,102],[0xFECE31,102],[0x5F39FE,102],[0x3A5CFE,102],[0x4C48FE,102],[0x547EFE,102],[0x5F39FE,102],[0xFECE31,102],[0x3A5CFE,102],[0x4C48FE,102]], //Memento
60 => [[0xFE9F6F,79],[0xFE9F6F,79],[0xDA81FE,79],[0x9356FE,79],[0xFE8DA6,79],[0xFE73DD,79],[0xDA81FE,79],[0xFE9F6F,79],[0xFE8DA6,79],[0x9356FE,79],[0xFE73DD,79],[0xDA81FE,79]], //Strahlend
61 => [[0xFE646F,79],[0xFE646F,79],[0xFE7DB4,79],[0xFE6294,254],[0xFE7354,79],[0xFE95D5,79],[0xFE7DB4,79],[0xFE646F,79],[0xFE7354,79],[0xFE6294,79],[0xFE95D5,79],[0xFE7DB4,79]], //Scharlachroter Traum
62 => [[0xA187FE,239],[0xA187FE,239],[0xC6A5FE,239],[0x8C6DFE,239],[0xB998FE,239],[0xD2B6FE,239],[0xC6A5FE,239],[0xA187FE,239],[0xB998FE,239],[0x8C6DFE,239],[0xD2B6FE,239],[0xC6A5FE,239]], //Amethyst Valley
63 => [[0xFEC85B,254],[0xFEC85B,221],[0xFED16C,254],[0xFED97A,221],[0xFEC24F,254],[0xFEE18E,221],[0xFED16C,221],[0xFEC85B,221],[0xFEC24F,221],[0xFED97A,221],[0xFEE18E,221],[0xFED16C,254]], //Trübe Tage
64 => [[0xFECA75,203],[0xFECA75,203],[0xFED286,203],[0xFEDD77,254],[0xFEC276,203],[0xFEDB64,203],[0xFED286,203],[0xFECA75,203],[0xFEC276,203],[0xFEDD77,203],[0xFEDB64,203],[0xFED286,203]], //Herbstgold
65 => [[0xB2EBFE,254],[0xB2EBFE,254],[0xA6E7FE,223],[0xB6ECFE,254],[0xCBF2FE,223],[0xE0F8FE,223],[0xA6E7FE,254],[0xB2EBFE,203],[0xCBF2FE,254],[0xB6ECFE,203],[0xE0F8FE,254],[0xA6E7FE,223]], //Winterlicher Berg
66 => [[0xFEC1B7,203],[0xFEC1B7,254],[0xFEC8C4,203],[0xFECFD2,203],[0xFED8DD,203],[0xFEE3F0,203],[0xFEC8C4,203],[0xFEC1B7,254],[0xFED8DD,203],[0xFECFD2,203],[0xFEE3F0,203],[0xFEC8C4,254]], //Mystische Berge
67 => [[0xFEE577,254],[0xFEE577,254],[0xFECB52,254],[0xFEB43D,254],[0xFEDB6A,254],[0xFEF188,254],[0xFECB52,251],[0xFEE577,254],[0xFEDB6A,251],[0xFEB43D,254],[0xFEF188,254],[0xFECB52,254]], //Mittsommersonne
68 => [[0xDCFEB0,254],[0xDCFEB0,241],[0xF0FECB,241],[0xE7FEBE,254],[0xEBFED2,254],[0xF8FEE1,241],[0xF0FECB,241],[0xDCFEB0,241],[0xEBFED2,241],[0xE7FEBE,241],[0xF8FEE1,254],[0xF0FECB,241]], //Frühlingssee
69 => [[0x8DABFE,226],[0x8DABFE,226],[0x7E98FE,254],[0xB6BEFE,226],[0xA0C3FE,226],[0xBAD1FE,226],[0xFE98FE,226],[0x8DACFE,254],[0xA0C3FE,226],[0xB6BEFE,226],[0xBAD1FE,226],[0x7E98FE,226]], //Wintersommerwende
70 => [[0xFE9920,203],[0xFE9920,203],[0xFE891A,203],[0xFEA749,203],[0xFE6A34,203],[0xFEAA77,203],[0xFE891A,203],[0xFE9920,203],[0xFE6A34,203],[0xFEA749,203],[0xFEAA77,203],[0xFE891A,203]], //Bernsteinblüte
71 => [[0x8559FE,203],[0x8559FE,203],[0xD07DFE,203],[0xFEAC8C,203],[0xFE7513,203],[0xFE9AE1,203],[0xD07DFE,203],[0x855AFE,254],[0xFE7513,203],[0xFEAC8C,203],[0xFE9AE1,203],[0xD07DFE,203]], //Gemalter Himmel
72 => [[0xFE9A20,203],[0xFE9A20,203],[0xFECB2F,203],[0xC1FE40,203],[0xFE8458,203],[0xFEE036,203],[0xFECB2F,203],[0xFE9A20,203],[0xFE8458,203],[0xC1FE40,203],[0xFEE036,203],[0xFECB2F,203]], //Orangenfeld
73 => [[0x6DFEEE,140],[0x6DFEEE,254],[0xB9FE63,140],[0x2CFED8,254],[0x3899FE,140],[0x12FE7D,140],[0xB9FE63,140],[0x6DFEEE,140],[0x3899FE,140],[0x2CFED8,140],[0x12FE7D,140],[0xB9FE63,140]], //Blue Planet
74 => [[0xFE778F,254],[0xFE778F,203],[0xFEA640,203],[0xFE4879,254],[0xFEAC8D,254],[0xFE931F,203],[0xFEA640,203],[0xFE788F,203],[0xFEAC8D,254],[0xFE4879,203],[0xFE931F,203],[0xFEA640,203]], //HUE Lily
75 => [[0xC3FE85,254],[0xC3FE85,203],[0xFEAB3F,203],[0x5DEAFE,203],[0x6DFEA4,203],[0xFEEF7D,203],[0xFEAB3F,203],[0xC3FE85,254],[0x6DFEA4,203],[0x5DEAFE,203],[0xFEEF7D,203],[0xFEAB3F,203]], //Winterschönheit
76 => [[0x3AB0FE,203],[0x3AB0FE,203],[0xA2FE44,203],[0xF2FE3F,203],[0x4FFE6E,254],[0x386AFE,254],[0xA2FE44,203],[0x3AB0FE,203],[0x4FFE6E,203],[0xF2FE3F,254],[0x386AFE,203],[0xA2FE44,203]], //Waldabenteuer
77 => [[0x4E00FE,203],[0x4E00FE,203],[0x7A53FE,254],[0xC481FE,203],[0x3864FE,254],[0xFECD71,254],[0x7A53FE,254],[0x4E00FE,203],[0x3864FE,203],[0xC481FE,254],[0xFECD71,254],[0x7A53FE,254]], //Meriete
78 => [[0xFE2777,254],[0xFE2777,254],[0x8314FE,157],[0x66FEDB,254],[0xFEA06F,157],[0xFE6F99,157],[0x8314FE,157],[0xFE2777,157],[0xFEA06F,157],[0x66FFDB,157],[0xFE6F99,157],[0x8314FE,157]], //Soho
79 => [[0x3F78FE,223],[0x3F78FE,223],[0x50FDFE,223],[0xFEC02C,223],[0x38AEFE,223],[0xFBFE59,254],[0x50FDFE,223],[0x4079FE,223],[0x38AEFE,254],[0xFEC02C,223],[0xFBFE59,223],[0x50FDFE,254]], //Magneto
80 => [[0xFE5390,160],[0xFE5390,160],[0x31FEEA,254],[0xFE273E,160],[0x8DECFE,160],[0xFE5CF6,160],[0x31FEEA,254],[0xFE5490,160],[0x8DECFE,160],[0xFE273E,254],[0xFE5CF6,254],[0x31FEEA,160]], //Disturbia
81 => [[0x8A14FE,198],[0x8A14FE,198],[0xFEAF27,198],[0xFED258,198],[0xFE55E9,198],[0x5B69FE,198],[0xFEAF27,198],[0x8A14FE,198],[0xFE55E9,198],[0xFED258,198],[0x5B69FE,198],[0xFEAF27,198]], //Vapor Wave
82 => [[0xFE99F5,254],[0xFE99F5,254],[0xA783FE,129],[0xFE4EEF,129],[0x37CAFE,129],[0x870AFE,254],[0xA783FE,129],[0xFE99F5,254],[0x37CAFE,254],[0xFE4EEF,129],[0x870AFE,254],[0xA783FE,254]], //Tyrell
83 => [[0x37D1FE,193],[0x37D1FE,193],[0xFE7A60,193],[0x87C2FE,254],[0xFECF4A,193],[0xFE5D5B,193],[0xFE7A60,193],[0x37D1FE,254],[0xFECF4A,193],[0x87C2FE,193],[0xFE5D5B,193],[0xFE7A60,193]], //Hal
84 => [[0xD9A4FE,254],[0xD9A4FE,254],[0xFEC1C6,172],[0x9E78FE,172],[0xF5B3FE,254],[0xFEA9BA,254],[0xFEC1C6,172],[0xD9A4FE,172],[0xF5B3FE,172],[0x9E78FE,172],[0xFEA9BA,172],[0xFEC1C6,172]], //Stille Wasser
85 => [[0xFEB2EF,254],[0xFEB2EF,142],[0xFE968B,142],[0xFEA043,142],[0x9281FE,254],[0xFE845E,142],[0xFE968B,142],[0xFEB2EF,254],[0x9281FE,142],[0xFEAD4B,142],[0xFE845E,254],[0xFE968B,142]], //Besinnlich
86 => [[0xFE7D41,254],[0xFEEF87,147],[0xFEDC56,198],[0xFEEF87,147],[0xFEDC56,198],[0xFEEF87,147],[0xFE7D41,254],[0xFEEF87,147],[0xFEA455,254],[0xFEDC56,198],[0xFE5C23,254],[0xFEEF87,147]], //Sonnenuntergang
87 => [[0xFE9D8E,254],[0xFE9D8E,96],[0x7FFEFC,96],[0xFEBCD3,96],[0xBCF2FE,96],[0xFE8351,96],[0x7FFEFC,96],[0xFE9D8D,96],[0xBCF2FE,96],[0xFEBCD3,96],[0xFE8351,96],[0x7FFEFC,96]], //Palm Beach
88 => [[0x7885FE,165],[0x7885FE,165],[0xBB95FE,165],[0xFE9297,254],[0x5674FE,165],[0x3861FE,165],[0xBB95FE,165],[0x7885FE,165],[0x5674FE,165],[0xFE9297,165],[0x3861FE,165],[0xBB95FE,165]], //Farbe des Horizonts
89 => [[0xFE8F5B,145],[0xFE8F5B,145],[0x6402FE,145],[0xFECF5E,254],[0xFEB18D,145],[0xFEF19F,254],[0x6402FE,254],[0xFE8F5B,145],[0xFEB18D,254],[0xFECF5E,254],[0xFEF19F,254],[0x6402FE,254]], //Majestätischer Morgen
90 => [[0xFEB58B,129],[0xFEB58B,254],[0xFEFB95,129],[0xAAFEF5,129],[0xD7FED8,129],[0x3CF4FE,254],[0xFEFB95,129],[0xFEB58B,129],[0xD7FED8,129],[0xAAFEF5,129],[0x3CF4FE,129],[0xFEFB95,129]], //Blaue Lagune
91 => [[0xFE9875,79],[0xFE9875,79],[0x6F9CFE,79],[0xFEAD91,79],[0xA6C2FE,79],[0xFEBDB1,79],[0x6F9CFE,79],[0xFE9875,79],[0xA6C2FE,254],[0xFEAD91,198],[0xFEBDB1,254],[0x6F9CFE,79]], //Lake Placid
];
#
# Anzusteuerende Lampen für die einzelnen Szenen:
# - Skript einmalig ausführen, erst dann wird das Profil 'Z2M.LightScene' erstellt
# - Integer-Variable pro gewünschten Raum und Lampe(ngruppe) anlegen
# - Der Variable das Profil 'Z2M.LightScene' zuweisen
# - Als Action dieses Script hinterlegen (eins für alle, darum im nachfolgenden Array alles hinterlegen)
#
# Aufbau Array:
# - pro Szene können n-Lampen angesteuert werden
# - Szenen-Variable mit Profil 'Z2M.LightScene' => Array von Lampen(Zigbee2MQTTDevice)
$LIGHTS = [
// <Szenen-Variable> => [<Zigbee2MQTTDevice_Lampe1>, <Zigbee2MQTTDevice_Lampe2>, <Zigbee2MQTTDevice_Lampe3>, <Zigbee2MQTTDevice_Lampe4>],
58001 => [16766, 52255, 19271, 59623, 31177, 26998, 39044, 13904, 20713, 37232, 25386, 14617],
43800 => [23545, 30933, 59839, 15588, 23634, 30900, 30804, 48155, 46444, 31109],
// weitere Einträge
];
#
################################################################################
#
# Requires include of the global function script via autoload (__autoload.php)
# or direct in the script (uncomment next line)!
require_once(IPS_GetKernelDir()."scripts".DIRECTORY_SEPARATOR.'System.Functions.ips.php');
# You can download it from here https://github.com/wilkware/ips-scripts
#
defined('WWX_FUNCTIONS') || die('Global function library not available!');
// INSTALLATION
if ($_IPS['SENDER'] == 'Execute') {
$vpn = 'Z2M.LightScene';
CreateProfileInteger($vpn, 'Shuffle', '', '', 0, 0, 0, $SCENES);
}
// AKTION VIA WEBFRONT
if ($_IPS['SENDER'] == 'WebFront') {
// Speichern (Wert übernehmen)
SetValue($_IPS['VARIABLE'], $_IPS['VALUE']);
// Szene ausführen
SetScene($LIGHTS[$_IPS['VARIABLE']], $ACTIONS[$_IPS['VALUE']]);
}
// AKTION VIA RUNSCRIPT
if ($_IPS['SENDER'] == 'RunScript') {
// Security Check (modulo count scenes)
$value = $_IPS['VALUE'] % count($SCENES);
// Debug output
// IPS_LogMessage('SZENEN', 'Variable: ' . $_IPS['VARIABLE'] . ', Value: ' . $value);
// Speichern (Wert übernehmen)
SetValue($_IPS['VARIABLE'], $value);
// Szene ausführen
SetScene($LIGHTS[$_IPS['VARIABLE']], $ACTIONS[$value]);
}
# ------------------------------- Functions ------------------------------------
function SetScene($lights, $actions)
{
$set = 0;
$color = 0;
$bright = 0;
foreach($lights as $light) {
if(isset($actions[$set])) {
$color = $actions[$set][0];
$bright = $actions[$set][1];
$set++;
}
$z2mColor = IPS_GetObjectIDByIdent('Z2M_Color', $light); // 'color': xyz
$z2mBright = IPS_GetObjectIDByIdent('Z2M_Brightness', $light); // 'brightness': xyz
//IPS_LogMessage('SZENE', 'ColorTemp: ' . $z2mColor . ', Brightness: ' . $z2mBright . ', Farbe: ' . $mired . ', Helligkeit: ' . $bright);
RequestAction($z2mColor, $color);
RequestAction($z2mBright, $bright);
// IPS_LogMessage('SZENE', 'Variable: ' . $_IPS['VARIABLE'] . ', Value: ' . $_IPS['VALUE']);
}
}
################################################################################
Viel Spaß
Heiko