GithubHelp home page GithubHelp logo

dentra / esphome-ewh Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 8.0 302 KB

Control Electrolux Water Heater via uart

License: MIT License

Dockerfile 0.20% Shell 1.00% Python 11.98% C++ 74.16% C 12.66%
electrolux uart ballu esphome esphome-component uart-protocol iot zanussi water-heater boiler

esphome-ewh's Introduction

Electrolux Water Heater

License ESPHome release Open in Visual Studio Code Community Forum Support author Support author PayPal.Me

This is a ESPHome component to control Electrolux Water Heater (EWH), Ballu (BWH) and possibly Zanussi (ZWH) boilers using uart protocol.

Control is possible via custom dongle. You can make it yourself or buy a ready made. For example you can try Lilygo T-Dongle S3, the easest way is to do this is on Aliexpress. Or look at fully opensource iot-uni-dongle.

The communucation uart protocol is 100% reversed for EWH and partially for BWH. It is fully described at reverse.md file.

At this moment the componet is build using climate platform and allows the following:

  • Control current temperature
  • Change target boil temperature
  • Change boil power to 700W (EWH only)
  • Change boil power to 1300W
  • Change boil power to 2000W
  • Change BST (Bacteria Stop technology) mode (EWH only, for BWH need help for reverse)
  • Sync and control internal clock (EWH only)
  • Set and start internal timer (EWH only)
  • Enter to "No Frost/Atifreeze" mode (EWH only)

Caution

⚠️ WARNING: Everything you do is done entirely at your own peril and risk!

Build ESPHome firmware

You can download and use example configurations for EWH and BWH for ZWH try EWH or BWH instead.

Sample configuration:

substitutions:
  # main prefix for all entities
  name: "Water Heater"
  # name of your node
  node_name: "water-heater"
  # use "esp32-s3-devkitc-1" for Lilygo T-Dongle S3, "esp12e" for iot-uni-dongle,
  # "esp8285" for coolrf-heatstick, or your own if you know it
  board: "esp12e"
  # time platform: "sntp" or "homeassistant"
  time_platform: "sntp"
  # SSID of your wifi
  wifi_ssid: !secret wifi_ssid
  # password of your wifi
  wifi_password: !secret wifi_password
  # password for fallback wifi hotspot
  wifi_ap_password: !secret wifi_ap_password
  # version of ewh
  project_version: "master"
  # UART configuration.
  tx_pin: GPIO19 # use TX for iot-uni-dongle or coolrf-heatstick
  rx_pin: GPIO20 # use RX for iot-uni-dongle or coolrf-heatstick

# please do not change packeages order it is very important, just comment/uncomment
packages:
  remote:
    url: https://github.com/dentra/esphome-ewh
    ref: master # cant use substitutions here
    files:
      ## Enable additional WiFi signal sensor. Comment next line to disable.
      - packages/wifi_signal.yaml
      ## Enable additional Uptime sensor. Comment next line to disable.
      - packages/uptime.yaml
      ## Uncomment next line to enable additional restart button.
      - packages/restart.yaml
      ## Uncomment next line to enable additional diagnostic clock sensor
      # - packages/clock.yaml
      ## Uncomment next line to enable additional diagnostic timer sensor
      # - packages/timer.yaml
      ## Uncomment next line to enable standalone web ui
      # - packages/ewh_web.yaml
      ## optional package, uncomment next line to enable experimental cloud support
      # - packages/cloud.yaml
      # Required package, do not comment
      - packages/base.yaml
      # Required package, replace with esp32.yaml/esp8266.yaml if you use ESP32/ESP8266
      - packages/esp32_s3.yaml

Expiremental cloud support

Please see instructions here.

Help needed

When the water is heated to the required temperature, the boiler can enter to an idle mode (display shows 0 and temperature) but unfortunally I can't get this state yet. Obtaining this state will allow to make energy calculation. If you know the command that can be sent to the boiler to get this state or even grab internal boiler firmware binary - it will be superior. Please let me know it.

Your thanks

If this project was useful to you, you can buy me a Cup of coffee via Card2Card or PayPal :)

esphome-ewh's People

Contributors

dentra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

esphome-ewh's Issues

Cyclic reboot of the s3 dongle after flashing

