Skip to content

Radiator valve firmware for esp8266 and esp32

License

Notifications You must be signed in to change notification settings

Anycubic/open-heat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Heat

BPlatformIO CI

This projects provides a firmware for an ESP8266 to control radiator valves.

Status

Early beta

Hardware

  • ESP8266 (ESP32 can be supported in the future)
  • Radiator Valve
    • The linked valve is taken apart and only the motor is used. Therefore the cheapest version without support or bluetooth for wifi is sufficient
  • BME280
    Using the heat dependend resisistor from the valve currently is not supported.

Pin configuration

Pins can be configured via the webinterface. The current defaults are:

Function Ground VIN
Motor D6 (12) D5 (14)
Window D8 (15) D7 (13)

Building

Run init.sh to properly initialize the project. To build run

platformio -c clion run --target release -e nodemcuv2

Setup

Connect to the WiFi OpenHeatESP... with password "OpenHeat". Open 192.168.4.1 in your browser and start configuration. Save config and the ESP will reboot and connect to your Wifi.

Updating

Download the latest firmware from releases and upload it on the web-ui. Make sure to download the correct version, otherwise your MCU has to be flashed via USB again.

The initial configuration allows the configuration of a user name and password for update purposes. This is to improve security a bit and not anyone in your network can flash a new firmware. For security purposes this data only can be changed in the configuration mode and not via the webinterface. To enable the configuration mode again restart your device twice in 10s.

MQTT

The heater can be controlled via mqtt and integrated into home assistant. It offers the following topics, all of them are prefixed with the configured topic ($TOPIC):

  • Set target temp: $TOPIC/temperature/target/set
  • Get target temp: $TOPIC/temperature/target/get
  • Get measured temp: $TOPIC/temperature/measured/get
  • Get current mode (can be off or heating): $TOPIC/mode/get
  • Set current mode (can be off or heating): $TOPIC/mode/set

Example configuration for home assistant:

climate:
  - platform: mqtt
    modes:
      - "off"
      - "heat"
    name: Living room
    temperature_command_topic: "living_room/front/temperature/target/set"
    temperature_state_topic: "living_room/front/temperature/target/get"
    current_temperature_topic: "living_room/front/temperature/measured/get"
    mode_command_topic: "living_room/front/mode/set"
    mode_state_topic: "living_room/front/mode/get"
    retain: true

Debugging

All commands must be sent with retain flag to allow the device to read the value as soon as it comes out of sleep

  • Enable debugging and web interface, WARNING this consumes a lot more power is not intended to be used for battery operation:

    mosquitto_pub -h hassbian -t "$TOPIC/debug/enable" -m "true" -r
    
  • Set log level

     mosquitto_pub -h hassbian -t "$TOPIC/debug/loglevel" -m "$LEVEL" -r   
    

    Level can be a value between 0 (highest log level = all logs) and 5 (lowest log level = only fatal errors)

  • Receive logs

    mosquitto_sub -h hassbian -t "$TOPIC/log"
    

Receiving logs

Serial

platformio -c clion device monitor -e nodemcuv2 -f esp8266_exception_decoder

MQTT

Subscribe to topic $TOPIC/log

Browser

Logs are displayed in the web ui at the bottom of the page.

Code analysis

cmake .. -DCMAKE_BUILD_TYPE=nodemcuv2 --CMAKE_EXPORT_COMPILE_COMMANDS=YES ..
~/dev/public/llvm-project/build/bin/scan-build make

Installation

Contributions

As this project is still in a very early stage no contributions will be accepted at the moment.

Attributions and libraries

Special thanks to traumflug and their regulator implementation in ISTAtrol. Altough it was heavily modified and improved the I-Regulator still forms the base of the valve control.

Libraries

About

Radiator valve firmware for esp8266 and esp32

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 74.6%
  • C 15.8%
  • HTML 9.4%
  • Shell 0.2%