From e21474e7333804262f2cc9d3d1bec456f3459b66 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Tue, 13 Jan 2026 11:31:56 +0100 Subject: [PATCH] Ready for synching test --- .gitignore | 5 + ades-office-control-panel.yaml | 1086 +++++++++++++++++ ...> ades-office-resistive-control-panel.yaml | 451 +++---- ns-panel-ground-floor.yaml | 45 + oekoboiler-interface.yaml | 634 ++++++++++ Oekoboiler/main.yaml => oekoboiler.yaml | 0 .../main.yaml => old-phone-doorbell.yaml | 3 +- powermeter.yaml | 77 ++ 8 files changed, 2033 insertions(+), 268 deletions(-) create mode 100644 .gitignore create mode 100644 ades-office-control-panel.yaml rename ades-office-control-panel/main.yaml => ades-office-resistive-control-panel.yaml (81%) create mode 100644 ns-panel-ground-floor.yaml create mode 100644 oekoboiler-interface.yaml rename Oekoboiler/main.yaml => oekoboiler.yaml (100%) rename Old_Phone_Doorbell/main.yaml => old-phone-doorbell.yaml (99%) create mode 100644 powermeter.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d8b4157 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Gitignore settings for ESPHome +# This is an example and may include too much for your use-case. +# You can modify this file to suit your needs. +/.esphome/ +/secrets.yaml diff --git a/ades-office-control-panel.yaml b/ades-office-control-panel.yaml new file mode 100644 index 0000000..f9e248b --- /dev/null +++ b/ades-office-control-panel.yaml @@ -0,0 +1,1086 @@ +substitutions: + device_name: "ades-office-control-panel" + friendly_name: Ade's Office Control Panel + +esphome: + name: $device_name + friendly_name: $friendly_name + on_boot: + - delay: 2s + +esp32: + board: esp32dev + framework: + type: arduino +logger: + +ota: + platform: esphome + password: !secret ota_password + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + fast_connect: true + on_connect: + - lvgl.widget.show: wifiStatusIcon + on_disconnect: + - lvgl.widget.hide: wifiStatusIcon + + +light: + - platform: monochromatic + output: backlight_pwm + name: Display Backlight + id: backlight + restore_mode: ALWAYS_ON + +time: + - platform: homeassistant + id: esptime + +spi: + - id: tft + clk_pin: GPIO14 + mosi_pin: GPIO13 + miso_pin: GPIO12 + +i2c: + sda: GPIO33 + scl: GPIO32 + +touchscreen: + platform: cst816 + id: my_touchscreen + display: mainDisplay + reset_pin: GPIO25 + update_interval: 50ms + transform: + mirror_x: true + mirror_y: true + on_touch: + - lambda: |- + ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d", + touch.x, + touch.y, + touch.x_raw, + touch.y_raw + ); + on_release: + then: + - if: + condition: lvgl.is_paused + then: + - logger.log: "LVGL resuming" + - lvgl.resume: + - lvgl.widget.redraw: + - light.turn_on: backlight + +output: + - platform: ledc + pin: GPIO27 + id: backlight_pwm + +api: + encryption: + key: "FdLcYGMsxFkCFoY8UUu0q/huDesKrcy4+vNQujhbXVE=" + on_client_connected: + - lvgl.widget.show: haStatusIcon + on_client_disconnected: + if: + condition: + api.connected: + then: + - lvgl.widget.show: haStatusIcon + else: + - lvgl.widget.hide: haStatusIcon + +display: + - id: mainDisplay + platform: ili9xxx + model: ili9341 + spi_id: tft + cs_pin: + number: 15 + ignore_strapping_warning: true + dc_pin: + number: 2 + ignore_strapping_warning: true + invert_colors: false + update_interval: never + auto_clear_enabled: false + pixel_mode: 16bit + transform: + mirror_y: true + mirror_x: true + swap_xy: false + dimensions: + height: 320 + width: 240 + color_order: rgb + init_sequence: + - [0x01 ] + - [0xcf, 0x00, 0xC1, 0x30 ] + - [0xed, 0x64, 0x03, 0x12, 0x81 ] # POSC Pwr on seq. ctrl + - [0xe8, 0x85, 0x00, 0x78 ] # DTCA Driver timing ctrl A + - [0xcb, 0x39, 0x2C, 0x00, 0x34, 0x02 ] # PWCTRA Pwr ctrl A + - [0xf7, 0x20 ] # PUMPRC Pump ratio control + - [0xea, 0x00, 0x00 ] # DTCB Driver timing ctrl B + - [0xc0, 0x23 ] # PWCTR1 Pwr ctrl 1 + - [0xc1, 0x10 ] # PWCTR2 Pwr ctrl 2 + - [0xc5, 0x3E, 0x28 ] # VMCTR1 VCOM ctrl 1 + - [0xc7, 0x86 ] # VMCTR2 VCOM ctrl 2 + - [0x36, 0x48 ] + - [0x37, 0x00 ] # VSCRSADD Vertical scrolling start address + - [0x3a, 0x55 ] # PIXFMT COLMOD: Pixel format 16 bits (MCU & interface) + - [0xb1, 0x00, 0x18 ] # FRMCTR1 Frame rate ctrl + - [0xb6, 0x08, 0x82, 0x27 ] # DFUNCTR + - [0xf2, 0x01 ] # ENABLE3G Enable 3 gamma ctrl + - [0x26, 0x01 ] # GAMMASET Gamma curve selected + #- [0xe0, 0x0F, 0x31, 0x2B, 0x0C, 0x0E, 0x08, 0x4E, 0xF1, 0x37, 0x07, 0x10, 0x03, 0x0E, 0x09, 0x00 ] + #- [0xe1, 0x00, 0x0E, 0x14, 0x03, 0x11, 0x07, 0x31, 0xC1, 0x48, 0x08, 0x0F, 0x0C, 0x31, 0x36, 0x0F ] + - [0x11 ] # SLPOUT Exit sleep + - [0x29 ] # DISPLAY_ON + +sensor: + - platform: adc + pin: 34 + name: "Brightness" + update_interval: 60s + id: lsr + - platform: homeassistant + entity_id: sensor.k2plus_c06b_print_progress + id: sensor_3dprinter_percentage + on_value: + then: + - lvgl.label.update: + id: lbl_3dprinter_percentage + text: + format: "Percentage: %.0f%%" + args: [x] + - platform: homeassistant + entity_id: sensor.k2plus_c06b_nozzle_temperature + id: sensor_3dprinter_nozzle + on_value: + then: + - lvgl.indicator.update: + id: gauge_3dprinter_nozzle_needle + value: !lambda return x; + - lvgl.label.update: + id: gauge_3dprinter_nozzle_text + text: + format: "%.0fC" + args: [ 'x' ] + - platform: homeassistant + entity_id: number.k2plus_c06b_nozzle_target + id: number_3dprinter_nozzle_target + on_value: + then: + - lvgl.arc.update: + id: arc_nozzle_target + value: !lambda return x; + - platform: homeassistant + entity_id: sensor.k2plus_c06b_bed_temperature + id: sensor_3dprinter_bed + on_value: + then: + - lvgl.indicator.update: + id: gauge_3dprinter_bed_needle + value: !lambda return x; + - lvgl.label.update: + id: gauge_3dprinter_bed_text + text: + format: "%.0fC" + args: [ 'x' ] + - platform: homeassistant + entity_id: number.k2plus_c06b_bed_target + id: number_3dprinter_bed_target + on_value: + then: + - lvgl.arc.update: + id: arc_bed_target + value: !lambda return x; + +text_sensor: + - platform: homeassistant + entity_id: sensor.k2plus_c06b_print_status + id: printerStatus + on_value: + then: + - if: + condition: + lambda: 'return x == "printing";' + then: + - lvgl.widget.update: + id: button3dPrinter + state: + disabled: ON + else: + - lvgl.widget.update: + id: button3dPrinter + state: + disabled: OFF + - lvgl.label.update: + id: lbl_3dprinter_status + text: + format: "Status: %s" + args: [x.c_str()] + - platform: homeassistant + entity_id: sensor.k2plus_c06b_current_object + id: printer_modelname + on_value: + then: + - lvgl.label.update: + id: lbl_3dprinter_modelname + text: + format: "Model: %s" + args: [x.c_str()] + - platform: homeassistant + entity_id: sensor.k2plus_c06b_working_layer + id: printer_working_layer + on_value: + then: + - lvgl.label.update: + id: lbl_3dprinter_layer + text: + format: "Layer: %s" + args: [x.c_str()] + - platform: homeassistant + entity_id: sensor.k2plus_c06b_print_time_left + id: printer_print_time_left + on_value: + then: + - lvgl.label.update: + id: lbl_3dprinter_print_time_left + text: + format: "Time remaining: %s" + args: [x.c_str()] +number: + - platform: template + name: "LVGL Screen Timeout" + optimistic: true + id: displayTimeout + unit_of_measurement: "s" + initial_value: 1800 + restore_value: true + min_value: 10 + max_value: 1800 + step: 5 + mode: box + + - platform: homeassistant + id: pcPower + entity_id: sensor.pc_ade_energy_power + on_value: + - if: + condition: + number.in_range: + id: pcPower + below: 5.0 + then: + - lvgl.widget.update: + id: buttonPc + state: + disabled: OFF + else: + - lvgl.widget.update: + id: buttonPc + state: + disabled: ON + - logger.log: "PC button disabled" + +font: + - file: "gfonts://Roboto" + id: roboto_20 + size: 20 + - file: "gfonts://Roboto" + id: roboto_10 + size: 10 + +lvgl: + buffer_size: 25% + theme: + button: + bg_color: 0x2F8CD8 + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_color: 0x0077b3 + border_width: 1 + text_color: 0xFFFFFF + pressed: # set some button colors to be different in pressed state + bg_color: 0x006699 + bg_grad_color: 0x00334d + checked: # set some button colors to be different in checked state + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + text_color: 0xfff300 + buttonmatrix: + bg_opa: TRANSP + border_color: 0x0077b3 + border_width: 0 + text_color: 0xFFFFFF + pad_all: 0 + items: # set all your buttonmatrix buttons to use your custom defined styles and font + bg_color: 0x2F8CD8 + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_color: 0x0077b3 + border_width: 1 + text_color: 0xFFFFFF + pressed: + bg_color: 0x006699 + bg_grad_color: 0x00334d + checked: + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + text_color: 0xFFFFA0 + switch: + bg_color: 0xC0C0C0 + bg_grad_color: 0xb0b0b0 + bg_grad_dir: VER + bg_opa: COVER + checked: + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + bg_grad_dir: VER + bg_opa: COVER + knob: + bg_color: 0xFFFFFF + bg_grad_color: 0xC0C0C0 + bg_grad_dir: VER + bg_opa: COVER + slider: + border_width: 1 + border_opa: 15% + bg_color: 0xcccaca + bg_opa: 15% + indicator: + bg_color: 0x1d5f96 + bg_grad_color: 0x03324A + bg_grad_dir: VER + bg_opa: COVER + knob: + bg_color: 0x2F8CD8 + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_color: 0x0077b3 + border_width: 1 + text_color: 0xFFFFFF + style_definitions: + - id: header_footer + bg_color: 0x2F8CD8 + bg_grad_color: 0x005782 + bg_grad_dir: VER + bg_opa: COVER + border_opa: TRANSP + radius: 0 + pad_all: 0 + pad_row: 0 + pad_column: 0 + border_color: 0x0077b3 + text_color: 0xFFFFFF + width: 100% + height: 30 + top_layer: + widgets: + - label: + id: wifiStatusIcon + x: 210 + y: 5 + text: "\uF1EB" + state: + disabled: true + recolor: false + text_color: white + hidden: true + - label: + id: haStatusIcon + x: 190 + y: 5 + text: "\uF015" + state: + disabled: true + recolor: false + text_color: white + hidden: true + - buttonmatrix: + align: bottom_mid + id: navbar_bottom + styles: header_footer + pad_all: 0 + outline_width: 0 + items: + styles: header_footer + rows: + - buttons: + - id: page_prev + text: "\uF053" + on_press: + then: + lvgl.page.previous: + animation: OUT_RIGHT + time: 300ms + - id: page_home + text: "\uF015" + on_press: + then: + lvgl.page.show: + id: main_page + animation: FADE_IN + time: 300ms + - id: page_next + text: "\uF054" + on_press: + then: + lvgl.page.next: + animation: OUT_LEFT + time: 300ms + pages: + - id: main_page + widgets: + - obj: + align: TOP_MID + id: header_page_main + styles: header_footer + widgets: + - label: + text: "Ade's Office" + align: CENTER + text_align: CENTER + text_color: 0xFFFFFF + - buttonmatrix: + id: matrixId + x: 10 + y: 45 + width: 220 + height: 220 + items: + pressed: + bg_color: 0xFFFF00 + rows: + - buttons: + - id: buttonLights + text: "Lights" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: adesOfficeCeiling + else: + - switch.turn_off: adesOfficeCeiling + - id: buttonDesk + text: "Desk" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: adesDeskLamp + else: + - switch.turn_off: adesDeskLamp + - buttons: + - id: button3dPrinter + text: "3D Printer" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: k2plus + else: + - switch.turn_off: k2plus + - id: buttonLaser + text: "Laser" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: laserCutter + else: + - switch.turn_off: laserCutter + - buttons: + - id: buttonLab + text: "Lab" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: electronicLab + else: + - switch.turn_off: electronicLab + - id: buttonSoldering + text: "Soldering" + control: + checkable: true + - buttons: + - id: buttonPc + text: "PC" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: switchPc + else: + - switch.turn_off: switchPc + - id: buttonScreens + text: "Monitors" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: switchScreens + else: + - switch.turn_off: switchScreens + - id: ground_floor_page + widgets: + - obj: + align: TOP_MID + id: header_page_ground_floor + styles: header_footer + widgets: + - label: + text: "Ground Floor" + align: CENTER + text_align: CENTER + text_color: 0xFFFFFF + - buttonmatrix: + id: groundFloorMatrix + x: 10 + y: 45 + width: 220 + height: 220 + rows: + - buttons: + - id: buttonTVArea + text: "TV Area" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: livingRoomTVArea + else: + - switch.turn_off: livingRoomTVArea + - id: buttonToilet + text: "Toilet" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: groundFloorToilet + else: + - switch.turn_off: groundFloorToilet + - buttons: + - id: buttonKitchenCeiling + text: "Kitchen" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: kitchenCeiling + else: + - switch.turn_off: kitchenCeiling + - id: buttonKitchenLED + text: "LED Strips" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: kitchenLEDStrips + else: + - switch.turn_off: kitchenLEDStrips + - buttons: + - id: buttonDining + text: "Dining" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: livingRoomDining + else: + - switch.turn_off: livingRoomDining + - id: buttonGarden + text: "Garden" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: outsideGarden + else: + - switch.turn_off: outsideGarden + - buttons: + - id: buttonHall + text: "Hall" + control: + checkable: true + on_value: + then: + - if: + condition: + lambda: 'return x == 1;' + then: + - switch.turn_on: nsPanelRelay + else: + - switch.turn_off: nsPanelRelay + + - id: printer_status + widgets: + - obj: + align: TOP_MID + id: header_page_printerstatus + styles: header_footer + widgets: + - label: + text: "K2 Plus" + align: CENTER + text_align: CENTER + text_color: 0xFFFFFF + - label: + long_mode: scroll + align_to: + id: header_page_printerstatus + align: OUT_BOTTOM_LEFT + y: 3 + x: 2 + id: lbl_3dprinter_status + text: + format: "Status: %s" + args: [ 'id(printerStatus).get_state()' ] + - label: + align_to: + id: lbl_3dprinter_status + align: OUT_BOTTOM_LEFT + y: 3 + id: lbl_3dprinter_percentage + text: + format: "Percentage: %d%%" + args: ['id(sensor_3dprinter_percentage).state'] + - label: + align_to: + id: lbl_3dprinter_percentage + align: OUT_BOTTOM_LEFT + y: 3 + long_mode: scroll + id: lbl_3dprinter_modelname + width: 240 + text: "Model: None" + - label: + align_to: + id: lbl_3dprinter_modelname + align: OUT_BOTTOM_LEFT + y: 3 + long_mode: scroll + id: lbl_3dprinter_layer + width: 240 + text: "Layer: 0 of 0" + - label: + align_to: + id: lbl_3dprinter_layer + align: OUT_BOTTOM_LEFT + y: 3 + long_mode: scroll + id: lbl_3dprinter_print_time_left + width: 240 + text: "Print time left: NaN" + - meter: + id: meter_3dprinter_nozzle + align: BOTTOM_LEFT + y: -35 + x: 5 + height: 110 + width: 110 + scales: + - range_from: 0 # scale for the needle value + range_to: 380 + angle_range: 240 + rotation: 150 + indicators: + - line: + id: gauge_3dprinter_nozzle_needle + width: 2 + color: 0xFF0000 + r_mod: -4 + - range_from: 0 # scale for the value labels + range_to: 380 + angle_range: 240 + rotation: 150 + ticks: + width: 1 + count: 41 + length: 4 + color: 0x000000 + major: + stride: 20 + width: 2 + length: 6 + color: 0x404040 + label_gap: 10 + text_font: roboto_10 + widgets: + - label: + id: gauge_3dprinter_nozzle_text + text: "-.-C" + align_to: + id: meter_3dprinter_nozzle + align: CENTER + y: 35 + - label: + text: "Nozzle" + align_to: + id: meter_3dprinter_nozzle + align: CENTER + y: 45 + - arc: + align: BOTTOM_LEFT + y: -35 + x: 5 + height: 110 + width: 110 + id: arc_nozzle_target + value: !lambda "return id(number_3dprinter_nozzle_target).state;" + min_value: 0 + max_value: 380 + adjustable: true + start_angle: 150 + end_angle: 30 + knob: + pad_all: 0 + arc_rounded: false + arc_width: 6 + on_value: + then: + - homeassistant.service: + service: number.set_value + data: + entity_id: number.k2plus_c06b_nozzle_target + value: !lambda "return x;" + - meter: + id: meter_3dprinter_bed + align: BOTTOM_LEFT + y: -35 + x: 125 + height: 110 + width: 110 + scales: + - range_from: 0 # scale for the needle value + range_to: 130 + angle_range: 240 + rotation: 150 + indicators: + - line: + id: gauge_3dprinter_bed_needle + width: 2 + color: 0xFF0000 + r_mod: -4 + - range_from: 0 # scale for the value labels + range_to: 130 + angle_range: 240 + rotation: 150 + ticks: + width: 1 + count: 41 + length: 4 + color: 0x000000 + major: + stride: 20 + width: 2 + length: 6 + color: 0x404040 + label_gap: 10 + text_font: roboto_10 + widgets: + - label: + id: gauge_3dprinter_bed_text + text: "-.-C" + align_to: + id: meter_3dprinter_bed + align: CENTER + y: 35 + - label: + text: "Plate" + align_to: + id: meter_3dprinter_bed + align: CENTER + y: 45 + - arc: + align: BOTTOM_LEFT + y: -35 + x: 125 + height: 110 + width: 110 + id: arc_bed_target + value: !lambda "return id(number_3dprinter_bed_target).state;" + min_value: 0 + max_value: 130 + adjustable: true + start_angle: 150 + end_angle: 30 + knob: + pad_all: 0 + arc_rounded: false + arc_width: 6 + on_value: + then: + - homeassistant.service: + service: number.set_value + data: + entity_id: number.k2plus_c06b_bed_target + value: !lambda "return x;" + + on_idle: + timeout: !lambda "return (id(displayTimeout).state * 1000);" + then: + - logger.log: "LVGL is idle" + - light.turn_off: backlight + - lvgl.pause: + show_snow: true + +switch: + - platform: homeassistant + id: adesOfficeCeiling + entity_id: light.ade_s_office_ceiling_lights + on_turn_on: + - lvgl.widget.update: + id: buttonLights + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonLights + state: + checked: OFF + + - platform: homeassistant + id: adesDeskLamp + entity_id: light.desklamp_ade + on_turn_on: + - lvgl.widget.update: + id: buttonDesk + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonDesk + state: + checked: OFF + + - platform: homeassistant + id: k2plus + entity_id: switch.creality_k1_max + on_turn_on: + - lvgl.widget.update: + id: button3dPrinter + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: button3dPrinter + state: + checked: OFF + + - platform: homeassistant + id: laserCutter + entity_id: switch.plug5_glowforge + on_turn_on: + - lvgl.widget.update: + id: buttonLaser + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonLaser + state: + checked: OFF + + - platform: homeassistant + id: electronicLab + entity_id: switch.electronics_lab + on_turn_on: + - lvgl.widget.update: + id: buttonLab + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonLab + state: + checked: OFF + + - platform: homeassistant + id: switchPc + entity_id: switch.pc_ade + on_turn_on: + - lvgl.widget.update: + id: buttonPc + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonPc + state: + checked: OFF + + - platform: homeassistant + id: switchScreens + entity_id: switch.officea_4k_monitors + on_turn_on: + - lvgl.widget.update: + id: buttonScreens + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonScreens + state: + checked: OFF + + - platform: homeassistant + id: livingRoomTVArea + entity_id: light.living_room_tv_area_lights + on_turn_on: + - lvgl.widget.update: + id: buttonTVArea + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonTVArea + state: + checked: OFF + + - platform: homeassistant + id: groundFloorToilet + entity_id: light.ground_floor_toilet_wall_lights + on_turn_on: + - lvgl.widget.update: + id: buttonToilet + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonToilet + state: + checked: OFF + + - platform: homeassistant + id: kitchenCeiling + entity_id: light.kitchen_ceiling_light + on_turn_on: + - lvgl.widget.update: + id: buttonKitchenCeiling + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonKitchenCeiling + state: + checked: OFF + + - platform: homeassistant + id: kitchenLEDStrips + entity_id: light.kitchen_led_strips + on_turn_on: + - lvgl.widget.update: + id: buttonKitchenLED + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonKitchenLED + state: + checked: OFF + + - platform: homeassistant + id: livingRoomDining + entity_id: light.living_room_dining_area + on_turn_on: + - lvgl.widget.update: + id: buttonDining + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonDining + state: + checked: OFF + + - platform: homeassistant + id: outsideGarden + entity_id: light.outside_garden_floodlight + on_turn_on: + - lvgl.widget.update: + id: buttonGarden + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonGarden + state: + checked: OFF + + - platform: homeassistant + id: nsPanelRelay + entity_id: light.ns_panel_ground_floor_relay_1 + on_turn_on: + - lvgl.widget.update: + id: buttonHall + state: + checked: ON + on_turn_off: + - lvgl.widget.update: + id: buttonHall + state: + checked: OFF + diff --git a/ades-office-control-panel/main.yaml b/ades-office-resistive-control-panel.yaml similarity index 81% rename from ades-office-control-panel/main.yaml rename to ades-office-resistive-control-panel.yaml index 3cc7c68..90f548b 100644 --- a/ades-office-control-panel/main.yaml +++ b/ades-office-resistive-control-panel.yaml @@ -1,89 +1,17 @@ -substitutions: - device_name: "ades-office-control-panel" - friendly_name: Ade's Office Control Panel - esphome: - name: $device_name - friendly_name: $friendly_name - on_boot: - - delay: 2s + name: adesoffice_resistive_control + friendly_name: Ade's office Resistive control panel esp32: board: esp32dev framework: type: arduino + logger: -ota: - platform: esphome - password: !secret ota_password - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - fast_connect: true - on_connect: - - lvgl.widget.show: wifiStatusIcon - on_disconnect: - - lvgl.widget.hide: wifiStatusIcon - - -light: - - platform: monochromatic - output: backlight_pwm - name: Display Backlight - id: backlight - restore_mode: ALWAYS_ON - -time: - - platform: homeassistant - id: esptime - -spi: - - id: tft - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 - -i2c: - sda: GPIO33 - scl: GPIO32 - -touchscreen: - platform: cst816 - id: my_touchscreen - display: mainDisplay - reset_pin: GPIO25 - update_interval: 50ms - transform: - mirror_x: true - mirror_y: true - on_touch: - - lambda: |- - ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d", - touch.x, - touch.y, - touch.x_raw, - touch.y_raw - ); - on_release: - then: - - if: - condition: lvgl.is_paused - then: - - logger.log: "LVGL resuming" - - lvgl.resume: - - lvgl.widget.redraw: - - light.turn_on: backlight - -output: - - platform: ledc - pin: GPIO27 - id: backlight_pwm - api: encryption: - key: "FdLcYGMsxFkCFoY8UUu0q/huDesKrcy4+vNQujhbXVE=" + key: "yDySAAGJIQIgZcDURBrLtWiVYNteCm155yyZUnrMjZY=" on_client_connected: - lvgl.widget.show: haStatusIcon on_client_disconnected: @@ -94,11 +22,152 @@ api: - lvgl.widget.show: haStatusIcon else: - lvgl.widget.hide: haStatusIcon + + +ota: + - platform: esphome + password: !secret ota_password + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + on_connect: + - lvgl.widget.show: wifiStatusIcon + on_disconnect: + - lvgl.widget.hide: wifiStatusIcon + +i2c: + sda: 27 + scl: 22 + scan: true + +spi: + - id: tft + clk_pin: 14 + mosi_pin: 13 + miso_pin: + number: 12 + ignore_strapping_warning: true + - id: touch + clk_pin: 25 + mosi_pin: 32 + miso_pin: 39 + +output: + - id: backlightPwm + platform: ledc + pin: 21 + - id: outputRed + platform: ledc + pin: 4 + inverted: true + - id: outputGreen + platform: ledc + pin: 16 + inverted: true + - id: outputBlue + platform: ledc + pin: 17 + inverted: true + +light: + - id: backlight + platform: monochromatic + output: backlightPwm + name: "Display Backlight" + restore_mode: ALWAYS_ON + - id: rgbLed + platform: rgb + red: outputRed + green: outputGreen + blue: outputBlue + name: "RGB LED" + restore_mode: ALWAYS_OFF + +sensor: + - platform: adc + pin: 34 + name: "Brightness" + update_interval: 60s + id: lsr + - platform: homeassistant + entity_id: sensor.k1max_progress + id: sensor_3dprinter_percentage + on_value: + then: + - lvgl.label.update: + id: lbl_3dprinter_percentage + text: + format: "Percentage: %.0f%%" + args: [x] + - platform: homeassistant + entity_id: sensor.k1max_extruder_temperature + id: sensor_3dprinter_nozzle + on_value: + then: + - lvgl.indicator.update: + id: gauge_3dprinter_nozzle_needle + value: !lambda return x; + - lvgl.label.update: + id: gauge_3dprinter_nozzle_text + text: + format: "%.0f°C" + args: [ 'x' ] + - platform: homeassistant + entity_id: sensor.k1max_bed_temperature_2 + id: sensor_3dprinter_bed + on_value: + then: + - lvgl.indicator.update: + id: gauge_3dprinter_bed_needle + value: !lambda return x; + - lvgl.label.update: + id: gauge_3dprinter_bed_text + text: + format: "%.0f°C" + args: [ 'x' ] + +text_sensor: + - platform: homeassistant + entity_id: sensor.k1max_current_print_state + id: printerStatus + on_value: + then: + - if: + condition: + lambda: 'return x == "printing";' + then: + - lvgl.widget.update: + id: button3dPrinter + state: + disabled: ON + else: + - lvgl.widget.update: + id: button3dPrinter + state: + disabled: OFF + - lvgl.label.update: + id: lbl_3dprinter_status + text: + format: "Status: %s" + args: [x.c_str()] + - platform: homeassistant + entity_id: sensor.k1max_filename + id: printer_modelname + on_value: + then: + - lvgl.label.update: + id: lbl_3dprinter_modelname + text: + format: "Model: %s" + args: [x.c_str()] + + display: - id: mainDisplay platform: ili9xxx - model: ili9341 + model: ILI9341 spi_id: tft cs_pin: number: 15 @@ -109,15 +178,8 @@ display: invert_colors: false update_interval: never auto_clear_enabled: false - pixel_mode: 16bit transform: mirror_y: true - mirror_x: true - swap_xy: false - dimensions: - height: 320 - width: 240 - color_order: rgb init_sequence: - [0x01 ] - [0xcf, 0x00, 0xC1, 0x30 ] @@ -142,119 +204,31 @@ display: - [0x11 ] # SLPOUT Exit sleep - [0x29 ] # DISPLAY_ON -sensor: - - platform: adc - pin: 34 - name: "Brightness" - update_interval: 60s - id: lsr - - platform: homeassistant - entity_id: sensor.k2plus_c06b_print_progress - id: sensor_3dprinter_percentage - on_value: - then: - - lvgl.label.update: - id: lbl_3dprinter_percentage - text: - format: "Percentage: %.0f%%" - args: [x] - - platform: homeassistant - entity_id: sensor.k2plus_c06b_nozzle_temperature - id: sensor_3dprinter_nozzle - on_value: - then: - - lvgl.indicator.update: - id: gauge_3dprinter_nozzle_needle - value: !lambda return x; - - lvgl.label.update: - id: gauge_3dprinter_nozzle_text - text: - format: "%.0fC" - args: [ 'x' ] - - platform: homeassistant - entity_id: number.k2plus_c06b_nozzle_target - id: number_3dprinter_nozzle_target - on_value: - then: - - lvgl.arc.update: - id: arc_nozzle_target - value: !lambda return x; - - platform: homeassistant - entity_id: sensor.k2plus_c06b_bed_temperature - id: sensor_3dprinter_bed - on_value: - then: - - lvgl.indicator.update: - id: gauge_3dprinter_bed_needle - value: !lambda return x; - - lvgl.label.update: - id: gauge_3dprinter_bed_text - text: - format: "%.0fC" - args: [ 'x' ] - - platform: homeassistant - entity_id: number.k2plus_c06b_bed_target - id: number_3dprinter_bed_target - on_value: - then: - - lvgl.arc.update: - id: arc_bed_target - value: !lambda return x; +touchscreen: + platform: xpt2046 + id: mainTouchscreen + spi_id: touch + cs_pin: 33 + interrupt_pin: 36 + threshold: 800 + calibration: + x_min: 410 + x_max: 3349 + y_min: 179 + y_max: 3958 + on_release: + then: + - if: + condition: lvgl.is_paused + then: + - logger.log: "LVGL resuming" + - lvgl.resume: + - lvgl.widget.redraw: + - light.turn_on: backlight + transform: + mirror_x: false + mirror_y: true -text_sensor: - - platform: homeassistant - entity_id: sensor.k2plus_c06b_print_status - id: printerStatus - on_value: - then: - - if: - condition: - lambda: 'return x == "printing";' - then: - - lvgl.widget.update: - id: button3dPrinter - state: - disabled: ON - else: - - lvgl.widget.update: - id: button3dPrinter - state: - disabled: OFF - - lvgl.label.update: - id: lbl_3dprinter_status - text: - format: "Status: %s" - args: [x.c_str()] - - platform: homeassistant - entity_id: sensor.k2plus_c06b_current_object - id: printer_modelname - on_value: - then: - - lvgl.label.update: - id: lbl_3dprinter_modelname - text: - format: "Model: %s" - args: [x.c_str()] - - platform: homeassistant - entity_id: sensor.k2plus_c06b_working_layer - id: printer_working_layer - on_value: - then: - - lvgl.label.update: - id: lbl_3dprinter_layer - text: - format: "Layer: %s" - args: [x.c_str()] - - platform: homeassistant - entity_id: sensor.k2plus_c06b_print_time_left - id: printer_print_time_left - on_value: - then: - - lvgl.label.update: - id: lbl_3dprinter_print_time_left - text: - format: "Time remaining: %s" - args: [x.c_str()] number: - platform: template name: "LVGL Screen Timeout" @@ -601,24 +575,6 @@ lvgl: id: lbl_3dprinter_modelname width: 240 text: "Model: None" - - label: - align_to: - id: lbl_3dprinter_modelname - align: OUT_BOTTOM_LEFT - y: 3 - long_mode: scroll - id: lbl_3dprinter_layer - width: 240 - text: "Layer: 0 of 0" - - label: - align_to: - id: lbl_3dprinter_layer - align: OUT_BOTTOM_LEFT - y: 3 - long_mode: scroll - id: lbl_3dprinter_print_time_left - width: 240 - text: "Print time left: NaN" - meter: id: meter_3dprinter_nozzle align: BOTTOM_LEFT @@ -637,6 +593,12 @@ lvgl: width: 2 color: 0xFF0000 r_mod: -4 + - tick_style: + start_value: 0 + end_value: 380 + color_start: 0x0000bd + color_end: 0xbd0000 + width: 1 - range_from: 0 # scale for the value labels range_to: 380 angle_range: 240 @@ -656,7 +618,7 @@ lvgl: widgets: - label: id: gauge_3dprinter_nozzle_text - text: "-.-C" + text: "-.-°C" align_to: id: meter_3dprinter_nozzle align: CENTER @@ -667,30 +629,6 @@ lvgl: id: meter_3dprinter_nozzle align: CENTER y: 45 - - arc: - align: BOTTOM_LEFT - y: -35 - x: 5 - height: 110 - width: 110 - id: arc_nozzle_target - value: !lambda "return id(number_3dprinter_nozzle_target).state;" - min_value: 0 - max_value: 380 - adjustable: true - start_angle: 150 - end_angle: 30 - knob: - pad_all: 0 - arc_rounded: false - arc_width: 6 - on_value: - then: - - homeassistant.service: - service: number.set_value - data: - entity_id: number.k2plus_c06b_nozzle_target - value: !lambda "return x;" - meter: id: meter_3dprinter_bed align: BOTTOM_LEFT @@ -709,6 +647,12 @@ lvgl: width: 2 color: 0xFF0000 r_mod: -4 + - tick_style: + start_value: 0 + end_value: 130 + color_start: 0x0000bd + color_end: 0xbd0000 + width: 1 - range_from: 0 # scale for the value labels range_to: 130 angle_range: 240 @@ -728,41 +672,17 @@ lvgl: widgets: - label: id: gauge_3dprinter_bed_text - text: "-.-C" + text: "-.-°C" align_to: id: meter_3dprinter_bed align: CENTER y: 35 - label: text: "Plate" - align_to: + align_to: id: meter_3dprinter_bed align: CENTER y: 45 - - arc: - align: BOTTOM_LEFT - y: -35 - x: 125 - height: 110 - width: 110 - id: arc_bed_target - value: !lambda "return id(number_3dprinter_bed_target).state;" - min_value: 0 - max_value: 130 - adjustable: true - start_angle: 150 - end_angle: 30 - knob: - pad_all: 0 - arc_rounded: false - arc_width: 6 - on_value: - then: - - homeassistant.service: - service: number.set_value - data: - entity_id: number.k2plus_c06b_bed_target - value: !lambda "return x;" on_idle: @@ -871,4 +791,3 @@ switch: id: buttonScreens state: checked: OFF - diff --git a/ns-panel-ground-floor.yaml b/ns-panel-ground-floor.yaml new file mode 100644 index 0000000..6d845c0 --- /dev/null +++ b/ns-panel-ground-floor.yaml @@ -0,0 +1,45 @@ +substitutions: + # Settings - Editable values + device_name: ns-panel-ground-floor + wifi_ssid: !secret wifi_ssid + wifi_password: !secret wifi_password + nextion_update_url: "http://192.168.17.44:8123/local/nspanel_eu.tft" # Optional for `esp-idf` framework + # Add-on configuration (if needed) + # heater_relay: "1" # Possible values: "1" or "2" + +api: + encryption: + key: "DVkkntEil08ex4e7xjnKTz4o2z/ZM/UHnkjOJP7KUfA=" +# Customization area +##### My customization - Start ##### +##### My customization - End ##### + +# Core and optional configurations +packages: + remote_package: + url: https://github.com/Blackymas/NSPanel_HA_Blueprint + ref: main + files: + - nspanel_esphome.yaml # Core package + # Optional advanced and add-on configurations + # - advanced/esphome/nspanel_esphome_advanced.yaml + # - nspanel_esphome_addon_climate_cool.yaml + # - nspanel_esphome_addon_climate_heat.yaml + # - nspanel_esphome_addon_climate_dual.yaml + refresh: 300s + +esp32: + framework: + type: esp-idf + +time: + - id: !extend time_provider + timezone: "Europe/Berlin" + +wifi: + networks: + - id: !extend wifi_default + manual_ip: + static_ip: 192.168.17.139 + gateway: 192.168.17.1 + subnet: 255.255.255.0 \ No newline at end of file diff --git a/oekoboiler-interface.yaml b/oekoboiler-interface.yaml new file mode 100644 index 0000000..309e0b7 --- /dev/null +++ b/oekoboiler-interface.yaml @@ -0,0 +1,634 @@ +esphome: + name: oekoboiler-interface + friendly_name: Oekoboiler-Interface + +esp8266: + board: nodemcuv2 + + +# Enable logging +logger: + baud_rate: 0 + +# Enable Home Assistant API +api: + encryption: + key: !secret oekoboiler_encryptionkey + reboot_timeout: 0s + +ota: + - platform: esphome + password: !secret oekoboiler_otapassword + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + power_save_mode: none # Disable power saving + fast_connect: true # Skip scanning, connect faster + reboot_timeout: 0s # Disable auto-reboot on wifi loss + + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Oekoboiler-Interface" + password: !secret oekoboiler_fallbackpassword + +captive_portal: + +#web_server: +# port: 80 + +# UART configuration for Modbus (0-based register addressing) +uart: + id: mod_bus + tx_pin: GPIO1 # D10/TX + rx_pin: GPIO3 # D9/RX + baud_rate: 9600 + stop_bits: 1 + data_bits: 8 + parity: NONE + +# Modbus RTU +modbus: + flow_control_pin: GPIO5 # D1 - DE/RE pin for MAX485 + id: modbus1 + send_wait_time: 200ms + +modbus_controller: + - id: oekoboiler + address: 0x1 + modbus_id: modbus1 + setup_priority: -10 + update_interval: 10s + command_throttle: 200ms + +sensor: + # WiFi Signal + - platform: wifi_signal + name: "WiFi Signal" + update_interval: 60s + + # Uptime + - platform: uptime + name: "Uptime" + update_interval: 60s + + # ======================================== + # INPUT REGISTERS (3x) - Documentation address MINUS 1 + # ======================================== + + # A1 - Water Temperature (30001 -> 0) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Water Temperature" + address: 0 + register_type: read + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + accuracy_decimals: 1 + filters: + - multiply: 0.1 + + # A2 - Evaporator Temperature (30002 -> 1) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Evaporator Temperature" + address: 1 + register_type: read + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + accuracy_decimals: 1 + filters: + - multiply: 0.1 + + # A4 - Ambient Temperature (30003 -> 2) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Ambient Temperature" + address: 2 + register_type: read + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + accuracy_decimals: 1 + filters: + - multiply: 0.1 + + # A3 - Exhaust Temperature (30004 -> 3) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Exhaust Temperature" + address: 3 + register_type: read + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + accuracy_decimals: 1 + filters: + - multiply: 0.1 + + # A9 - Return Gas Temperature (30005 -> 4) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Return Gas Temperature" + address: 4 + register_type: read + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + state_class: measurement + accuracy_decimals: 1 + filters: + - multiply: 0.1 + + # ======================================== + # HOLDING REGISTERS (4x) - Read-only values + # ======================================== + + # Controller Status (41102 -> 1101) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Controller Status Raw" + id: controller_status_raw + address: 1101 + register_type: holding + value_type: U_WORD + internal: true + + # Operating Mode (41105 -> 1104) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Mode Raw" + id: mode_raw + address: 1104 + register_type: holding + value_type: U_WORD + internal: true + + # Econ Mode Time Window (41106 -> 1105) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Econ Mode Time Window" + address: 1105 + register_type: holding + value_type: U_WORD + skip_updates: 4 + + # Alarm sensors (41121-41133 -> 1120-1132) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A1 Sensor" + address: 1120 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a1 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A2 Sensor" + address: 1121 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a2 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A3 Sensor" + address: 1122 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a3 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A6 Sensor" + address: 1125 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a6 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A5 High Pressure" + address: 1126 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a5 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A4 Sensor" + address: 1127 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a4 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Water Temp Warning 55C" + address: 1128 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_water_temp + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A9 Sensor" + address: 1129 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a9 + + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Alarm A8 Condensate" + address: 1130 + register_type: holding + value_type: U_WORD + internal: true + id: alarm_a8 + +binary_sensor: + - platform: status + name: "Connection Status" + + # ======================================== + # COILS (0x) - Documentation address MINUS 1 + # ======================================== + + # Compressor (00001 -> 0) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Compressor Running" + address: 1 + register_type: coil + device_class: running + + # Heating Element (00002 -> 1) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Heating Element" + address: 2 + register_type: coil + device_class: heat + + # Fan (00004 -> 3) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Four-Way Valve" + address: 3 + register_type: coil + device_class: running + + # Fan (00004 -> 3) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Fan Running" + address: 4 + register_type: coil + device_class: running + + # ======================================== + # DISCRETE INPUTS (1x) - Documentation address MINUS 1 + # ======================================== + + + # Template binary sensors for alarms + - platform: template + name: "Alarm: A1 Water Temp Sensor" + device_class: problem + lambda: |- + return id(alarm_a1).state != 0; + + - platform: template + name: "Alarm: A2 Evaporator Sensor" + device_class: problem + lambda: |- + return id(alarm_a2).state != 0; + + - platform: template + name: "Alarm: A3 Ambient Sensor" + device_class: problem + lambda: |- + return id(alarm_a3).state != 0; + + - platform: template + name: "Alarm: A6 Heating Element" + device_class: problem + lambda: |- + return id(alarm_a6).state != 0; + + - platform: template + name: "Alarm: A5 High Pressure" + device_class: problem + lambda: |- + return id(alarm_a5).state != 0; + + - platform: template + name: "Alarm: A4 Exhaust Sensor" + device_class: problem + lambda: |- + return id(alarm_a4).state != 0; + + - platform: template + name: "Warning: Water Temperature 55°C" + device_class: problem + lambda: |- + return id(alarm_water_temp).state != 0; + + - platform: template + name: "Alarm: A9 Return Gas Sensor" + device_class: problem + lambda: |- + return id(alarm_a9).state != 0; + + - platform: template + name: "Alarm: A8 Condensate Overflow" + device_class: problem + lambda: |- + return id(alarm_a8).state != 0; + +text_sensor: + - platform: template + name: "Controller Status" + lambda: |- + int status = (int)id(controller_status_raw).state; + switch(status) { + case 0: return {"Power Off"}; + case 1: return {"Standby"}; + case 2: return {"Preheating"}; + case 3: return {"Heating"}; + case 4: return {"Before Defrost"}; + case 5: return {"Defrosting"}; + case 6: return {"After Defrost"}; + case 8: return {"Alarm"}; + default: return {"Unknown (" + to_string(status) + ")"}; + } + + - platform: template + name: "Operating Mode" + lambda: |- + int mode = (int)id(mode_raw).state; + switch(mode) { + case 0: return {"Econ Mode"}; + case 1: return {"Auto Mode"}; + case 2: return {"Heater Mode"}; + default: return {"Unknown (" + to_string(mode) + ")"}; + } + +switch: + # ======================================== + # WRITABLE HOLDING REGISTERS - Switches + # ======================================== + + # PV Mode (40067 -> 66) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "PV Mode" + address: 66 + register_type: holding + bitmask: 1 + entity_category: config + icon: "mdi:solar-power" + + # Heating Element Enable (40015 -> 14) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Heating Element Enable" + address: 14 + register_type: holding + bitmask: 1 + entity_category: config + icon: "mdi:heating-coil" + + # Heating Element for Sterilization (40017 -> 16) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Sterilization Enable" + address: 16 + register_type: holding + bitmask: 1 + entity_category: config + icon: "mdi:bacteria" + + # Heating Element in Econ Mode (40028 -> 27) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Heating Element in Econ Mode" + address: 27 + register_type: holding + bitmask: 1 + entity_category: config + + # Heat Pump in Heater Mode (40029 -> 28) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Heat Pump in Heater Mode" + address: 28 + register_type: holding + bitmask: 1 + entity_category: config + + # Save Status on Power Off (40061 -> 60) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Save Status on Power Off" + address: 60 + register_type: holding + bitmask: 1 + entity_category: config + + # Electronic Anode (40068 -> 67) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Electronic Anode" + address: 67 + register_type: holding + bitmask: 1 + entity_category: config + +number: + # ======================================== + # WRITABLE HOLDING REGISTERS - Numbers + # ======================================== + + # Set Temperature PV (40009 -> 8) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Target Temperature (PV Mode)" + address: 8 + value_type: U_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: 5 + max_value: 70 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + icon: "mdi:solar-power" + + # Set Temperature Normal (40010 -> 9) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Target Temperature (Normal)" + address: 9 + value_type: U_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: 5 + max_value: 70 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Set Temperature F62=0 (40011 -> 10) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Target Temperature (F62=0)" + address: 10 + value_type: U_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: 5 + max_value: 70 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Temperature Delta/Hysteresis (40012 -> 11) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Temperature Hysteresis" + address: 11 + value_type: U_WORD + unit_of_measurement: "°C" + min_value: 1 + max_value: 20 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + icon: "mdi:thermometer-lines" + + # Ambient Temperature Shutdown (40013 -> 12) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Heat Pump Shutdown Temperature" + address: 12 + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: -10 + max_value: 5 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Maximum Temperature with Heat Pump (40014 -> 13) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Max Temperature Heat Pump" + address: 13 + value_type: U_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: 20 + max_value: 60 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Ambient Temperature for Heating Element Start (40016 -> 15) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Heating Element Start Temperature" + address: 15 + value_type: U_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: 10 + max_value: 20 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Sterilization Cycle (40018 -> 17) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Sterilization Cycle Hours" + address: 17 + value_type: U_WORD + unit_of_measurement: "h" + min_value: 1 + max_value: 990 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + icon: "mdi:bacteria" + + # A1 Temperature Sensor Offset (40019 -> 18) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "A1 Sensor Offset" + address: 18 + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: -5 + max_value: 5 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Compressor Delay (40021 -> 20) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Compressor Delay" + address: 20 + value_type: U_WORD + unit_of_measurement: "min" + min_value: 0 + max_value: 10 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Defrost Start Temperature (40031 -> 30) + - platform: modbus_controller + modbus_controller_id: oekoboiler + name: "Defrost Start Temperature" + address: 30 + value_type: S_WORD + unit_of_measurement: "°C" + device_class: temperature + min_value: -20 + max_value: 20 + step: 1 + mode: box + use_write_multiple: true + entity_category: config + + # Defrost End Temperature (40032 \ No newline at end of file diff --git a/Oekoboiler/main.yaml b/oekoboiler.yaml similarity index 100% rename from Oekoboiler/main.yaml rename to oekoboiler.yaml diff --git a/Old_Phone_Doorbell/main.yaml b/old-phone-doorbell.yaml similarity index 99% rename from Old_Phone_Doorbell/main.yaml rename to old-phone-doorbell.yaml index 6a4ade8..e2d1beb 100644 --- a/Old_Phone_Doorbell/main.yaml +++ b/old-phone-doorbell.yaml @@ -147,5 +147,4 @@ script: - output.turn_off: h_bridge_enable logger: - level: DEBUG - + level: DEBUG \ No newline at end of file diff --git a/powermeter.yaml b/powermeter.yaml new file mode 100644 index 0000000..7591371 --- /dev/null +++ b/powermeter.yaml @@ -0,0 +1,77 @@ +esphome: + name: powermeter + friendly_name: PowerMeter + +esp8266: + board: esp01_1m + +# Enable logging +logger: + +web_server: + port: 80 + +# Enable Home Assistant API +api: + encryption: + key: "sRMMr/ojhCUtZukAFSRT/fZpvI0bcTPHAqs0CzXY/q0=" + +ota: + - platform: esphome + password: "8383401f9c2ff3b99a166c2782307e8b" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + manual_ip: + static_ip: 192.168.20.152 + gateway: 192.168.20.1 + subnet: 255.255.255.0 + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Powermeter Fallback Hotspot" + password: "kmSJk2j8Lpak" + +captive_portal: + +sensor: + - platform: pulse_meter + name: 'Power' + id: sensor_pulse_meter # Optional ID, necessary if you want to calculate the total daily energy + unit_of_measurement: 'W' + device_class: power + state_class: measurement + accuracy_decimals: 0 + internal_filter: 100ms + pin: + number: 12 + inverted: true + mode: + input: true + pullup: true + filters: + - multiply: 60 + total: + name: "Electricity Total" + unit_of_measurement: "kWh" + device_class: energy + state_class: total_increasing + accuracy_decimals: 3 + filters: + - multiply: 0.001 + - platform: total_daily_energy + name: 'Total Daily Energy' + id: sensor_total_daily_energy + power_id: sensor_pulse_meter + unit_of_measurement: 'kWh' + state_class: total_increasing + device_class: energy + accuracy_decimals: 3 + filters: + # Multiplication factor from W to kW is 0.001 + - multiply: 0.001 + +time: + - platform: homeassistant + id: homeassistant_time \ No newline at end of file