From 21d2e3402520805dc35cdea8e94b57bf6236c88e Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sun, 10 Nov 2024 03:22:29 +0100 Subject: [PATCH] changes to home-assistant and nb --- esphome/bathroom-bulb-1.yaml | 66 ++++++++ esphome/bathroom-bulb-2.yaml | 66 ++++++++ esphome/bathroom-switch-1.yaml | 143 ++++++++++++++++++ esphome/hallway-bulb-1.yaml | 66 ++++++++ esphome/hallway-bulb-2.yaml | 66 ++++++++ esphome/livingroom-bulb-1.yaml | 66 ++++++++ esphome/livingroom-bulb-2.yaml | 66 ++++++++ esphome/livingroom-bulb-3.yaml | 66 ++++++++ esphome/livingroom-bulb-4.yaml | 66 ++++++++ esphome/livingroom-bulb-5.yaml | 66 ++++++++ esphome/livingroom-bulb-6.yaml | 66 ++++++++ hosts/fw-new/modules/unbound.nix | 10 -- .../modules/home-assistant/light.nix | 72 ++++----- .../modules/home-assistant/shelly.nix | 6 - hosts/fw.cloonar.com/modules/unbound.nix | 16 -- hosts/nb-new.cloonar.com/configuration.nix | 17 +++ .../nb-new.cloonar.com/modules/sway/foot.ini | 2 +- .../nb-new.cloonar.com/modules/sway/sway.conf | 6 +- .../modules/sway/waybar.css | 2 +- hosts/nb-new.cloonar.com/users/dominik.nix | 28 +++- 20 files changed, 888 insertions(+), 74 deletions(-) create mode 100644 esphome/bathroom-bulb-1.yaml create mode 100644 esphome/bathroom-bulb-2.yaml create mode 100644 esphome/bathroom-switch-1.yaml create mode 100644 esphome/hallway-bulb-1.yaml create mode 100644 esphome/hallway-bulb-2.yaml create mode 100644 esphome/livingroom-bulb-1.yaml create mode 100644 esphome/livingroom-bulb-2.yaml create mode 100644 esphome/livingroom-bulb-3.yaml create mode 100644 esphome/livingroom-bulb-4.yaml create mode 100644 esphome/livingroom-bulb-5.yaml create mode 100644 esphome/livingroom-bulb-6.yaml diff --git a/esphome/bathroom-bulb-1.yaml b/esphome/bathroom-bulb-1.yaml new file mode 100644 index 0000000..2f24168 --- /dev/null +++ b/esphome/bathroom-bulb-1.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "bathroom-bulb-1" + friendly_name: "Bathroom Bulb 1" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/bathroom-bulb-2.yaml b/esphome/bathroom-bulb-2.yaml new file mode 100644 index 0000000..d838a76 --- /dev/null +++ b/esphome/bathroom-bulb-2.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "bathroom-bulb-2" + friendly_name: "Bathroom Bulb 2" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/bathroom-switch-1.yaml b/esphome/bathroom-switch-1.yaml new file mode 100644 index 0000000..5bce5e6 --- /dev/null +++ b/esphome/bathroom-switch-1.yaml @@ -0,0 +1,143 @@ +substitutions: + devicename: bathroom-switch-1 + # Name for the relays + channel_1: Light + channel_2: Air + max_power: "2000.0" # watt + max_temp: "80.0" # °C + +esphome: + name: ${devicename} + platform: ESP8266 + board: esp01_1m + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +# Enable Home Assistant API +api: + +i2c: + sda: GPIO12 + scl: GPIO14 + +sensor: + - platform: ade7953_i2c + voltage: + name: ${devicename} voltage + current_a: + name: ${channel_2} current + internal: true + current_b: + name: ${channel_1} current + internal: true + active_power_a: + name: ${channel_2} power + id: power_channel_2 + filters: + - multiply: 1 + on_value_range: + - above: ${max_power} + then: + - output.turn_off: shelly_25_relay_2 + - homeassistant.service: + service: persistent_notification.create + data: + title: Message from ${devicename} + data_template: + message: Switch turned off because power exceeded ${max_power}W + active_power_b: + name: ${channel_1} power + id: power_channel_1 + filters: + - multiply: -1 + on_value_range: + - above: ${max_power} + then: + - output.turn_off: shelly_25_relay_1 + - homeassistant.service: + service: persistent_notification.create + data: + title: Message from ${devicename} + data_template: + message: Switch turned off because power exceeded ${max_power}W + update_interval: 30s + + # NTC Temperature + - platform: ntc + sensor: temp_resistance_reading + name: ${devicename} temperature + unit_of_measurement: "°C" + accuracy_decimals: 1 + icon: "mdi:thermometer" + calibration: + b_constant: 3350 + reference_resistance: 10kOhm + reference_temperature: 298.15K + on_value_range: + - above: ${max_temp} + then: + - output.turn_off: shelly_25_relay_1 + - output.turn_off: shelly_25_relay_2 + - homeassistant.service: + service: persistent_notification.create + data: + title: Message from ${devicename} + data_template: + message: Switch turned off because temperature exceeded ${max_temp}°C + - platform: resistance + id: temp_resistance_reading + sensor: temp_analog_reading + configuration: DOWNSTREAM + resistor: 32kOhm + - platform: adc + id: temp_analog_reading + pin: A0 + +status_led: + pin: + number: GPIO0 + inverted: yes + +output: + - platform: gpio + pin: GPIO4 + id: shelly_25_relay_1 + - platform: gpio + pin: GPIO15 + id: shelly_25_relay_2 + +light: + - platform: binary + name: "${channel_1}" + output: shelly_25_relay_1 + id: lightid + - platform: binary + name: "${channel_2}" + output: shelly_25_relay_2 + id: airid + +binary_sensor: + - platform: gpio + pin: + number: GPIO13 + name: "${channel_1} input" + internal: true + on_state: + then: + - light.toggle: lightid + - platform: gpio + pin: + number: GPIO5 + name: "${channel_2} input" + internal: true + on_state: + then: + - light.toggle: airid + + # Prevent short circuit with "floating" pin! + - platform: gpio + pin: GPIO16 + name: "ade7953 IRQ pin" + internal: true diff --git a/esphome/hallway-bulb-1.yaml b/esphome/hallway-bulb-1.yaml new file mode 100644 index 0000000..6fe0467 --- /dev/null +++ b/esphome/hallway-bulb-1.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "hallway-bulb-1" + friendly_name: "Hallway Bulb 1" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w diff --git a/esphome/hallway-bulb-2.yaml b/esphome/hallway-bulb-2.yaml new file mode 100644 index 0000000..8b42c29 --- /dev/null +++ b/esphome/hallway-bulb-2.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "hallway-bulb-2" + friendly_name: "Hallway Bulb 2" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w diff --git a/esphome/livingroom-bulb-1.yaml b/esphome/livingroom-bulb-1.yaml new file mode 100644 index 0000000..438eff3 --- /dev/null +++ b/esphome/livingroom-bulb-1.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "livingroom-bulb-1" + friendly_name: "Living Room Bulb 1" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/livingroom-bulb-2.yaml b/esphome/livingroom-bulb-2.yaml new file mode 100644 index 0000000..bc71d02 --- /dev/null +++ b/esphome/livingroom-bulb-2.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "livingroom-bulb-2" + friendly_name: "Living Room Bulb 2" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/livingroom-bulb-3.yaml b/esphome/livingroom-bulb-3.yaml new file mode 100644 index 0000000..361b60c --- /dev/null +++ b/esphome/livingroom-bulb-3.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "livingroom-bulb-3" + friendly_name: "Living Room Bulb 3" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/livingroom-bulb-4.yaml b/esphome/livingroom-bulb-4.yaml new file mode 100644 index 0000000..f65283b --- /dev/null +++ b/esphome/livingroom-bulb-4.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "livingroom-bulb-4" + friendly_name: "Living Room Bulb 4" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/livingroom-bulb-5.yaml b/esphome/livingroom-bulb-5.yaml new file mode 100644 index 0000000..3650e1d --- /dev/null +++ b/esphome/livingroom-bulb-5.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "livingroom-bulb-5" + friendly_name: "Living Room Bulb 5" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/esphome/livingroom-bulb-6.yaml b/esphome/livingroom-bulb-6.yaml new file mode 100644 index 0000000..f3057cd --- /dev/null +++ b/esphome/livingroom-bulb-6.yaml @@ -0,0 +1,66 @@ +substitutions: + device_name: "livingroom-bulb-6" + friendly_name: "Living Room Bulb 6" + +esphome: + name: ${device_name} + comment: ${friendly_name} + platform: ESP8266 + board: esp01_1m + on_boot: + then: + - light.turn_on: my_light + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + +ota: + platform: esphome + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: True + domain: .cloonar.smart + +captive_portal: + +light: + - platform: rgbw + id: my_light + name: ${friendly_name} + red: pwm_r + green: pwm_g + blue: pwm_b + white: pwm_w + effects: + - random: + - strobe: + - flicker: + +output: + - platform: esp8266_pwm + pin: GPIO13 + frequency: 1000 Hz + id: pwm_r + + - platform: esp8266_pwm + pin: GPIO12 + frequency: 1000 Hz + id: pwm_g + + - platform: esp8266_pwm + pin: GPIO14 + frequency: 1000 Hz + id: pwm_b + + - platform: esp8266_pwm + pin: GPIO5 + frequency: 1000 Hz + id: pwm_w \ No newline at end of file diff --git a/hosts/fw-new/modules/unbound.nix b/hosts/fw-new/modules/unbound.nix index e47c43d..02210d4 100644 --- a/hosts/fw-new/modules/unbound.nix +++ b/hosts/fw-new/modules/unbound.nix @@ -113,12 +113,6 @@ let "\"xbox.cloonar.multimedia IN A 10.42.99.13\"" # "\"switch.cloonar.multimedia IN A 10.42.99.14\"" #living room - "\"shellycolorbulb-livingroom-1.cloonar.smart IN A 10.42.100.2\"" - "\"shellycolorbulb-livingroom-2.cloonar.smart IN A 10.42.100.3\"" - "\"shellycolorbulb-livingroom-3.cloonar.smart IN A 10.42.100.4\"" - "\"shellycolorbulb-livingroom-4.cloonar.smart IN A 10.42.100.5\"" - "\"shellycolorbulb-livingroom-5.cloonar.smart IN A 10.42.100.6\"" - "\"shellycolorbulb-livingroom-6.cloonar.smart IN A 10.42.100.7\"" "\"shellyuni-livingroom-1.cloonar.smart IN A 10.42.100.8\"" "\"shellyswitch25-livingroom-1.cloonar.smart IN A 10.42.100.9\"" "\"shellyplug-s-living-1.cloonar.smart IN A 10.42.100.10\"" @@ -133,10 +127,6 @@ let "\"shellyrgbw2-bedroom-1.cloonar.smart IN A 10.42.100.36\"" "\"shellyrgbw2-bedroom-2.cloonar.smart IN A 10.42.100.37\"" "\"shellyrgbw2-bedroom-3.cloonar.smart IN A 10.42.100.38\"" - "\"shellycolorbulb-bedroom-1.cloonar.smart IN A 10.42.100.39\"" - "\"shellycolorbulb-bedroom-2.cloonar.smart IN A 10.42.100.40\"" - "\"shellycolorbulb-bedroom-3.cloonar.smart IN A 10.42.100.41\"" - "\"shellycolorbulb-bedroom-4.cloonar.smart IN A 10.42.100.42\"" # bath "\"shellyswitch25-bath-1.cloonar.smart IN A 10.42.100.49\"" "\"shellybulbduo-bath-1.cloonar.smart IN A 10.42.100.50\"" diff --git a/hosts/fw.cloonar.com/modules/home-assistant/light.nix b/hosts/fw.cloonar.com/modules/home-assistant/light.nix index 68ef290..2caef71 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/light.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/light.nix @@ -69,9 +69,6 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.toilett_lights' }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { @@ -87,17 +84,14 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.hallway_lights' }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { entity_id = "{{ trigger.entity_id }}"; }; data = { - brightness_pct = 1; - color_temp = 450; + brightness_pct = 30; + rgbw_color = [ 255 126 0 255 ]; }; } ]; @@ -105,17 +99,14 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.bathroom_lights' }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { entity_id = "{{ trigger.entity_id }}"; }; data = { - brightness_pct = 30; - color_temp = 450; + brightness_pct = 45; + rgbw_color = [ 255 126 0 255 ]; }; } ]; @@ -123,17 +114,14 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.livingroom_lights' }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { entity_id = "{{ trigger.entity_id }}"; }; data = { - brightness_pct = 5; - color_temp = 450; + brightness_pct = 25; + rgbw_color = [ 255 126 0 255 ]; }; } ]; @@ -141,16 +129,13 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.bedroom_lights' }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { entity_id = "light.bedroom_lights"; }; data = { - brightness_pct = 15; + brightness_pct = 20; rgbw_color = [ 255 126 0 255 ]; }; } @@ -159,9 +144,6 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') < 5 and trigger.entity_id == 'light.kitchen_lights' }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { @@ -177,9 +159,6 @@ { conditions = [ "{{ state_attr('sun.sun', 'elevation') > 4 }}" ]; sequence = [ - { - delay = 10; - } { service = "light.turn_on"; target = { @@ -373,12 +352,12 @@ all = true; entities = [ "light.livingroom_switch" - "light.living_bulb_1" - "light.living_bulb_2" - "light.living_bulb_3" - "light.living_bulb_4" - "light.living_bulb_5" - "light.living_bulb_6" + "light.living_room_bulb_1" + "light.living_room_bulb_2" + "light.living_room_bulb_3" + "light.living_room_bulb_4" + "light.living_room_bulb_5" + "light.living_room_bulb_6" ]; } { @@ -412,6 +391,31 @@ "light.bedroom_bulb_4" ]; } + { + platform = "group"; + name = "Bathroom Lights"; + all = true; + entities = [ + "light.bathroom_switch" + "light.bathroom_bulb_1" + "light.bathroom_bulb_2" + ]; + } + { + platform = "switch"; + name = "Hallway Switch"; + entity_id = "switch.hallway"; + } + { + platform = "group"; + name = "Hallway Lights"; + all = true; + entities = [ + "light.hallway_switch" + "light.hallway_bulb_1" + "light.hallway_bulb_2" + ]; + } ]; }; } diff --git a/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix b/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix index 69ce20e..46d0bd9 100644 --- a/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix +++ b/hosts/fw.cloonar.com/modules/home-assistant/shelly.nix @@ -1,12 +1,6 @@ { lib, ... }: let colorbulbs = [ - { name = "Living Bulb 1"; id = "34945479BC57"; } - { name = "Living Bulb 2"; id = "485519D9A1B2"; } - { name = "Living Bulb 3"; id = "485519D9AE95"; } - { name = "Living Bulb 4"; id = "485519D94A28"; } - { name = "Living Bulb 5"; id = "485519DA6B6A"; } - { name = "Living Bulb 6"; id = "485519D9E018"; } ]; switches = [ diff --git a/hosts/fw.cloonar.com/modules/unbound.nix b/hosts/fw.cloonar.com/modules/unbound.nix index 2f9fe71..e53299f 100644 --- a/hosts/fw.cloonar.com/modules/unbound.nix +++ b/hosts/fw.cloonar.com/modules/unbound.nix @@ -117,12 +117,6 @@ let "\"xbox.cloonar.multimedia IN A 10.42.99.13\"" # "\"switch.cloonar.multimedia IN A 10.42.99.14\"" #living room - "\"shellycolorbulb-livingroom-1.cloonar.smart IN A 10.42.100.2\"" - "\"shellycolorbulb-livingroom-2.cloonar.smart IN A 10.42.100.3\"" - "\"shellycolorbulb-livingroom-3.cloonar.smart IN A 10.42.100.4\"" - "\"shellycolorbulb-livingroom-4.cloonar.smart IN A 10.42.100.5\"" - "\"shellycolorbulb-livingroom-5.cloonar.smart IN A 10.42.100.6\"" - "\"shellycolorbulb-livingroom-6.cloonar.smart IN A 10.42.100.7\"" "\"shellyuni-livingroom-1.cloonar.smart IN A 10.42.100.8\"" "\"shellyswitch25-livingroom-1.cloonar.smart IN A 10.42.100.9\"" "\"shellyplug-s-living-1.cloonar.smart IN A 10.42.100.10\"" @@ -137,22 +131,12 @@ let "\"shellyrgbw2-bedroom-1.cloonar.smart IN A 10.42.100.36\"" "\"shellyrgbw2-bedroom-2.cloonar.smart IN A 10.42.100.37\"" "\"shellyrgbw2-bedroom-3.cloonar.smart IN A 10.42.100.38\"" - "\"shellycolorbulb-bedroom-1.cloonar.smart IN A 10.42.100.39\"" - "\"shellycolorbulb-bedroom-2.cloonar.smart IN A 10.42.100.40\"" - "\"shellycolorbulb-bedroom-3.cloonar.smart IN A 10.42.100.41\"" - "\"shellycolorbulb-bedroom-4.cloonar.smart IN A 10.42.100.42\"" # bath "\"shellyswitch25-bath-1.cloonar.smart IN A 10.42.100.49\"" - "\"shellybulbduo-bath-1.cloonar.smart IN A 10.42.100.50\"" - "\"shellybulbduo-bath-2.cloonar.smart IN A 10.42.100.51\"" "\"shelly1pm-bath-1.cloonar.smart IN A 10.42.100.52\"" "\"shellyht-bath-1.cloonar.smart IN A 10.42.100.53\"" # todo # hallway "\"shelly1-hallway-1.cloonar.smart IN A 10.42.100.65\"" - "\"shellycolorbulb-hallway-1.cloonar.smart IN A 10.42.100.66\"" - "\"shellycolorbulb-hallway-2.cloonar.smart IN A 10.42.100.67\"" - "\"shellycolorbulb-hallway-3.cloonar.smart IN A 10.42.100.68\"" - "\"shellycolorbulb-hallway-4.cloonar.smart IN A 10.42.100.69\"" "\"shellyem3.cloonar.smart IN A 10.42.100.70\"" "\"shellypro-1.cloonar.smart IN A 10.42.100.71\"" "\"shellypro-2.cloonar.smart IN A 10.42.100.72\"" diff --git a/hosts/nb-new.cloonar.com/configuration.nix b/hosts/nb-new.cloonar.com/configuration.nix index a275bba..490a288 100644 --- a/hosts/nb-new.cloonar.com/configuration.nix +++ b/hosts/nb-new.cloonar.com/configuration.nix @@ -43,8 +43,25 @@ in { open-sans nix-prefetch jq + oh-my-zsh + zsh-autosuggestions + zsh-completions + zsh-syntax-highlighting + zsh-history-substring-search ]; + programs.zsh = { + enable = true; + ohMyZsh = { + enable = true; # Enable Oh My Zsh + theme = "steeef"; # Set theme + plugins = [ "git" "zsh-autosuggestions" ]; # Add plugins + }; + }; + users.defaultUserShell = pkgs.zsh; + + services.fwupd.enable = true; + swapDevices = [ { device = "/nix/persist/swapfile"; size = 32 * 1024; # Size is in megabytes diff --git a/hosts/nb-new.cloonar.com/modules/sway/foot.ini b/hosts/nb-new.cloonar.com/modules/sway/foot.ini index 8d7993e..de1b1f1 100644 --- a/hosts/nb-new.cloonar.com/modules/sway/foot.ini +++ b/hosts/nb-new.cloonar.com/modules/sway/foot.ini @@ -8,7 +8,7 @@ # title=foot # locked-title=no -# font=monospace:size=12 +font=monospace:size=14 # font-bold= # font-italic= # font-bold-italic= diff --git a/hosts/nb-new.cloonar.com/modules/sway/sway.conf b/hosts/nb-new.cloonar.com/modules/sway/sway.conf index 3e0fda3..185c374 100644 --- a/hosts/nb-new.cloonar.com/modules/sway/sway.conf +++ b/hosts/nb-new.cloonar.com/modules/sway/sway.conf @@ -5,7 +5,7 @@ # i3 config file (v4) # font for window titles and bar -font pango:Source Sans Pro 8 +font pango:Source Sans Pro 14 # use win key set $mod Mod4 @@ -293,7 +293,6 @@ exec dbus-sway-environment exec configure-gtk exec nm-applet --indicator exec alacritty -t alacritty-sway -exec signal-desktop exec firefox --name=social -p social exec thunderbird exec firefox @@ -311,7 +310,8 @@ exec 'sleep 2; swaymsg workspace "$ws8"; swaymsg layout tabbed' exec mako --default-timeout=5000 # wallpaper -output eDP-1 scale 1.5 scale_filter linear +# output eDP-1 scale 2 scale_filter linear +output eDP-1 mode 1680x1050 output eDP-1 bg #282a36 solid_color output eDP-1 bg ~/.wallpaper.png center output DP-4 bg #282a36 solid_color diff --git a/hosts/nb-new.cloonar.com/modules/sway/waybar.css b/hosts/nb-new.cloonar.com/modules/sway/waybar.css index 82c1eba..8502a39 100644 --- a/hosts/nb-new.cloonar.com/modules/sway/waybar.css +++ b/hosts/nb-new.cloonar.com/modules/sway/waybar.css @@ -1,5 +1,5 @@ * { - font-size: 10px; + font-size: 16px; font-family: monospace; } diff --git a/hosts/nb-new.cloonar.com/users/dominik.nix b/hosts/nb-new.cloonar.com/users/dominik.nix index 2a1ba00..c269a5a 100644 --- a/hosts/nb-new.cloonar.com/users/dominik.nix +++ b/hosts/nb-new.cloonar.com/users/dominik.nix @@ -14,7 +14,7 @@ let "calendar.ui.version" = 3; "calendar.timezone.local" = "Europe/Vienna"; "calendar.week.start" = 1; - # "layout.css.devPixelsPerPx" = "1"; + "layout.css.devPixelsPerPx" = "0.75"; }; thunderbirdCalendarPersonal = { @@ -70,7 +70,7 @@ let "signon.rememberSignons" = false; "identity.sync.tokenserver.uri" = "https://sync.cloonar.com:5000/token/1.0/sync/1.5"; # "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "layout.css.devPixelsPerPx" = "1"; + "layout.css.devPixelsPerPx" = "0.75"; "media.ffmpeg.vaapi.enabled" = true; "media.ffmpeg.vaapi-drm-display.enabled" = true; "gfx.webrender.all" = true; @@ -149,6 +149,19 @@ in /* The home.stateVersion option does not have a default and must be set */ home.stateVersion = "24.05"; home.enableNixpkgsReleaseCheck = false; + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + }; + + programs.bash = { + enable = true; + + initExtra = '' + # include .profile if it exists + [[ -f ~/.profile ]] && . ~/.profile + ''; + }; + /* Here goes the rest of your home-manager config, e.g. home.packages = [ pkgs.foo ]; */ # home.persistence."/nix/persist/user/dominik" = { # allowOther = true; @@ -217,7 +230,10 @@ in "--enable-features=WebUIDarkMode" "--force-dark-mode" # "--high-dpi-support=1" - "--force-device-scale-factor=1" + # "--force-device-scale-factor=1.15" + "--enable-features=UseOzonePlatform" + "--ozone-platform=wayland" + # "--use-gl=egl" ]; dictionaries = [ pkgs.hunspellDictsChromium.en_US @@ -450,6 +466,12 @@ in programs.firefox = { enable = true; + package = pkgs.firefox.overrideAttrs (a: { + postInstall = a.postInstall or "" + '' + wrapProgram "$out/bin/firefox" \ + export MOZ_ENABLE_WAYLAND=1 + ''; + }); profiles = { default = { id = 0;