From 8cad164008be33748d66952d17e933ed8cd8aa84 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Wed, 17 Jan 2024 11:50:02 +0100 Subject: [PATCH] IKEA blueprint, replaced bathroom sensor with ESPHome. --- .../cecche/ikea-somrig-remote-e2213-zha.yaml | 110 ++++++++++++++++++ configuration.yaml | 2 +- esphome/badezimmer-luft.yaml | 57 +++++++++ esphome/epaperframe.yaml | 2 +- 4 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 blueprints/automation/cecche/ikea-somrig-remote-e2213-zha.yaml create mode 100644 esphome/badezimmer-luft.yaml diff --git a/blueprints/automation/cecche/ikea-somrig-remote-e2213-zha.yaml b/blueprints/automation/cecche/ikea-somrig-remote-e2213-zha.yaml new file mode 100644 index 0000000..9a88eb7 --- /dev/null +++ b/blueprints/automation/cecche/ikea-somrig-remote-e2213-zha.yaml @@ -0,0 +1,110 @@ +blueprint: + name: ZHA - IKEA Somrig remote dot-buttons control + description: Fully customisable dot-buttons, with options for single, double and + long press for each one. + domain: automation + input: + remote: + name: Remote + description: IKEA Somrig remote to use + selector: + device: + integration: zha + manufacturer: IKEA of Sweden + model: SOMRIG shortcut button + multiple: false + single_dot_single_press: + name: Single dot (Single press) + description: Action to run on single dot press + default: [] + selector: + action: {} + single_dot_double_press: + name: Single dot (Double press) + description: Action to run on single dot double press + default: [] + selector: + action: {} + single_dot_long_press: + name: Single dot (Long press) + description: Action to run on single dot long press + default: [] + selector: + action: {} + single_dot_long_release: + name: Single dot (Release after long press) + description: Action to run on releasing after a long press on the single dot + default: [] + selector: + action: {} + double_dot_single_press: + name: Double dot (Single press) + description: Action to run on double dot press + default: [] + selector: + action: {} + double_dot_double_press: + name: Double dot (Double press) + description: Action to run on double dot double press + default: [] + selector: + action: {} + double_dot_long_press: + name: Double dot (Long press) + description: Action to run on double dot long press + default: [] + selector: + action: {} + double_dot_long_release: + name: Double dot (Release after long press) + description: Action to run on releasing after a long press on the double dot + default: [] + selector: + action: {} + source_url: https://community.home-assistant.io/t/ikea-somrig-remote-e2213-zha/668671 +mode: single +max_exceeded: silent +trigger: +- platform: event + event_type: zha_event + event_data: + device_id: !input remote +action: +- variables: + command: '{{ trigger.event.data.command }}' + cluster_id: '{{ trigger.event.data.cluster_id }}' + endpoint_id: '{{ trigger.event.data.endpoint_id }}' + args: '{{ trigger.event.data.args }}' +- choose: + - conditions: + - '{{ command == ''short_release'' }}' + - '{{ endpoint_id == 1 }}' + sequence: !input single_dot_single_press + - conditions: + - '{{ command == ''multi_press_complete'' }}' + - '{{ endpoint_id == 1 }}' + sequence: !input single_dot_double_press + - conditions: + - '{{ command == ''long_press'' }}' + - '{{ endpoint_id == 1 }}' + sequence: !input single_dot_long_press + - conditions: + - '{{ command == ''long_release'' }}' + - '{{ endpoint_id == 1 }}' + sequence: !input single_dot_long_release + - conditions: + - '{{ command == ''short_release'' }}' + - '{{ endpoint_id == 2 }}' + sequence: !input double_dot_single_press + - conditions: + - '{{ command == ''multi_press_complete'' }}' + - '{{ endpoint_id == 2 }}' + sequence: !input double_dot_double_press + - conditions: + - '{{ command == ''long_press'' }}' + - '{{ endpoint_id == 2 }}' + sequence: !input double_dot_long_press + - conditions: + - '{{ command == ''long_release'' }}' + - '{{ endpoint_id == 2 }}' + sequence: !input double_dot_long_release diff --git a/configuration.yaml b/configuration.yaml index d88c389..65c7af6 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -74,7 +74,7 @@ media_player: generic_hygrostat: - name: Badezimmer humidifier: fan.badezimmer_ventilator - target_sensor: sensor.badezimmer_luftfeuchtigkeit + target_sensor: sensor.bathroom_badezimmer_luftfeuchtigkeit min_humidity: 30 max_humidity: 70 target_humidity: 50 diff --git a/esphome/badezimmer-luft.yaml b/esphome/badezimmer-luft.yaml new file mode 100644 index 0000000..0080823 --- /dev/null +++ b/esphome/badezimmer-luft.yaml @@ -0,0 +1,57 @@ +substitutions: + name: "bathroom" + friendly_name: "Bad" + +esphome: + name: ${name} + friendly_name: ${friendly_name} + name_add_mac_suffix: false + project: + name: sensor.outdoor + version: "0.8" + min_version: 2022.1.0 + +esp32: + board: esp32-c3-devkitm-1 + framework: + type: arduino + +wifi: + ssid: "Voltage-legacy" + password: !secret voltage_legacy_psk + use_address: bathroom.home + power_save_mode: high + fast_connect: on + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Bad Fallback Hotspot" + password: !secret fallback_psk + +captive_portal: + +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: !secret apikey + +ota: + password: !secret ota + +# DHT22 sensor +sensor: + - platform: dht + model: dht22 + pin: 4 + temperature: + name: "Badezimmer Temperatur" + humidity: + name: "Badezimmer Luftfeuchtigkeit" + update_interval: 60s +# WiFi signal strength + - platform: wifi_signal + name: "WiFi Signalstärke" + update_interval: 60s diff --git a/esphome/epaperframe.yaml b/esphome/epaperframe.yaml index 388623f..da06666 100644 --- a/esphome/epaperframe.yaml +++ b/esphome/epaperframe.yaml @@ -460,7 +460,7 @@ display: it.print(357, 130, id(sub_sensor_font), TextAlign::BASELINE_RIGHT, " - %"); } - if(air_pressure < 1200 && air_pressure >=800) { + if(air_pressure < 1200 && air_pressure >=700) { it.printf(220, 130, id(big_sensor_font), TextAlign::BASELINE_RIGHT, "%4.1f", air_pressure); it.print(225, 130, id(sensor_unit), TextAlign::BASELINE_LEFT, "hPa"); }