Browse Source

reuse hardware for previous purpose

subDesTagesMitExtraKaese 1 month ago
parent
commit
eb1948c6d6
4 changed files with 396 additions and 115 deletions
  1. 1 0
      .gitignore
  2. 8 115
      config.yaml
  3. 289 0
      data.yaml
  4. 98 0
      scripts/generate.py

+ 1 - 0
.gitignore

@@ -3,5 +3,6 @@
 # You can modify this file to suit your needs.
 /.esphome/
 /secrets.yaml
+/mqtt.yaml
 
 /venv/

+ 8 - 115
config.yaml

@@ -5,8 +5,12 @@ esp8266:
 
 wifi:
   networks:
-  - ssid: "NETZ39"
-    password: !secret WifiPassword
+  - ssid: !secret WifiSSID1
+    password: !secret WifiPassword1
+  - ssid: !secret WifiSSID2
+    password: !secret WifiPassword2
+  - ssid: !secret WifiSSID3
+    password: !secret WifiPassword3
 
 # Enable logging
 logger:
@@ -22,9 +26,7 @@ web_server:
 #  encryption:
 #    key: ""
 
-mqtt:
-  broker: mqtt.n39.eu
-  port: 1883
+<<: !include mqtt.yaml
 
 ota:
   - platform: esphome
@@ -38,116 +40,7 @@ time:
       - ptbtime2.ptb.de
       - ptbtime3.ptb.de
 
-button:
-  - platform: template
-    name: Casio Power Button
-    on_press:
-      - remote_transmitter.transmit_nec:
-          address: 0xF484
-          command: 0xF40B
-          command_repeats: 3
-  - platform: template
-    name: "Monitor An/Aus"
-    on_press:
-      - remote_transmitter.transmit_lg:
-          data: 0x02FD48B7 # power on/off
-          nbits: 32
-  - platform: template
-    name: "Ventilator An/Aus"
-    on_press:
-      - remote_transmitter.transmit_pronto:
-          data: "0000 006D 0018 0000 002E 0013 002E 0013 000E 0034 002D 0013 002E 0013 000E 0034 000D 0034 000D 0034 000D 0034 000D 0034 000D 0034 002E 0117 002E 0013 002E 0013 000E 0034 002E 0013 002E 0013 000E 0034 000D 0034 000D 0034 000D 0034 000D 0034 000D 0034 002E 0181 06C3"
-  - platform: template
-    name: "MultisyncX401S Taste 0"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7910, -4019, 448, -546, 449, -545, 448, -1540, 448, -545, 449, -1540, 448, -1540, 449, -1540, 453, -1534, 448, -4030, 456, -537, 451, -1536, 450, -545, 449, -545, 450, -1538, 449, -547, 447, -546, 448, -545, 450]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 1"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7903, -4024, 453, -542, 450, -521, 470, -1545, 443, -547, 448, -1538, 450, -1539, 449, -1543, 445, -1539, 448, -4030, 447, -551, 444, -544, 449, -545, 449, -1541, 447, -547, 447, -547, 447, -545, 449, -546, 451]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 2"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7901, -4024, 454, -546, 445, -543, 449, -1539, 449, -527, 469, -1537, 451, -1538, 448, -1545, 443, -1542, 445, -4029, 448, -1540, 448, -546, 449, -544, 450, -1539, 453, -541, 451, -542, 449, -546, 450, -543, 450]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 3"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7957, -3970, 502, -493, 501, -493, 502, -1491, 500, -494, 497, -1491, 496, -1487, 501, -1486, 511, -1477, 500, -3977, 501, -493, 502, -1487, 503, -490, 501, -1487, 501, -494, 500, -492, 502, -493, 501, -493, 501]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 4"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7905, -4023, 475, -522, 445, -547, 447, -1540, 448, -546, 448, -1541, 447, -1541, 472, -1516, 472, -1518, 445, -4028, 449, -1540, 474, -1514, 448, -546, 448, -1545, 469, -520, 476, -517, 449, -546, 448, -546, 472]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 5"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7901, -4021, 473, -520, 449, -545, 474, -1514, 449, -546, 451, -1537, 453, -1534, 454, -1535, 448, -1540, 448, -4028, 449, -546, 448, -545, 449, -1539, 449, -1539, 449, -545, 449, -545, 449, -546, 448, -545, 449]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 6"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7903, -4024, 450, -544, 449, -544, 477, -1512, 451, -545, 473, -1513, 449, -1538, 451, -1538, 450, -1538, 449, -4027, 451, -1538, 449, -545, 452, -1536, 472, -1515, 449, -546, 455, -538, 449, -545, 450, -545, 450]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 7"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7903, -4024, 448, -546, 448, -549, 446, -1543, 444, -546, 448, -1540, 448, -1540, 448, -1543, 451, -1538, 444, -4028, 449, -545, 453, -1541, 444, -1539, 448, -1541, 447, -531, 463, -546, 448, -545, 449, -546, 453]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 8"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7904, -4024, 448, -546, 449, -547, 446, -1539, 449, -546, 448, -1544, 446, -1539, 447, -1540, 449, -1540, 447, -4031, 450, -1540, 444, -1540, 448, -1539, 449, -1540, 448, -547, 447, -547, 448, -544, 449, -545, 449]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-  - platform: template
-    name: "MultisyncX401S Taste 9"
-    on_press:
-      - remote_transmitter.transmit_raw:
-          code: [7904, -4024, 449, -545, 448, -545, 450, -1540, 447, -546, 449, -1539, 448, -1547, 442, -1539, 448, -1540, 526, -3951, 448, -546, 448, -548, 446, -545, 449, -546, 448, -1541, 449, -547, 445, -549, 445, -545, 450]
-          repeat:
-            times: 5
-            wait_time: 16ms
-          carrier_frequency: 38kHz
-
+<<: !include data.yaml
 
 remote_receiver:
   pin: 

