summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/multi
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/home/ham/multi')
-rw-r--r--makefu/2configs/home/ham/multi/fliegen-couter.nix71
-rw-r--r--makefu/2configs/home/ham/multi/flurlicht.nix57
-rw-r--r--makefu/2configs/home/ham/multi/kurzzeitwecker.nix136
-rw-r--r--makefu/2configs/home/ham/multi/the_playlist.nix86
4 files changed, 0 insertions, 350 deletions
diff --git a/makefu/2configs/home/ham/multi/fliegen-couter.nix b/makefu/2configs/home/ham/multi/fliegen-couter.nix
deleted file mode 100644
index 5b8abb2f..00000000
--- a/makefu/2configs/home/ham/multi/fliegen-couter.nix
+++ /dev/null
@@ -1,71 +0,0 @@
-# uses:
-# sensor.btn1_click
-# sensor.btn2_click
-let
- hlib = import ../lib;
- fly_swat = for: btn: method: incr: {
- alias = "Increment ${method} for ${for}";
- trigger = {
- platform = "state";
- entity_id = "sensor.${btn}_click";
- to = method;
- };
- action = builtins.genList (cnt: {
- service = "counter.increment";
- data.entity_id = "counter.${for}_fliegen";
- }) incr;
- };
-in
-{
- services.home-assistant.config =
- {
- counter = {
- felix_fliegen = {};
- misa_fliegen = {};
- };
- automation = [
- (fly_swat "misa" "btn1" "single" 1)
- (fly_swat "misa" "btn1" "double" 2)
- (fly_swat "misa" "btn1" "triple" 3)
- (fly_swat "felix" "btn2" "single" 1)
- (fly_swat "felix" "btn2" "double" 2)
- (fly_swat "felix" "btn2" "triple" 3)
- {
- alias = "Send Fly Counter Update";
- trigger = [
- {
- platform = "state";
- entity_id = "counter.felix_fliegen";
- }
- {
- platform = "state";
- entity_id = "counter.misa_fliegen";
- #above = -1;
- }
- ];
- action = {
- service = "mqtt.publish";
- data_template = { # gauge-style
- payload = "{{ trigger.to_state.state }}";
- topic = "${hlib.prefix}/flycounter/{{ trigger.to_state.object_id }}";
- };
- };
- }
- {
- alias = "Reset Fly counters on midnight";
- trigger = {
- platform = "time";
- at = "01:00:00";
- };
- action = [
- { service = "counter.reset";
- data.entity_id = "counter.misa_fliegen";
- }
- { service = "counter.reset";
- data.entity_id = "counter.felix_fliegen";
- }
- ];
- }
- ];
- };
-}
diff --git a/makefu/2configs/home/ham/multi/flurlicht.nix b/makefu/2configs/home/ham/multi/flurlicht.nix
deleted file mode 100644
index 25eb78b7..00000000
--- a/makefu/2configs/home/ham/multi/flurlicht.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-# provides:
-# light
-# automation
-# binary_sensor
-let
- hlib = (import ../lib);
- tasmota = hlib.tasmota;
-in
-{
- binary_sensor = [
- (tasmota.motion { name = "Flur Bewegung"; host = "flurlicht";})
- ];
- light = [ (tasmota.rgb { name = "Flurlicht"; host = "flurlicht";} ) ];
- automation = [
- { alias = "Dunkel bei Sonnenuntergang";
- trigger = {
- platform = "sun";
- event = "sunset";
- # offset: "-00:45:00"
- };
- action = [
- {
- service= "light.turn_on";
- data = {
- entity_id= "light.flurlicht";
- # rgb_color = [ 0,0,0 ]; <-- TODO default color
- brightness_pct = 15;
- };
- }
- {
- service= "light.turn_off";
- entity_id= "light.flurlicht";
- }
- ];
- }
- { alias = "Hell bei Sonnenaufgang";
- trigger = {
- platform = "sun";
- event = "sunrise";
- # offset: "-00:00:00"
- };
- action = [
- {
- service= "light.turn_on";
- data = {
- entity_id= "light.flurlicht";
- brightness_pct = 85;
- };
- }
- {
- service= "light.turn_off";
- entity_id= "light.flurlicht";
- }
- ];
- }
- ];
-}
diff --git a/makefu/2configs/home/ham/multi/kurzzeitwecker.nix b/makefu/2configs/home/ham/multi/kurzzeitwecker.nix
deleted file mode 100644
index a0748e20..00000000
--- a/makefu/2configs/home/ham/multi/kurzzeitwecker.nix
+++ /dev/null
@@ -1,136 +0,0 @@
-# Provides:
-# timer
-# automation
-# script
-
-# Needs:
-# sensor.zigbee_btn1_click
-# notify.signal_home
-let
- button = "sensor.zigbee_btn2_click";
- notify = "notify.signal_home";
-in
-{
- services.home-assistant.config = {
- timer.kurzzeitwecker =
- {
- name = "Zigbee Kurzzeitwecker";
- duration = 300;
- };
- script.add_5_minutes_to_kurzzeitwecker =
- {
- alias = "Add 5 minutes to kurzzeitwecker";
- sequence = [
- { service = "timer.pause";
- entity_id = "timer.kurzzeitwecker";
- }
- { service = "timer.start";
- data_template = {
- entity_id = "timer.kurzzeitwecker";
- duration = ''
- {% set r = state_attr('timer.kurzzeitwecker', 'remaining') ~ '-0000' %}
- {% set t = strptime(r, '%H:%M:%S.%f%z') %}
- {{ (as_timestamp(t) + 300) | timestamp_custom('%H:%M:%S', false) }}
- '';
- };
- }
- ];
- };
- automation =
- [
- {
- alias = "Start Timer 5min";
- trigger = {
- platform = "state";
- entity_id = button;
- to = "single";
- };
- condition =
- { condition = "state";
- entity_id = "timer.kurzzeitwecker";
- state = "idle";
- };
-
- action = [
- { service = "timer.start";
- entity_id = "timer.kurzzeitwecker";
- data.duration = "00:05:00";
- }
- {
- service = notify;
- data.message = "Timer gestartet {{state_attr('timer.kurzzeitwecker', 'remaining') }}, verbleibend ";
- }
- ];
- }
- {
- alias = "Add Timer 5min";
- trigger = {
- platform = "state";
- entity_id = button;
- to = "single";
- };
- condition =
- { condition = "state";
- entity_id = "timer.kurzzeitwecker";
- state = "active";
- };
-
- action = [
- { service = "homeassistant.turn_on";
- entity_id = "script.add_5_minutes_to_kurzzeitwecker";
- }
- {
- service = notify;
- data.message = ''Timer um 5 minuten verlängert, {{ state_attr('timer.kurzzeitwecker', 'remaining') | truncate(9,True," ") }} verbleibend '';
- }
- ];
- }
- {
- alias = "Stop timer on double click";
- trigger = [
- {
- platform = "state";
- entity_id = button;
- to = "double";
- }
- {
- platform = "state";
- entity_id = button;
- to = "triple";
- }
- ];
- condition =
- {
- condition = "state";
- entity_id = "timer.kurzzeitwecker";
- state = "active";
- };
-
- action = [
- {
- service = "timer.cancel";
- entity_id = "timer.kurzzeitwecker";
- }
- {
- service = notify;
- data.message = "Timer gestoppt, abgebrochen";
- }
- ];
- }
- {
- alias = "Timer Finished";
- trigger = {
- platform = "event";
- event_type = "timer.finished";
- event_data.entity_id = "timer.kurzzeitwecker";
- };
- action = [
- {
- service = notify;
- data.message = "Timer beendet";
- }
- ];
- }
- ];
- };
-}
diff --git a/makefu/2configs/home/ham/multi/the_playlist.nix b/makefu/2configs/home/ham/multi/the_playlist.nix
deleted file mode 100644
index 0d714ea4..00000000
--- a/makefu/2configs/home/ham/multi/the_playlist.nix
+++ /dev/null
@@ -1,86 +0,0 @@
-# Inputs:
-# binary_sensor.playlist_button_good
-# binary_sensor.playlist_button_bad
-
-# outputs
-# rest_command
-# automation
-# sensor
-{
- services.home-assistant.config =
- {
- rest_command = {
- good_song = {
- url = "http://prism.r:8001/good";
- method = "POST";
- };
- bad_song = {
- url = "http://prism.r:8001/skip";
- method = "POST";
- };
- };
- automation = [
- {
- alias = "playlist song publish";
- trigger = {
- #platform = "event";
- #event_data.entity_id = "sensor.the_playlist_song";
- platform = "state";
- entity_id = "sensor.the_playlist_song";
- };
- action = {
- service = "mqtt.publish";
- data = {
- topic = "/ham/the_playlist/song";
- payload_template = "{{ states.sensor.the_playlist_song.state }}";
- };
- };
- }
- {
- alias = "playlist upvote on button";
- trigger = {
- platform = "state";
- entity_id = "binary_sensor.playlist_button_good";
- from = "off";
- to = "on";
- };
- action.service = "rest_command.good_song";
- }
- {
- alias = "playlist downvote on button";
- trigger = {
- platform = "state";
- entity_id = "binary_sensor.playlist_button_bad";
- from = "off";
- to = "on";
- };
- action.service = "rest_command.bad_song";
- }
- ];
- sensor = [
- { platform = "rest";
- name = "pl";
- resource = "http://prism.r:8001/current";
- scan_interval = 30;
- value_template = "1";
- json_attributes = [ "name" "filename" "youtube" ];
- }
- { platform = "template";
- sensors = {
- the_playlist_song = {
- friendly_name = "Current Song";
- value_template = ''{{ states.sensor.pl.attributes['name'] }}'';
- };
- the_playlist_url = {
- friendly_name = "Song Youtube URL";
- value_template = ''{{ states.sensor.pl.attributes['youtube'] }}'';
- };
- the_playlist_filename = {
- friendly_name = "Song Filename";
- value_template = ''{{ states.sensor.pl.attributes['filename'] }}'';
- };
- };
- }
- ];
- };
-}