Skip to content

Personal project to manage our home heating system

License

Notifications You must be signed in to change notification settings

guidoschreuder/zebus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zebus

Manage the Valliant heater

Goals

Create system to control the heater

Conceived features:

  • room controller:
    • display to represent status
      • requested room temperature
      • room temperature
      • heater flow temp (ebusd message ‘FlowTemp’, also rounded in `status01`)
      • heater return temp (ebusd message ‘ReturnTemp’, also rounded in `status01`)
      • outside temperature
      • heater mode: heating/hot water (ebusd message ‘HwcDemand’ or ‘HwcWaterflow’)
      • tap water temperature (ebusd message ‘FlowTemp’ when tap is running)
      • flame on/off (ebusd message ‘Flame’)
      • pump on/off (ebusd message ‘WP’)
      • heater modulation
      • power usage (?) to be tested (ebusd message ‘PowerValue’)
    • sensor for actual room temperature
    • controls to set required temperature
  • communicate date and outside temperature to heater unit impossible and irrelevant, see * +Broadcast datetime+
  • control remotely using a telegram bot, that way we do not need to open any ports to the outside
  • (LOW PRIO, MAYBE LATER) display graphs over time of relevant values

Topology (work in progress)

  • room controller (ESP32 + display + temp-sensor)
  • retrieve outside temp from free API service like OpenWeatherMap outdoor unit, communicates temperature to “master” ESP32 on heater unit over ESP-NOW
  • (LOW PRIO, MAYBE LATER) master forwards to MQTT for monitoring/graphing

Challenges

  • ✓ eBUS communication protocol (pretty much got this down)
  • Valliant’s eBUS commands are proprietary
  • ESP32 ULP programming is in assembler

tasks

Tasks should re-ordered so the first items should be the first things to pick up, items that are DONE need to move to * project log

determine preferred topology to use (work in progress)

consider ESP-NOW so “sensor” modules can profit from reduced “ON” time.

This needs a “master” though to forward to MQTT if required.

Good read and entry point is here: https://hackaday.io/project/174898-esp-now-weather-station

New idea on topology is to use a single ESP32 as thermostat which harvests energy from eBUS for power.

The advantage is that there is no wireless communication needed for basic thermostat functionality.

This does however require a more sophisticated power design as we need a LiPo battery (or similar) with circuitry and most likely use of ESP32 ULP to stay within the power budget.

Wireless connectivity is still possible for things like getting NTP, outside temperature from a free API service and communicating as a telegram bot, but display and wireless need to repect the available energy budget.

prototype switching display on and off with mosfet

When operating in power-harvest mode we do not want the display on when maintenance chores are done.

The display does not have a pin to regulate the backlight, so it needs to be switched off completely when in sleep mode.

integrate a rotary encoder and buttons (capacitive?) for controlling the controller

integrate room temperature sensor

