Hi @joostvanmourik - rather than emulating the remote control as others here have done, I went the route of using ESPhome and an ESP8266 board with 4x dry relay board to interface with our fireplace gas log with Maxitrol controller. As I was already running a cable (some spare cat5e in this case) to the firebox to the controller, I also ran 5V DC +/- to power the controller externally, rather than swapping controller AA batteries annually, which is a nice extra bonus for this project.
This probably isn’t the most elegant software solution, but this works for me - I control the gas log via individual scripts which send various relay commands, all controlled through a virtual thermostat using an occupancy/motion sensor in the room which can also sense temperature. It will also turn off the fireplace if there’s no motion in the room for > 60 minutes.
On each script, I reset the relays first:
sequence:
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_1
domain: switch
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_2
domain: switch
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_3
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
mode: single
alias: Reset Fireplace Relays
icon: mdi:electric-switch
Fireplace ignition (creates spark to ignite the pilot light):
alias: Fireplace Ignition
sequence:
- service: script.reset_fireplace_relays
data: {}
- type: turn_on
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_1
domain: switch
- type: turn_on
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_3
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_1
domain: switch
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_3
domain: switch
- service: climate.turn_on
target:
entity_id: climate.living_room_fireplace
data: {}
mode: single
icon: mdi:fireplace
Low flame - this requires first turning the flame all the way up, then backing it down a specific amount of time to where the flame is at its lowest point before going out and only the pilot light is lit:
alias: Fireplace Low Flame
sequence:
- service: script.reset_fireplace_relays
data: {}
- type: turn_on
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_1
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 12
milliseconds: 0
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_1
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- type: turn_on
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_3
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 6
milliseconds: 0
- type: turn_off
device_id: cd8f3e24c395179b5ab4d2ffbd33d2ed
entity_id: switch.contact_3
domain: switch
- service: climate.turn_on
target:
entity_id: climate.living_room_fireplace
data: {}
mode: single
icon: mdi:fireplace
Here’s the virtual thermostat:
- platform: generic_thermostat
name: Living Room Fireplace
heater: input_boolean.fireplace_gas_log
target_sensor: sensor.dining_room_occupancy_temperature
cold_tolerance: 1
hot_tolerance: 1
min_temp: 65
max_temp: 75
away_temp: 60
target_temp: 72
precision: 1.0
ac_mode: false
min_cycle_duration: 10
EDIT - Here’s the ESPhome YAML:
esphome:
name: gas-log
platform: ESP8266
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "changeme"
wifi:
ssid: "mySSID"
password: "changeme"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Fireplace Fallback Hotspot"
password: "changeme"
captive_portal:
switch:
- platform: gpio
pin: GPIO5
name: "Contact #1"
id: contact1
icon: "mdi:electric-switch"
inverted: true
restore_mode: ALWAYS_OFF
- platform: gpio
pin: 4
name: "Contact #2"
id: contact2
icon: "mdi:electric-switch"
inverted: true
restore_mode: ALWAYS_OFF
- platform: gpio
pin: 14
name: "Contact #3"
id: contact3
icon: "mdi:electric-switch"
inverted: true
restore_mode: ALWAYS_OFF
sensor:
- platform: wifi_signal
name: "Fireplace Wi-Fi RSSI"
update_interval: 300s
What I’m working on today (and what made me find this thread) is a more intellegant method of automagically controlling flame height, based on the delta between current and target room temperature. For example, in the morning when the room temperature is 55ºF (we have a cold house during winter overnights) and the target temperature is 70ºF, I want the flame set to high. However, as the room tempature approaches 70ºF, say around 68ºF, the flame should lower. Working on that logic now, any pointers would be helpful.