I will try to make a guide on how to modify a millheat heater so you can have full local control off the device. So no need to rely on Mill’s servers or API.
I have a Mill Glass Mill Glass 600W — Mill
but I think this could work on most models, since the wifi device basically is only turning on and off a relay. (Open up your device, look for labels and do some measuring)
Notes
NOTE I: If you do it like I did, there is nothing that breaks, and you can revert the modification if the heater malfunctions and you need to send it in for warranty. But still, do this on your own risk, I can’t stop you from doing mistakes that can cause a fire or hurt yourself.
NOTE II: The button panel does not work when doing this modification. I have not put to much time trying to implement this since I use Home Assistant to control the heater. (And I don’t want my wife to turn up the heat to much )
NOTE III: I have tried to reverse engineer the wifi controller and the button/display controller, but I couldn’t figure out anything there. Atleast not with the posibility to revert to stock.
NOTE IV: Let me know if something is unclear or if you have suggestions on improvement.
***Note V
***: @Blern_Jalkeby Has tested this succesfully on a Mill Steel Wifi heater, he only needed to move the relay to GPIO3 and the DHT to GPIO0.
Tools and equipment required
1 esp8266 (I am using an ESP-01)
1 DHT22 (You could use the built in temperature sensor, more on that later)
Wire wrapping tool and Wire wrapping wire (If you don’t want to solder)
Small bolt with nut, or just some hot glue.
Figuring out what does what
This is a picture of the heater I have.
I opened it up and checked how it looked inside.
Here you see a overview of the inside. The top is the controller box, then two black wires goes down to the analog temperature sensor.
I opened the box up and this is how it looks inside.
There you have a relay[1], wifi controller[2], pinouts[3], button/display board[4], temp sensor connection [5] and antenna [6].
Beside the pinout there is printed some labels on the board, TX,RX,PT?,AD,GND and PWR. (Not easy to see)
By measuring these while the device was in operation I figured out that it gave 3.3VDC and the PT? is for signaling the relay.
Was easier to measure on the backside of the board.
Removing things
Since the ESP8266 I am using doesn’t have the ADC broken out, I chose to change the temperature sensor.
I also removed the antenna for the wifi controller since this won’t be used anymore. (I also reset the device so there is no chance it can connect to internet)
Then I unplugged the pinout ribbon and put it aside.
The wifi controller is soldered so I did not bother removing it.
The code
I am using ESPHOME to control my ESP8266 and integrate them with Home Assistant. You can use what you want. The code is not that special.
Be carefull when copy paste, YAML is extremely picky with indentations.
Also, if you have any questions about the code, please read up a bit in the docs before asking. https://esphome.io/
Config without any climate setup, the climate setup has to be done in HomeAssistant. This code handles errors with high temperature, faulty temperature sensor and loss of connection to HomeAssistant API.
Remember to set the temperatures to a default value you want. (One in globals also)
# Varmeovn kjøkken
substitutions:
devicename: esp01_mill01
globals:
- id: max_temp
type: float
restore_value: no
#Have this a couple of degrees higher than the max temp on the thermostat
initial_value: '26.5'
#Used to avoid spamming
- id: notified
type: bool
restore_value: no
initial_value: 'false'
esphome:
name: $devicename
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret ssid
password: !secret wpa
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
id: api_server
ota:
password: !secret ota_password
switch:
- platform: gpio
restore_mode: RESTORE_DEFAULT_OFF
pin: GPIO0
id: relay1
name: $devicename " Relay"
#Reset the notification global, so it can be sent again
on_turn_on:
- globals.set:
id: notified
value: 'false'
sensor:
- platform: dht
pin: GPIO3
model: AM2302
temperature:
id: temp1
name: $devicename " Temperature"
on_value:
then:
# Every time the temperature changes, check if there is something wrong
- if:
condition:
or:
# Is the temperature too high?
- lambda: 'return id(temp1).state > id(max_temp);'
# Is NAN?
- lambda: 'return isnan(id(temp1).state);'
#If not connected to the API, turn off the relay, notifications
# won't be sent since the API is not connected.
- not:
api.connected:
then:
#Turn of the relay
- switch.turn_off: relay1
#Turn of the climate entity
- homeassistant.service:
service: climate.turn_off
data:
entity_id: climate.utleie_kjokken
#Show a log in the esphome console
- logger.log: Something wrong with temperature
#Notify only one time as long as the relay hasn't been turned on
# again
- if:
condition:
#If notification hasn't been sent, to avoid spamming
not:
- lambda: 'return id(notified);'
then:
#Set global notified to true
- globals.set:
id: notified
value: 'true'
#Notify someone
- homeassistant.service:
service: notify.mobile_app_john_arvid_s_iphone_3gs
data:
message: 'Something wrong with ${devicename}'
humidity:
name: $devicename " Humidity"
update_interval: 10s
This config is for the generic thermostat in HA, ref: https://www.home-assistant.io/components/generic_thermostat/
- platform: generic_thermostat
name: "Utleie kjøkken"
heater: switch.esp01_mill01_relay
target_sensor: sensor.esp01_mill01_temperature
max_temp: 24
min_temp: 3
precision: 0.5
min_cycle_duration:
minutes: 1
Wiring things
Don’t let the wire colors confuse you, I am just being cheap so I use what I have of the best lenght.
So on the ESP-01 I connected like this:
3V3 to PWR on pinout Orange
GND to GND on pinout Yellow
IO0 to PT? on pinout Purple
3V3 to VCC on DHT22 Red
GND to GND on DHT22 Black
RX to Data on DHT22 Green
Remember to test if you chose some other pins on the ESP8266, if you use the wrong pin the ESP8266 won’t boot.
Also, depending on the ESP-01 you might need to connect EN and 3V3 pin to boot normally.
The wires to the DHT22 goes the same way as the old wires, so I don’t think there would be a problem with heat.
As soon as I figure out a proper way I will put some safeguards in the code in case the temperature is to high or the readings are NAN.
I used a bolt and a nut to keep the DHT22 in place.
Then just put everything back together and you now have a device you can fully control locally with Home Assistant or some other automation tool.