summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-12-30 12:59:53 +0100
committerlassulus <lassulus@lassul.us>2020-12-30 12:59:53 +0100
commit053044834c1af30a90ced1338ae4342a445a2946 (patch)
treeadb34854b427b4ed8f5746e08bc918976b2fdf72 /makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix
parent423f7c56a95576f728c9abfa201f328bbb3875c3 (diff)
parent60a492344bf224982978fd6765aaaadbaf4effc1 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix')
-rw-r--r--makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix b/makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix
new file mode 100644
index 00000000..f0609466
--- /dev/null
+++ b/makefu/2configs/ham/automation/wohnzimmer_rf_fernbedienung.nix
@@ -0,0 +1,61 @@
+# This module maps the RF433 Remote Control to zigbee and wifi lights
+let
+ rf_turn_off = code: light:
+ {
+ alias = "Turn off ${light} via rf code ${code}";
+ trigger = {
+ platform = "event";
+ event_type = "esphome.rf_code_received";
+ event_data.code = code;
+ };
+ action = {
+ service = "light.turn_off";
+ data.entity_id = light;
+ };
+ };
+ rf_turn_on = code: light:
+ {
+ alias = "Turn on ${light} via rf code ${code}";
+ trigger = {
+ platform = "event";
+ event_type = "esphome.rf_code_received";
+ event_data.code = code;
+ };
+ action = {
+ service = "light.turn_on";
+ data.entity_id = light;
+ };
+ };
+ rf_toggle = code: light:
+ {
+ alias = "Toggle ${light} via rf code ${code}";
+ trigger = {
+ platform = "event";
+ event_type = "esphome.rf_code_received";
+ event_data.code = code;
+ };
+ action = {
+ service = "light.toggle";
+ data.entity_id = light;
+ };
+ };
+
+in
+{
+ services.home-assistant.config.automation = [
+ (rf_toggle "400551" "light.wohnzimmer_fernseher_led_strip") # A
+ (rf_toggle "401151" "light.wohnzimmer_stehlampe_osram") # B
+ (rf_toggle "401451" "light.wohnzimmer_komode_osram") # C
+ (rf_toggle "401511" "light.wohnzimmer_schrank_osram") # D
+
+ # OFF Lane
+ (rf_turn_off "400554" "all") # A
+ (rf_toggle "401154" "light.wohnzimmer_fenster_lichterkette_licht") # B
+ (rf_toggle "401454" "light.wohnzimmer_fernsehwand_led") # C
+ # (rf_toggle "401514" "") # D
+ ];
+ # "400554" # A OFF
+ # "401154" # B OFF
+ # "401454" # C OFF
+ # "401514" # D OFF
+}