Controlling Towel Rail

Fairly new to HA. I currently have one Tasmota switch controlling my garden lights (got to start somewhere).

For my next project, the Kudox controller for the heating element in my towel rail has failed. I like the idea of replacing it with something I can program from HA and found the Timeguard Wi-Fi Controlled Fused Spur. Based on this post it looks like it should play nicely with HA.

However, one feature of the Kudox that I want to keep is the abililty to set the element on less than 100% power (it supports 85%, 70%, 55%, 40%). I’m assuming how it does that is by turning on and off for longer or shorter periods of time based on the setting (i.e when at 40% power be on for 40% of the time and off for 60%.)

Is there a feature in HA that would emulate this behaviour? So when I set the radiator to on it’s actually turning the switch on and off based on a %?

Hi,

TL;DR: ESPhome has platform: slow_pwm, and I’m also looking at the same project

I suspect you have the Kudox electrical element wall controller as previously sold by Screwfix in the UK.

After fitting one, and finding the (E) timed feature particuarly good for drying soggy cycling kit (Zwift), my intention was to reverse engineer and either:

  1. Add an ESP32 to connector P3 powered from the capacitative dropper, monitor LED voltage status, and add button press simulations (e.g. tristate the output, drive high or low to simulate a button press, then tristate again).
  2. Use an ESP32 to monitor the single relay, and get an idea of the PWM thermal control used to set power levels - the relay can’t be being cycled that often or the contacts would fail even with a resistive load like a heater.

My photos of the PCB suggest a PIC micro is in control, but the relay is marked 48V which is a lot higher than most kit - could be a split rail PSU (e.g. 3V3 - 12V for the uP, and 48V with a mosfet for the relay). There’s also 17x transistors, which is a lot even with 5x + 3x LEDs + a relay - this suggests the relays are charlieplexed. This complexity meant I fitted the module first before building a test rig.

Unfortunately, Screwfix don’t seem to stock the unit currently which I found out when going to buy another for bench testing, whilst the one I have is in production (after proving a too useful to remove!).

For hardware, Shelly make several decent ESP32 modules for the UK with relays, as do Sonoff so if you do without a display, there’s not much to make (as long as the hardware is behind a sealed blanking plate as although likely outside BS7671 Zones 0-2, water ingress protection is still needed).

For software, Tasmota offers heating PWM, and I found ESPhome has platform: slow_pwm - a heater can be seen as a very slow LED light and “dimmed” using similar PWM control just with one pulse every 10mins, rather than 2kHz!

You’ve prodded my memory to start looking at this project before winter arrives, with cold mornings.

My thought is to connect a 240V relay coil in parallel with the heater, and connect the dry contacts to an ESP and monitor the PWM output to see how the heater reacts. Looking at my parts bin, this is likely to be an Wemos D1 mini running from a recycled vape LiPo battery, battery shield, and ESPhome.
TTFN,

James

Right - 220V opto-isolator input modules are on order from eBay (£5 each, so easier than using the CN17Y or SFH618A optocouplers I had in stock). This should be simple to connect directly to a Wemos D1 mini ESP8266 with a LiPo battery shield to create a monitor for the heater ON state and get an idea of the PWM frequencies suitable for a Tesla UK Towel Radiator Element 600W (no, not THAT Tesla… :slight_smile: ).

I’ll report back in a few days…

TBH that was mostly over my head. My A level electronics was a long time ago. But you’re correct in identifying my controller, I wasn’t allowed a third link in my post.

On mine I can hear the relay clicking on and off - at least I assumed that’s what the noise was - and it’s a granularity in the order of minutes (i.e. on for one min, off for three mins). So that’s what I was hoping to recreate, with HA doing the switching.

I’m a greybeard chartered engineer, as you may have noticed from the ability to talk definitive nonsense! :mage:t2: :slight_smile:

The generic optocoupler modules arrived from eBay in the post this morning, so after some minor fettling, ESPhome is logging the heater state to get an idea of typical heating control duty cycles.

As a taster, here’s a log for Level 2:

image

As you can see, the pattern isn’t quite symmetrical, but the duty cycle is regular suggesting there’s no magic to controlling a towel radiator heater.

More to come…

Well, using HASS as a very slow oscilloscope proved to be very successful. The entity History display shows both the state changes, and calculates the ON and OFF times for you automatically.

As you might expect for a linear load like a heater, the settings give a straight line, with an offset likely to allow for losses (e.g. low power would be a bit too cold).

The next step is to move from measurement to testing control via platform: slow_pwm and a relay board. A Shelly would fit inside a UK back-box better than a dev board, but this is still a test.

FYI, I’ve got a ESPhome config written, but went a bit wild and created a mode selection control which is preventing the whole thing from compiling.
Might need to strip it back to just the PWM config then build back again.

I’ll post something when it does something…

So I got this working with a Shelly 1PM running stock firmware by moving all the logic into HA automations.

I used an input_boolean as a master switch and input_number slider to set the desired % power level. Jinja filters are then used to figure-out how many seconds to be on and off in each 5 minute cycle for the given %.

I’ve also added a power save mode, which drops the % if I accidentally leave it on 100% for an extended period of time (90 mins).

Seems to be working well, after ironing out a few bugs in my logic.