[#B] prototype power harvesting

Starting point are project that use solar energy like here https://randomnerdtutorials.com/power-esp32-esp8266-solar-panels-battery-level-monitoring/

This will include staring to use ESP32 ULP programming in assembler to measure the voltage/battery level in low power mode

[#C] create PCB with all components integrated

All basic functionality needs to be prototyped and tested before doing this.

Consider using JLCPCB assembly, this way we can use SMD without the hassle of sourcing SMD components, let alone soldering them

[#C] create case for thermostat unit

documentation

calculating power usage

2021-10-26 07:24:00.949 [update notice] sent read bai PartloadHcKW QQ=31: 20
2021-10-26 07:24:00.951 [bus notice] >3108b509030d0704ee<0001148f>00
2021-10-26 07:27:48.647 [update notice] sent read bai ModulationTempDesired QQ=31: 35.0
2021-10-26 07:27:48.650 [bus notice] >3108b509030d2e000c<00025e01a2>00
CurrentPower = PartloadHcKW * ModulationTempDesired / 100%

CurrentPower = 20 * 35.0 /100 = 7KW

discussion on calculating power consumption: john30/ebusd-configuration#89

code coverage

After running tests, code coverage report can be generated by executing the following commands:

$ lcov --capture --directory .pio/build --output-file coverage.info
$ genhtml coverage.info --output-directory out

display

./docs/img/2-Inch-TFT-Color-Screen-LCD-Display-Module.png

driver IC: ST7789VW

size: 240x320 px

library used: TFT_eSPI

bought here: https://www.aliexpress.com/item/4000830895622.html

pinoutmeaningESP32note
CSchip selectGNDactive low
DCSPI Data CommandGPIO 27
RSTResetGPIO 5
SDASPI MOSIGPIO 23
SCLSPI clockGPIO 18
VCC+3.3
GNDGND

random assortment of links

project log

create hardware interface for eBUS

get hardware interface to work with ebusd and experiment a bit

build bus power supply so testing can be done in stand-alone mode

experiment with programming new ESP32 boards

that was easy as pie :)

get ESP32 to listen in on eBUS messages and forward them ad-verbum to serial port for monitoring/debugging

implement queues for actions “to be done” and “messages completed”

status:

implemented a pretty simple queue

later i found out about the provided facilities of FreeRTOS (live and learn…)

the simple mock queue is however still very usefull for unit-testing in native mode

actual implementation will use FreeRTOS queues provided by ESP-IDF/FreeRTOS

learn how to use FreeRTOS queues

use queues for storing historic message

reply to “Identification (Service 07h 04h)”

tackle the arbitration challenge

get ESP board to interface with 2.0” display

setup polls for basic data and extract the relevant data from the responses

suggested for this todo are some of the messages already known:
  • FlowTemp
  • ReturnTemp
  • HwcWaterflow
  • Flame

As a reward these values can already be put on display, gaining some instant gratification and bragging rights.

connect to WiFi

Setup and display time over NTP

display eBUS connectivity

figure out what our power budget is

Shorting 390 Ohm across the eBUS still held an upper voltage of 20.2V and bus seemed to work fine.

This equals a current draw of ~52mA, or 1.06W, this is actually quite substantial, this was measured with a really tiny copper wire (telephone wire) connection to the heater, so losses will be less on thicker wiring.

Using 220 Ohm the bus still managed to do some communication but errors did occur, the maximum voltage dropped to 19.2V. This equals a current draw of ~87mA and a power of 1.68W! The resistor got really toasty and discoloured!

At 336 Ohm (60mA, 1.2W) bus still behaved perfectly.

In conclusion, round about 50mA or a little more seems to be a very safe limit with only a single device on the bus besides the heater.

Broadcast datetime

Send broadcast of datetime and check ebusd messages ‘DCFState’, ‘DCFTimeDate’, ‘DateTime’.

My line of thinking was completely wrong, i assumed the DCF77 device was “Yet Another eBUS device”. It is not. It is a module connected to a separate port on the heater. The broadcasts (presumably) are by the heater when it has detected a DCF signal.

Further more, i have not found any way to set the date/time on the heater through eBUS, and believe me, i’ve tried.

In the end it is not really relevant anyway, the room controller takes on the full role of director anyway when controlling the heater over eBUS, so the date/time on the heater is then completely irrelevant.

send current room temperature to heater

Irrelevant for the same reason outlined in * +Broadcast datetime+, in eBUS mode the heater is just a rather dumb slave dancing to the tune of puppet master room controller

setup separerate ESP32 as temperature logger

read sensor and output value to serial port

setup ESP-NOW and communicate temperature sensor readings to room controller

switch ESP-NOW polling from master to slave

It makes little sense for the master to loose WiFi connection to send beacons because of channel switching. Instead the slave(s) should do this as they have no active WiFi connection to begin with.

implement HMAC on ESP-NOW messages

Data sent over ESP-NOW is not sensitive so encryption is not very relevant. However, we do not want rogue data being operated on by the controller.

About

Personal project to manage our home heating system

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published