Room Heating And Lighting Control

A cheap and easy to configure multi room lighting and heating control panel. Preconfigured for Radiator Valves and Ikea Dimmable Lights.

Similar projects worth following
With heating costs so high and most heating systems centrally controlled we need a better way to control individual rooms to only heat what we want to heat. Adding a LCD touchscreen ($15) allows control of a Zigbee radiator thermostat ($25) and Zigbee room and side lights.

The room heating target is set on the room touch panel, a Zigbee temperature sensor and Zigbee TRV is used switch on and off the room radiator valve controlling the room heating. The room touch panel is also used to switch on and set the brightness of Zigbee main and side lights. The control is hosted on a Raspberry Pi with a Zigbee dongle as a controller.

As well as the hardware the design includes a Node Red room flow template to take the input from the touchscreen and temperature sensor and manage the radiator valve state and lighting settings as well as show the time and inside and outside temperature.

Room Components:

  1. 3.5inch LCD TFT Module capacitive touch with an ESP32 ($15) - AliExpress
  2. Tuya ZigBee Temperature Humidity Sensor ($5) - AliExpress
  3. Tuya ZigBee Radiator Valve ($25) - AliExpress
  4. Ikea ZigBee TRÅDFRI LED bulb E26 1100 lumen ($14) - Ikea
  5. Ikea ZigBee TRÅDFRI LED bulb GU10 400 lumen ($10 x2) - Ikea


  1. Raspberry Pi 4B 4Gb ($55) + Power Supply, 32Gb+ SD Card, Heatsink/Case
  2. SONOFF ZBDongle-P Universal Zigbee USB 3.0 Dongle Plus ($20) - AliExpress (I bought the ZBDongle-P one)

Step 1: Setting Up the Display

The key component of this project is the new batch of touchscreen displays with integrated ESP32s. For $15 you can buy a 3.5 inch, IPS capacitive touchscreen TFT display with an integrated WiFi microcontroller. Combine this with a great open source project openHASP that allows a home automation control panel to be setup on these panels with just a configuration file representing screen pages. The panel with openHASP installed can then interact with other systems by sending and receiving standard MQTT messages.

The display setup involves burning new firmware on the screen, connecting the screen to the network and then uploading the room control panel page.

  1. This procedure is for the Sunton ESP32-3248S035C, other screen that are compatible with openHASP can be use. For another screen follow the instructions on the openHASP Flash page. For the Sunton ESP32-3248S035C follow the instructions below.
  2. Download the firmware from ESP32-3248S035 - openHASP (recommended nightly builds Install openHASP).
  3. Download the Tasmota flash tool to allow flashing the firmware to the screen (this and alternatives also covered in the openHASP Flash page).
  4. Connect the Sunton ESP32-3248S035C to your PC USB port with the supplied cable (if the screen is not recognised you may have to install the serial port drivers for the CH340C)
  5. Run the Tasmota-PyFlasher-1.0.exe, select the serial port for the ESP32-3248S035C, browse to the downloaded bin file, select yes to erase the flash and then click on the Flash button.
  6. Restart the screen and follow the instructions on the openHASP site to setup the WiFi SSID and password on the screen.

Step 2: Setting Up the Control Page

Setting Up the Control Page

You should now have a working screen but with some sample controls. Next we want to upload the configuration page with the room heating and lighting controls.

  1. Download the attached pages.json file that contains the panel configuration page.
  2. Restart the screen and note the ip address of screen when openHASP starts (e.g.
  3. On you PC, open a browser and enter the ip address, this will show the openHASP configuration options.
  4. Click on the File Editor button and select the pages.jsonl file on the left side panel.
  5. Delete the entries in the pages.jsonl file and paste in the contents of the pages.json file
  6. Click the Upload button, then Clear Pages button, then Reload Pages button. The heating and lighting panel should now be displayed.

Step 3: Setting Up the Raspberry Pi Server

The touchscreen control panel needs some way to send and receive messages to and from the Zigbee devices. The panel communicate using MQTT messages and the devices communicate using the Zigbee protocol. This means we need an MQTT broker and a zigbee to MQTT translator. For this server I am using Mosquitto for the MQTT broker and Zigbee2MQTT.

When we get a message in from, for example, the temperature sensor we need to have something to decide whether the heating should be activated. In this project I am using Node RED which is graphical way of creating process flows with small scripts to process the input and decide on the output (e.g. temperature is below 18C so open the radiator valve).

So we need Mosquitto MQTT broker, Zigbee2MQTT server and Node RED. If you have these already available then you can skip this step. You can also install these individually on...

Read more »


OpenHasp TFT panel file

JavaScript Object Notation (JSON) - 5.03 kB - 04/15/2024 at 01:49


  • 1 × 3.5inch LCD TFT Module capacitive touch with an ESP32 ($15) - AliExpress
  • 1 × Tuya ZigBee Temperature Humidity Sensor ($5) - AliExpress
  • 1 × Tuya ZigBee Radiator Valve ($25) - AliExpress
  • 1 × Ikea ZigBee TRÅDFRI LED bulb E26 1100 lumen ($14)
  • 1 × Ikea ZigBee TRÅDFRI LED bulb GU10 400 lumen ($10 x2)

View all 6 components

  • Starting Point

    John Gilmour04/15/2024 at 01:54 0 comments

    Most of what is needed to get started is uploaded, including the panel configuration file.  I will upload the Node Red flows once I have removed my MQTT password and provide more instructions on using this.

    I will be adding more detail and happy to answer questions or explain specific areas

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates