The Dimplex Revillusion is controlled with a handheld Infrared remote control. The buttons on the remote control toggle the various fireplace functions.
Home Assistant, Node Red, and ESPhome - interfacing over WiFi with an ESP32.
The Dimplex Revillusion IR commands seemed to work with the NEC protocol. To receive them properly I had to set the pin to “invert”. (The IR commands for each button are shown in the YAML below.)
For safety reasons, I felt like I needed to concretely know when the fireplace was ON or OFF. However, the IR remote toggles all of the fireplace functions. (ie: Press the Power Button once,… turns ON. Press the Power Button again,… turns OFF.) There is no explicit way to turn OFF or turn ON. To monitor fireplace power status:
The fireplace insert has a a 12vdc connection for the “glowing ashmat”. I decided to use the ashmat power to determine if the fireplace was ON,… the assumption being,… if the ashmat is ON, then the fireplace is ON.
The Voltage Sensor was connected in parallel to the ashmat power to provide a binary signal. I had to invert that signal, and also do some debounce filtering.
The result is a “Fireplace Status” binary sensor that goes ON/OFF as the fireplace is running. See YAML.
The only problem: This will give an incorrect status if the fireplace “flames light” is toggled off while the the fireplace “heat” or fireplace “power” is still on. However, I figured we would always run the fireplace with the “flames light” on - so should not be a huge risk. Is there a better way? Maybe use a temperature probe at the heat/blower outlet to determine if heat is still being produced by the fireplace?
In Home Assistant, in addition to the switches and sensors imported from the ESPHome device,
I created a new Boolean Input switch “Fireplace Switch”. When the “Fireplace Switch” is turned ON, Node Red checks that Fireplace Power is currently OFF, then toggles the Fireplace Power, and finally checks that Fireplace Power came ON. (Similar process for OFF.)
In case the fireplace was manually turned ON/OFF via the physical IR remote control,… Node Red also checks the “Fireplace Status” and turns the virtual “Fireplace Switch” ON/OFF so that the two are in sync.
Appreciate any feedback - as this is my first custom H/W setup with Home Assistant and ESPHome.
I originally was going to put the ESP’s IR transmitter NEAR the Fireplace’s IR receiver so that I could still use the physical Fireplace remote control. But realized that the Fireplace’s IR receiver is weak,… the ESP’s IR transmitter and/or physical remote needs to be fairly close and pointed directly at it. By comparison - the ESP’s IR receiver is fairly strong - and will pick up signals from the physical IR remote without such a direct sightline.
I decided to use the ESP’s IR receiver as a repeater - to relay IR signals from the physical remote control via the ESP’s IR transmitter to the Fireplace IR receiver.
I taped the ESP’s IR transmitter on top of the Fireplace’s IR Receiver using electrical tape (so that no other IR signals could be received by the Fireplace other than from the ESP’s IR transmitter).
Configured binary sensors for all of the IR commands.
This has the side benefit of being able to intercept and disable the “Fireplace Lights ON/OFF” IR signal. The Fireplace lights are being used as a sensor for overall Fireplace Power. If they are turned off independently of the power it will give a false OFF.
The main obstacle setting up the IR repeater: the ESP IR sensors would not reset. Once the physical remote control button was pressed, they would turn ON. Pressing the button again would not change the state. The solution was to use an ON_PRESS trigger along with an automation to turn on the corresponding IR switch, wait 1s, and then a lambda to publish an OFF state.
Still to do: I bought a temperature probe that I need to set up. I intend to replace the existing temperature sensor and put the probe near the outlet of the heater. Should be able to tell the heat level of the fireplace and also confirm whether it is running or not.
New YAML is below:
esphome:
name: basement
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: "xxxx"
password: "xxxx"
ap:
ssid: "Basement Fallback Hotspot"
password: "xxxx"
captive_portal:
remote_receiver:
pin:
number: GPIO16
inverted: true
dump:
- nec
remote_transmitter:
pin: GPIO17
carrier_duty_percent: 50%
i2c:
- id: bus_a
sda: 21
scl: 22
scan: true
sensor:
- platform: bmp280
i2c_id: bus_a
temperature:
name: "Fireplace Temperature"
oversampling: 16x
# pressure:
# name: "Fireplace Pressure"
address: 0x76
update_interval: 60s
binary_sensor:
# voltage sensor connected to the fireplace light power connection.
- platform: gpio
pin:
number: GPIO23
inverted: true
mode:
input: true
pullup: true
name: Fireplace Status
filters:
- delayed_off: 150ms
# IR Sensors
- platform: remote_receiver
name: Fireplace Power Toggle IR Sensor
id: Fireplace_Power_Toggle_IR_Sensor
nec:
address: 0xFF00
command: 0xB946
on_press:
then:
- switch.turn_on: Fireplace_Power_Toggle
- delay: 1s
- lambda: |-
id(Fireplace_Power_Toggle_IR_Sensor).publish_state(false);
- platform: remote_receiver
name: Fireplace Heat Level IR Sensor
id: Fireplace_Heat_Level_IR_Sensor
nec:
address: 0xFF00
command: 0xBC43
on_press:
then:
- switch.turn_on: Fireplace_Heat_Level
- delay: 1s
- lambda: |-
id(Fireplace_Heat_Level_IR_Sensor).publish_state(false);
- platform: remote_receiver
name: Fireplace Light Level IR Sensor
id: Fireplace_Light_Level_IR_Sensor
nec:
address: 0xFF00
command: 0xF609
on_press:
then:
- switch.turn_on: Fireplace_Light_Level
- delay: 1s
- lambda: |-
id(Fireplace_Light_Level_IR_Sensor).publish_state(false);
# Disable Fireplace Light Toggle
#
# The power to the fireplace light is used as a sensor for overall fireplace power status.
# if the light is turned off, but the fireplace still on - will give a false fireplace power status.
# therefore, disable turning the light on/off
#
# - platform: remote_receiver
# name: Fireplace Light Toggle IR Sensor
# id: Fireplace_Light_Toggle_IR_Sensor
# nec:
# address: 0xFF00
# command: 0xF807
#
# on_press:
# then:
# - switch.turn_on: Fireplace_Light_Toggle
# - delay: 1s
# - lambda: |-
# id(Fireplace_Light_Toggle_IR_Sensor).publish_state(false);
- platform: remote_receiver
name: Fireplace Flame Toggle IR Sensor
id: Fireplace_Flame_Toggle_IR_Sensor
nec:
address: 0xFF00
command: 0xBB44
on_press:
then:
- switch.turn_on: Fireplace_Flame_Toggle
- delay: 1s
- lambda: |-
id(Fireplace_Flame_Toggle_IR_Sensor).publish_state(false);
switch:
- platform: template
name: Fireplace Power Toggle
id: Fireplace_Power_Toggle
turn_on_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xB946
turn_off_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xB946
- platform: template
name: Fireplace Heat Level
id: Fireplace_Heat_Level
turn_on_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xBC43
turn_off_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xBC43
- platform: template
name: Fireplace Light Level
id: Fireplace_Light_Level
turn_on_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xF609
turn_off_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xF609
# Disable Fireplace Light Toggle
#
# The fireplace light is used as a sensor for overall fireplace power status.
# if the light is turned off, but the fireplace still on - will give a false fireplace power status.
# therefore, disable turning the light on/off
#
# - platform: template
# name: Fireplace Light Toggle
# id: Fireplace_Light_Toggle
# turn_on_action:
# remote_transmitter.transmit_nec:
# address: 0xFF00
# command: 0xF807
# turn_off_action:
# remote_transmitter.transmit_nec:
# address: 0xFF00
# command: 0xF807
- platform: template
name: Fireplace Flame Toggle
id: Fireplace_Flame_Toggle
turn_on_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xBB44
turn_off_action:
remote_transmitter.transmit_nec:
address: 0xFF00
command: 0xBB44