Thermostat and Boiler controller for EMS based boilers (Nefit, Buderus, Bosch) using ESP

This project is part hardware, part ESP8266 Arduino framework code on a microcontroller and a little bit of HA configuration.

I built a small circuit to read and write values from my Boiler and Thermostat based on the EMS protocol. I use a Netfit (in The Netherlands) and unfortunately, these range of Bosch boilers and thermostats in Europe are not OpenTherm compatible without an expensive converter.

The circuit is simple to build and the parts will cost a few euros. The code is designed for an ESP8266 device (a Wemos D1 mini for example for $3) and uses MQTT to communicate to HA. Pretty much any data you can receive from the boiler and attached devices (such as a compatible thermostat) can be exposed and managed via HA. As an example, I have setup HA to manually control the heating and also notify me on how long my kids take a shower for.

All information and code are on my GitHub account (https://github.com/proddy/EMS-ESP-Boiler).

ha

ha_notify

9 Likes

did a quick update to lovelace using the custom thermostat card…

3 Likes

Wow! Nice work. When time permits I have to try this out!

Hi Proddy,

Is see in you wiki, that you want someone with help to debug with nefit easy.

I Want to help, I have already the esp8266 and the print from bbqkees.

regards Richard

Hi Richard, that would be awesome if you could help out. I’m working with bbqkees on refining the board and the code and figuring out how the Nefit Easy handled the boiler commands was one of the last puzzles. I’ll send you a PM with my email.

Paul

Hi Paul,

The Wemos D1 mini firmware file seems having disappeared on GitHub.
As I’m lazy and don’t like to setup a compiling environment, can you please upload the bin file ?
Thx

t’s still there under https://github.com/proddy/EMS-ESP/releases . I suggest taking the latest dev beta build. Let me know if you need help

Hi Paul,

I finally made it !
It is working like a charm.
I get all needed data on telnet console however I have problems to integrate this in HA.
Up to now all my MQTT devices have been settled with auto-discovery
When I try your yaml files I got a lot of errors from HA, for example:

Invalid config for [climate.mqtt]: [sensor.boiler_boottime] is an invalid option for [climate.mqtt]. Check: climate.mqtt->sensor.boiler_boottime. (See ?, line ?).

Great! If you create an issue in the GitHub project page I’ll (or someone else) will be able to help you with the HA configuration.

Hi all,
i am new to home assistant. i am using Domoticz for my home automation, this project is the reason to investigate if i can transfer to home assistant.
I installed home assistant on a rpi3 with hassbian. Downloaded the yaml-files from the github and have a MQTT broker running on a different rpi.
i created my own configuration.yaml.
but i recieve integartion errors on 3/9 files:
Integration not found: sensors
Integration not found: customize
Integration not found: switches
Integration not found: scripts
Integration not found: automations
Integration not found: ui-lovelace
all files are integrated in the same way in my configuration.yaml. so i am confused why only 3 files are included properly. the hardware is functional, and i can send MQTT messages from home assistant.
who can point me in the right direction to get home assistant running?

with kind regards,
Ivo

Did you include the files from your configuration.yaml? See https://github.com/proddy/EMS-ESP/wiki/Home-Assistant. If you’re still having problems just go ahead and create a GitHub issue.

1 Like

aha. i used sensors instead of sensor etc.
now i am down to only 2 include errors:
Integration not found: customize
Integration not found: ui-lovelace

this is my configuration.yaml:

homeassistant:
  # Name of the location where Home Assistant is running
  name: Thuis
  # Location required to calculate the time the sun rises and sets
  latitude: 51.10171
  longitude: 5.89182
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 32
  # metric for Metric, imperial for Imperial
  unit_system: metric
  time_zone: Europe/Amsterdam

default_config:

lovelace:
  mode: yaml

ui-lovelace: !include ui-lovelace.yaml
automation: !include automations.yaml
binary_sensor: !include binary_sensor.yaml
climate: !include climate.yaml
customize: !include customize.yaml
notify: !include notify.yaml
script: !include scripts.yaml
sensor: !include sensors.yaml
switch: !include switches.yaml

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Uncomment this to add a password (recommended!)
  # api_password: PASSWORD
  # Uncomment this if you are using SSL or running in Docker etc
  # base_url: example.duckdns.org:8123

# Checks for available updates
updater:

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather Prediction
#sensor:
#  platform: yr

# Text to speech
#tts:
#  platform: google
mqtt:
  broker: 192.168.2.27
#  port: 1883

my bad, the customize: !include customize.yaml needs to go under the homeassistant: section at the top.

Also no need to include ui-lovelace.yaml as its a hardcoded system file.

1 Like

fantastic. it is working now!

Hello. I’m in process of assembly my ESP with bbqkees board. I have one question regarding installation.
Is it necessary to have thermostat on EMS bus? Will I be able to set boiler temperature without thermostat on EMS bus?

in theory yes, the software will be able to control anything on the EMS bus. A list of commands and MQTT is in the wiki https://github.com/proddy/EMS-ESP/wiki

My first post here…

I successfully installed the bbqkees hardware and Proddy software and it is gathering the EMS data from my Nefit topline boiler. the next step was to create a NodeRed configuration to monitor and analyse the data. that worked fine.

Now I’m trying to implement your software it in HA. This is running also. however, the thermostat_data isn’t working at all, while in Node Red it was running. In the HA overview page the thermostat is grayed-out.

The MQTT broker gives:

{"thermostat_hc":"1","thermostat_seltemp":21,"thermostat_currtemp":20.8,"thermostat_mode":"auto"}

In the HA dashboard the thermostat is grayed-out. The logfile generates the below errors:

2019-10-23 12:53:43 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'hc1' (value: {"thermostat_hc":"1","thermostat_seltemp":21,"thermostat_currtemp":20.9,"thermostat_mode":"auto"}, template: {{ value_json.hc1.currtemp }})
2019-10-23 12:53:43 ERROR (MainThread) [homeassistant.components.mqtt.climate] Could not parse temperature from {"thermostat_hc":"1","thermostat_seltemp":21,"thermostat_currtemp":20.9,"thermostat_mode":"auto"}
2019-10-23 12:53:43 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'hc1' (value: {"thermostat_hc":"1","thermostat_seltemp":21,"thermostat_currtemp":20.9,"thermostat_mode":"auto"}, template: {{ value_json.hc1.seltemp }})

It looks to me it struggles with the Heather “hc1” somewhat? I looked into the sensors.yaml and climate.yaml, but I can’t see anything wrong. As I’m still learning HA I’m don’t know what I’m doing wrong.

Home Assistant version is 0.97.2 and running in Openmediavault docker in Debian.

Hopefully somebody can shine a light on this…

Make sure you’re using the latest EMS-ESP 1.9.2 as the MQTT topic structure has changed. There are new HA templates in the GitHub repo. Also look at the wiki for more details.

Hi Paul, updating to the latest version did the job done. Thanks!

Hi Paul,

Thank you for making this available to everyone.

I am looking at using Home Assistant effectively as a room controller/thermostat. So need to be able to switch on/off the boiler for central heating. Is this possible using your EMS protocol implementation? I can see clearly how to change the mode of a thermostat connected via the EMS bus but this doesn’t suit my needs (I don’t have such a thermostat).

What I was hoping to be able to do was issue a 0-100% heating value to the boiler, as opposed to a binary on/off instruction.

Or should I resort to simply switching the boiler on/off (for central heating) by switching the 240v supply to the boiler, leaving your EMS interface for feedback?

Many thanks!

Richard