After flashing using ESPHome version 2023.12 and the config from the example, s3 dongle starts to reboot cyclically. An error appears in the esp flasher logs: "[11: 27: 13]invalid header: 0xffffffff".
Here is the configuration I used:

substitutions:
  friendly_name: "Water Heater"
  node_name: "water-heater"
  board: "esp32-s3-devkitc-1"
  time_platform: "sntp"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  wifi_ap_password: !secret wifi_ap_password
  tx_pin: GPIO19
  rx_pin: GPIO20 
packages:
  remote:
    url: https://github.com/dentra/esphome-ewh
    ref: master 
    files:
      - packages/uptime.yaml
      - packages/restart.yaml
      - packages/base.yaml
      - packages/esp32.yaml
time:
  platform: sntp

api:
  encryption:
    key: "ХХХ"

ota:
  password: "ХХХ"

  ssid: $wifi_ssid
  password: $wifi_password

logger:
uart:
  tx_pin: $tx_pin
  rx_pin: $rx_pin
  baud_rate: 9600

vport:
  - platform: ewh

climate:
  - platform: ewh
    id: whc
    name: None 
    bst:
      name: "BST"

Ballu SMART WiFi DRY+ support

Hello!
For first thanks for your works!
I tried you component with Ballu BWH/S 50 Smart WiFi DRY+.
But for first I got 'Invalid packet size'.
As i saw in logs, Ballu use only 8 bytes in status message.
I tried to remove ewh_bst_t bst; from struct ewh_status_t.
And it look works good, I can turn on/off, get current temp and set target temp.

Ballu SMART WiFi DRY+ has less function than Electrolux EWH Centurio IQ:

  • no clock
  • no timer
  • no Bacteria Stop Technology
  • display only one temperature simultaneously
  • hardware switch for power level ( i think software control impossible)

My thoughts about status message from Ballu:
1st byte - State - 0 OFF , 2 ON (not depend on position of power level switch)
2nd byte - current temp
3rd byte - target temp
4th byte - always 0
5th byte - always 0
6th byte - always 4
7th byte - always 0
8th byte - always 0

Температура нагрева 255

Иногда температура нагрева устанавливается в 255 градусов (FF?) из-за чего бойлер перегревается и срабатывает термореле.
После физического сброса термореле, температура воды в бойлере 91 градус.
Есть возможность добавить проверку и сбрасывать температуру до 75 градусов, если она больше 75?

Supported water heater