+ 289 - 0
data.yaml

@@ -0,0 +1,289 @@
+button:
+- name: 'on'
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500,
+        -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: 'off'
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500,
+        -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: candle
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500,
+        -600, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: warm white
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -1700, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -600, 500, -600, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: white
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -600, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: cold white
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: night
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -600, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -600, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: sleep
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: reading
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -600, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: yoga
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -600, 500,
+        -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: morning
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -600, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -600, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: color wheel
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -600, 500,
+        -600, 500, -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -1700, 500, -1700, 500, -600, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: random
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -600, 500,
+        -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -1700, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: evening
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500,
+        -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: trees
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -600, 500,
+        -1700, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -1700, 500, -600, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: water
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500,
+        -600, 500, -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600,
+        500, -1700, 500, -1700, 500, -600, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: fire
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500,
+        -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600,
+        500, -1700, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: hearts
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 3, wait_time: 0.5s}
+  platform: template
+- name: saturate
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -600, 500, -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -600, 500, -1700, 500, -600, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 5, wait_time: 0.5s}
+  platform: template
+- name: lighter
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 5, wait_time: 0.5s}
+  platform: template
+- name: blue
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500,
+        -1700, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600,
+        500, -1700, 500, -600, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 5, wait_time: 0.5s}
+  platform: template
+- name: red
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -1700, 500,
+        -1700, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 5, wait_time: 0.5s}
+  platform: template
+- name: orange
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500, -600, 500,
+        -600, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -1700,
+        500]
+      repeat: {times: 5, wait_time: 0.5s}
+  platform: template
+- name: green
+  on_press:
+  - remote_transmitter.transmit_raw:
+      carrier_frequency: 38000
+      code: [9000, -4400, 500, -600, 500, -1700, 500, -600, 500, -600, 500, -600,
+        500, -600, 500, -600, 500, -600, 500, -600, 500, -1700, 500, -1700, 500, -1700,
+        500, -1700, 500, -1700, 500, -1700, 500, -1700, 500, -600, 500, -600, 500,
+        -600, 500, -1700, 500, -600, 500, -600, 500, -600, 500, -600, 500, -1700,
+        500, -1700, 500, -1700, 500, -600, 500, -1700, 500, -1700, 500, -1700, 500,
+        -1700, 500]
+      repeat: {times: 5, wait_time: 0.5s}
+  platform: template

+ 98 - 0
scripts/generate.py

@@ -0,0 +1,98 @@
+import yaml
+
+
+DELAY_RESEND = 488400
+DELAY_HOLD_1 = 39800
+DELAY_HOLD_N = 95200
+
+PREAMBLE = 9000
+PREPAUSE = 4400
+PREHOLD  = 2200
+
+SIGNAL  = 500
+PAUSE_1 = 1700
+PAUSE_0 = 600
+
+rgbButtonsSingle = {
+  "on": 0x407F807F,
+  "off": 0x407F40BF,
+  "candle": 0x407F8877,
+  "warm white": 0x407F6897,
+  "white": 0x407F50AF,
+  "cold white": 0x407FC03F,
+  "night": 0x407F48B7,
+  "sleep": 0x407FE817,
+  "reading": 0x407FD02F,
+  "yoga": 0x407F20DF,
+  "morning": 0x407FC837,
+  "color wheel": 0x407F18E7,
+  "random": 0x407F30CF,
+  "evening": 0x407FA05F,
+  "trees": 0x407F28D7,
+  "water": 0x407F9867,
+  "fire": 0x407FB04F,
+  "hearts": 0x407F609F,
+
+}
+rgbButtonsRepeat = {
+  "saturate": 0x407F58A7,
+  "lighter": 0x407FF00F,
+  "blue": 0x407FA857,
+  "red": 0x407F708F,
+  "orange": 0x407FE01F,
+  "green": 0x407F10EF,
+}
+
+def ir_send_rgb(value):
+  irSignal = [0] * 67
+  irRepeatDelay = DELAY_RESEND
+  
+  irSignal[0] = PREAMBLE
+  irSignal[1] = -PREPAUSE
+  irSignal[2] = SIGNAL
+  
+  for i in range(32):
+    irSignal[65-i*2] = -PAUSE_1 if value & 1<<i else -PAUSE_0
+    irSignal[66-i*2] = SIGNAL
+  return irSignal
+
+data = {
+    'button': [
+        {
+            'platform': "template",
+            'name': key,
+            'on_press': [
+                {
+                    'remote_transmitter.transmit_raw': {
+                        'code': ir_send_rgb(value),
+                        'carrier_frequency': 38_000,
+                        'repeat': {
+                          'times': 3,
+                          'wait_time': "0.5s",
+                        },
+                    }
+                }
+            ]
+        } for key, value in rgbButtonsSingle.items()
+    ] + [
+        {
+            'platform': "template",
+            'name': key,
+            'on_press': [
+                {
+                    'remote_transmitter.transmit_raw': {
+                        'code': ir_send_rgb(value),
+                        'carrier_frequency': 38_000,
+                        'repeat': {
+                          'times': 5,
+                          'wait_time': "0.5s",
+                        },
+                    }
+                }
+            ]
+        } for key, value in rgbButtonsRepeat.items()
+    ]
+}
+
+with open('data.yaml', 'w') as outfile:
+    yaml.dump(data, outfile, default_flow_style=None)