Tested this firmware on ZANUSSI ZWH/S ARTENDO PRO-C Wi-Fi. Everything works great!
For my wi-fi dongle (not Dudanov's iot-uni-dongle) swaping RX and TX pins in configuration was needed.
If your dongle does not receive any information from your water heater try changing ewh-pkg-ewh.yaml. In my case I've replaced
uart:
tx_pin: TX
rx_pin: RX
baud_rate: 9600

with

uart:
tx_pin: 3
rx_pin: 1
baud_rate: 9600

Wrong UART config for Lilygo T-Dongle S3

First of all - thanks for the hard work on the component!

Since Lilygo T-Dongle S3 is the recommended stick it would probably make sense to mention directly in the README that it uses GPIO19 and GPIO20 pins as USB_D+ and USB_D-, so UART confirguartion should be adjusted for it to work:

uart:
tx_pin: 19
rx_pin: 20
baud_rate: 9600

My working yaml config for Lilygo T-Dongle S3 (no display) is as follows:

substitutions:
  name: "water-heater"
  # main prefix for all entities
  friendly_name: Water Heater
  # name of your node
  node_name: "water-heater"
  # use "esp12e" for iot-uni-dongle, "esp8285" for coolrf-heatstick, or your own if you know it
  board: "esp32-s3-devkitc-1"
  # time platform: "sntp" or "homeassistant"
  time_platform: "sntp"
  # SSID of your wifi
  wifi_ssid: !secret wifi_ssid
  # password of your wifi
  wifi_password: !secret wifi_password
  # password for fallback wifi hotspot
  wifi_ap_password: !secret wifi_fallback_password
  # UART configuration.
  tx_pin: TX
  rx_pin: RX

# please do not change packages order it is very important, just comment/uncomment
packages:
  remote:
    url: https://github.com/dentra/esphome-ewh
    ref: master # cant use substitutions here
    files:
      ## Enable additional WiFi signal sensor. Comment next line to disable.
      - packages/wifi_signal.yaml
      ## Enable additional Uptime sensor. Comment next line to disable.
      - packages/uptime.yaml
      ## Uncomment next line to enable additional restart button.
      - packages/restart.yaml
      ## Uncomment next line to enable additional diagnostic clock sensor
      # - packages/clock.yaml
      ## Uncomment next line to enable additional diagnostic timer sensor
      # - packages/timer.yaml
      ## Uncomment next line to enable standalone web ui
      - packages/ewh_web.yaml
      ## optional package, uncomment next line to enable experimental cloud support
      # - packages/cloud.yaml
      # Required package, do not comment
      - packages/base.yaml
      # Required package, replace with esp32.yaml if you use ESP32
      - packages/esp32_s3.yaml

esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

time:
  platform: sntp

# Enable Home Assistant API connection.
api:

# Uncomment to enable MQTT connecion.
# mqtt:
#   broker: !secret mqtt_borker
#   username: !secret mqtt_username
#   password: !secret mqtt_password

# WiFi hotspot configuration.
# Comment next 3 lines to enable manual WiFi conviguration via access point.
wifi:
  ssid: $wifi_ssid
  password: $wifi_password

logger:
  # Make sure logging is not using the serial port
  baud_rate: 0

uart:
  tx_pin: 19
  rx_pin: 20
  baud_rate: 9600

vport:
  - platform: ewh

climate:
  - platform: ewh
    id: whc
    name: None # use friendly_name
    # Optional, Bacteria Stop Technology switch
    bst:
      name: "Bacteria Stop Technology"
## Uncomment to enable and override cloud support
# rka_cloud:
#   id: cloud
#   mac: !secret cloud_mac
#   uid: !secret cloud_uid

При компиляции в Home Assistant ругается на text_sensor

ESPHome 2023.7.0
При компиляции в Home Assistant ругается на text_sensor:

Compiling /data/water-heater/.pioenvs/water-heater/src/esphome/components/ewh/ewh_utils.cpp.o In file included from src/esphome/components/ewh/climate/ewh_climate.h:10, from src/esphome/components/ewh/climate/ewh_climate.cpp:3: src/esphome/components/ewh/climate/../ewh_component.h:5:10: fatal error: esphome/components/text_sensor/text_sensor.h: No such file or directory 5 | #include "esphome/components/text_sensor/text_sensor.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. *** [/data/water-heater/.pioenvs/water-heater/src/esphome/components/ewh/climate/ewh_climate.cpp.o] Error 1 In file included from src/esphome/components/ewh/ewh_component.cpp:4: src/esphome/components/ewh/ewh_component.h:5:10: fatal error: esphome/components/text_sensor/text_sensor.h: No such file or directory 5 | #include "esphome/components/text_sensor/text_sensor.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. *** [/data/water-heater/.pioenvs/water-heater/src/esphome/components/ewh/ewh_component.cpp.o] Error 1

Добавил в yaml после секции Substitutions: строку text_sensor:, вроде собралось.

Для Electrolux Maximus wifi пришлось поменять пины TX и RX, все заработало.

Спасибо.

Energy Calculation

Perhaps it is possible to "catch" the idle state of the water heater by the help of small calculations between current water temperature and set water temperature. In case current_temperature<set_temperature the water heater is working. The power consumption is also known because it can be of 3 states.
I usually use my water heater only at 2000W. So in configuration.yaml I've created a simple binary sensor to measure power consumption.

`binary_sensor:

  • platform: template
    sensors:
    boiler_state:
    friendly_name: Boiler State
    entity_id:
    - binary_sensor.boiler_state
    value_template: >-
    {%- if (state_attr('climate.water_heater', 'temperature')-state_attr('climate.water_heater', 'current_temperature'))>1 -%}
    on
    {%- else -%}
    off
    {%- endif -%}

sensor:

  • platform: powercalc
    entity_id: binary_sensor.boiler_state
    create_energy_sensor: true
    mode: fixed
    fixed:
    power: 2000
    name: "Water heater consumption"`

I'm still testing this scenario. Any thoughts about its usability?

Error while updating iot-uni-dongle for ESPHome 2022.9.0

Hello!
Updated ESPHome to version 2022.9.0
Errors occur when updating iot-uni-dongle:

INFO Reading configuration /config/esphome/water-heat.yaml...
ERROR Unable to load component ewh:
Traceback (most recent call last):
File "/esphome/esphome/loader.py", line 162, in _lookup_module
module = importlib.import_module(f"esphome.components.{domain}")
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/config/esphome/.esphome/external_components/5e7bb4e7/components/ewh/init.py", line 65, in
cv.Optional(CONF_ICON, default=ICON_WATER_BOILER): switch.icon,
AttributeError: module 'esphome.components.switch' has no attribute 'icon'
ERROR Unable to load component ewh.climate:
Traceback (most recent call last):
File "/esphome/esphome/loader.py", line 162, in _lookup_module
module = importlib.import_module(f"esphome.components.{domain}")
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 972, in _find_and_load_unlocked
File "", line 228, in _call_with_frames_removed
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/config/esphome/.esphome/external_components/5e7bb4e7/components/ewh/init.py", line 65, in
cv.Optional(CONF_ICON, default=ICON_WATER_BOILER): switch.icon,
AttributeError: module 'esphome.components.switch' has no attribute 'icon'
INFO Detected timezone 'Europe/Moscow'
Failed config

ewh: [source /config/esphome/.esphome/packages/3a7dff6c/ewh-pkg-web.yaml:128]

Component not found: ewh.
on_state:
then:
- lambda: |-
id(wh_current_temp).publish_state(state.current_temperature);
id(wh_target_temp).publish_state(state.target_temperature);
switch(state.state) {
case ewh::ewh_status_t::STATE_700W:
id(wh_state).publish_state(true);
id(wh_mode).publish_state("700 W");
break;
case ewh::ewh_status_t::STATE_1300W:
id(wh_state).publish_state(true);
id(wh_mode).publish_state("1300 W");
break;
case ewh::ewh_status_t::STATE_2000W:
id(wh_state).publish_state(true);
id(wh_mode).publish_state("2000 W");
break;
case ewh::ewh_status_t::STATE_TIMER:
id(wh_state).publish_state(true);
id(wh_mode).publish_state("Timer");
break;
case ewh::ewh_status_t::STATE_NO_FROST:
id(wh_state).publish_state(true);
id(wh_mode).publish_state("No Frost");
break;
default:
id(wh_state).publish_state(false);
break;
}
id: wh
climate.ewh: [source /config/esphome/.esphome/packages/3a7dff6c/ewh-pkg-ewh.yaml:38]

Platform not found: 'climate.ewh'.
platform: ewh
id: whc
name: Water Heater
bst:
name: Water Heater BST

Help me please

Именование устройства

Формируется устройство типа "climate.esphome_elx_ewh_100climate" ... где "elx_ewh_100" имя при компиляции прошивки.
А вот "climate" в конце названия немного лишнее ... можно убрать? Оно и так понятно что climate ... в начале же есть "climate."

Lambda returned an invalid option: 0.7 kW

After last update preset mode not shown correctly in HA.
Any preset reset to 0.7 kW
EWH power sets correctly but HA card shows first item of list '0.7 kW'

[09:53:35][E][template.select:045]: Lambda returned an invalid option: 0.7 kW

[09:59:35][E][template.select:045]: Lambda returned an invalid option: 1.3 kW

Firmware compiling error

There is an error when compiling .bin from YAML config in ESPHome


Compiling /data/zanussi-artendo-pro/.pioenvs/zanussi-artendo-pro/src/esphome/components/ewh/climate/ewh_climate.cpp.o
In file included from src/esphome/components/ewh/climate/ewh_climate.h:10,
from src/esphome/components/ewh/climate/ewh_climate.cpp:3:
src/esphome/components/ewh/climate/../ewh_component.h:5:10: fatal error: esphome/components/text_sensor/text_sensor.h: No such file or directory
5 | #include "esphome/components/text_sensor/text_sensor.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [/data/zanussi-artendo-pro/.pioenvs/zanussi-artendo-pro/src/esphome/components/ewh/climate/ewh_climate.cpp.o] Error 1


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.