Afterburner MQTT to HomeAssistant

Hi Nicko1,
Sorry for the late reply, where is states Afterburner34C224/ in the config you will need to change 34C224/ to your own specific Afterburner…

But here’s another link i’d like to point you to from pturner1989, this show’s a better way now with perfected thermostat option, but again change his 626E9C/ config to your own…

2 Likes

Where is this thermostat bought from?

@scubieman

This a great little device from down under to control your cheap Chinese diesel heater - a bummer for the rich who can afford a £1k+ Webasto unit as it does not work with that :wink:

Head over to Home and talk to Ray.

3 Likes

​I’ve tried this, it’s cool.

I had two problems though. I does not work remotely (http vs https issue) and although I am Ray’s one of the biggest fan, I don’t particularly like the aesthetics of the web page :slight_smile:

Anyway, thanks for posting it!

I agree, the device is amazing and mine is used daily however the interface is not the strongest area, easy to rectify in Home Assistant though as most of the functionality can be lifted and shifted into a nice dashboard.

Hi All,

Looking at this implementation & seem to be hitting a problem that’s out of my league.
I’m Getting Entities I read for some things but also getting an error in the code.

Any thoughts?

My Code in Configuration.yaml

mqtt:
  climate:
    - name: Van Heating
      action_topic: "AfterburnerFF4E3C/sts/RunState"
      action_template: >
        {% if value in ("0", "1", "6", "7", "8") %}
          off
        {% elif value in ("10", "12") %}
          idle
        {% else %}
          heating
        {% endif %}
      current_temperature_topic: "AfterburnerFF4E3C/sts/TempCurrent"
      max_temp: 35
      min_temp: 8
      modes:
        - "off"
        - "heat"
      mode_state_topic: "AfterburnerFF4E3C/sts/Run"
      mode_state_template: >
        {% if value == "1" %}
          heat
        {% else %}
          off
        {% endif %}
      mode_command_topic: "AfterburnerFF4E3C/cmd/Run"
      mode_command_template: >
        {% if value == "heat" %}
          1
        {% else %}
          0
        {% endif %}
      precision: 0.1
      temperature_command_topic: "AfterburnerFF4E3C/cmd/TempDesired"
      temperature_state_topic: "AfterburnerFF4E3C/sts/TempDesired"
      temp_step: 0.5

  sensor:
    - name: Afterburner Status
      unique_id: afterburner_status
      state_topic: "AfterburnerFF4E3C/sts/RunString"

    - name: Afterburner Error
      unique_id: afterburner_error
      state_topic: "AfterburnerFF4E3C/sts/ErrorString"

    - name: Afterburner Internal Temperature
      unique_id: afterburner_internal_temp
      state_topic: "AfterburnerFF4E3C/sts/TempBody"
      device_class: temperature
      unit_of_measurement: °C
      state_class: measurement

    - name: Afterburner Consumption (Total)
      unique_id: afterburner_consumption
      state_topic: "AfterburnerFF4E3C/sts/TotalFuelUsage"
      unit_of_measurement: mL
      state_class: total_increasing

    - name: Afterburner Pump Rate
      unique_id: afterburner_pump
      state_topic: "AfterburnerFF4E3C/sts/PumpActual"
      unit_of_measurement: Hz
      device_class: frequency
      state_class: measurement

    - name: Afterburner Fan Speed
      unique_id: afterburner_fan
      state_topic: "AfterburnerFF4E3C/sts/FanRPM"
      unit_of_measurement: RPM
      state_class: measurement

    - name: Afterburner Glow Plug
      unique_id: afterburner_glowplug
      state_topic: "AfterburnerFF4E3C/sts/GlowCurrent"
      device_class: current
      unit_of_measurement: A
      state_class: measurement

The Error I’m Seeing in the editor.

Some of the data I can get, but not current Temp.

Any thoughts?

Edit,
In the MQTT Intergration I’m only seein 7 Entities,
They are the ones in the second part on the code,
under the Sensor Section.

Other thing I just found is that if I move the yaml to a different file,
as in mqtt.yaml, and put in an include in configuration.yaml, I don’t see the same error showing in the code editor.

The same 7 entities all still appear Ok.

mqtt:  !include mqtt,yaml

Hi Phil23,

Strange as your config looks the same as mine but mine not showing an error in file editor.

Where it states value not accepted, Valid … does it say anything else after that ?

Have you tried installing MQTT Explorer on your laptop to monitor all MQTT traffic during operation. it’s what helped me build all them entities.

Have it Working now, but it seems to not be receiving a few topics.
The two I can’t get are FuelUsage & FuelRate as seen here.
Have you tried adding them?

They are showing up correctly in MQTT Explorer.

These are the two blocks of code that are not returning values.

  - name: Afterburner Current Usage
    unique_id: afterburner_current_usage
    state_topic: “AfterburnerFF4E3C/sts/FuelUsage”
    unit_of_measurement: mL
    state_class: total_increasing
  - name: Afterburner Fuel Rate
    unique_id: afterburner_fuelrate
    state_topic: “AfterburnerFF4E3C/sts/FuelRate”
  #    unit_of_measurement:
  #    state_class:

Tried removing the Unit & State_Class, but the Broker is still not passing them on to Home Assistant.

I’m stumped… MQTT explorer sees but not HA…

Have you tried to remove your Afterburner webpage card from dashboard?

How often does FuelUsage & FuelRate update in MQTT explorer ?

Loosely speaking about every second.
Or maybe every time there is a change in it’s value in the AB code.

Removing the Card makes no difference & when I look at the States Page in Developer Tools it shows it last read 2 days ago.

Can you post your entire yaml?

Should be noted that currently I have all mine sitting in another file called mtqq.yaml.
I consider that to be irrelevant, as the other 7 entities work & it’s accepted practice what I’ve done with the include.

Edit.

This is my entire mqtt.yaml and its refered to by this in the main config.
For the record its is not running on my main HA instance, it’s on a Test NUC I have that has very little installed.

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text-to-speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
mqtt: !include mqtt.yaml

#mqtt:
climate:
  - name: Van Heating
    action_topic: "AfterburnerFF4E3C/sts/RunState"
    action_template: >
      {% if value in ("0", "1", "6", "7", "8") %}
        off
      {% elif value in ("10", "12") %}
        idle
      {% else %}
        heating
      {% endif %}
    current_temperature_topic: "AfterburnerFF4E3C/sts/TempCurrent"
    max_temp: 35
    min_temp: 8
    modes:
      - "off"
      - "heat"
    mode_state_topic: "AfterburnerFF4E3C/sts/Run"
    mode_state_template: >
      {% if value == "1" %}
        heat
      {% else %}
        off
      {% endif %}
    mode_command_topic: "AfterburnerFF4E3C/cmd/Run"
    mode_command_template: >
      {% if value == "heat" %}
        1
      {% else %}
        0
      {% endif %}
    precision: 0.1
    temperature_command_topic: "AfterburnerFF4E3C/cmd/TempDesired"
    temperature_state_topic: "AfterburnerFF4E3C/sts/TempDesired"
    temp_step: 0.5

sensor:
  - name: Afterburner Status
    unique_id: afterburner_status
    state_topic: "AfterburnerFF4E3C/sts/RunString"

  - name: Afterburner Error
    unique_id: afterburner_error
    state_topic: "AfterburnerFF4E3C/sts/ErrorString"

  - name: Afterburner Internal Temperature
    unique_id: afterburner_internal_temp
    state_topic: "AfterburnerFF4E3C/sts/TempBody"
    device_class: temperature
    unit_of_measurement: °C
    state_class: measurement

  - name: Afterburner Current Usage
    unique_id: afterburner_current_usage
    state_topic: “AfterburnerFF4E3C/sts/FuelUsage”
    unit_of_measurement: mL
    state_class: total_increasing

  - name: Afterburner Consumption (Total)
    unique_id: afterburner_consumption
    state_topic: "AfterburnerFF4E3C/sts/TotalFuelUsage"
    unit_of_measurement: mL
    state_class: total_increasing

  - name: Afterburner Pump Rate
    unique_id: afterburner_pump
    state_topic: "AfterburnerFF4E3C/sts/PumpActual"
    unit_of_measurement: Hz
    device_class: frequency
    state_class: measurement

  - name: Afterburner Fan Speed
    unique_id: afterburner_fan
    state_topic: "AfterburnerFF4E3C/sts/FanRPM"
    unit_of_measurement: RPM
    state_class: measurement

  - name: Afterburner Glow Plug
    unique_id: afterburner_glowplug
    state_topic: "AfterburnerFF4E3C/sts/GlowCurrent"
    device_class: current
    unit_of_measurement: A
    state_class: measurement

  - name: Afterburner Fuel Rate
    unique_id: afterburner_fuelrate
    state_topic: “AfterburnerFF4E3C/sts/FuelRate”
  #    unit_of_measurement:
  #    state_class:

I agree, if most of the entities are reporting then you should be seeing all. Il send over config shortly I’m out atm. But all config is above in one of my first posts.

The only reason I asked to remove your webpage panel (temporarily) is so afterburner is not hosting http page and broadcasting mqtt at the same time.

Is your afterburner mqtt setup the same as my above post?

Are ya’ll resetting fuel consumption through HA or the device itself?

Hi,

sorry for the late reply but haven’t done anything for a year on my campervan project and did not check the forum either :frowning:

Anyway, if you still need the fuel related config, here are the bits from my yaml:

- name: "Afterburner Fuel Usage - Since Last Reset"
      unique_id: afterburner_fuel_usage_since_last_reset
      state_topic: "AfterburnerHeater/sts/FuelUsage"
      unit_of_measurement: 'mL'
      value_template: "{{ value }}"
      icon: mdi:fuel

    - name: "Afterburner Fuel Usage - Total"
      unique_id: afterburner_fuel_usage_total
      state_topic: "AfterburnerHeater/sts/TotalFuelUsage"
      unit_of_measurement: 'mL'
      value_template: "{{ value }}"
      icon: mdi:fuel

    - name: "Afterburner Fuel Usage - Current"
      unique_id: afterburner_fuel_usage_current
      state_topic: "AfterburnerHeater/sts/FuelRate"
      unit_of_measurement: 'mL/hr'
      value_template: "{{ value }}"
      icon: mdi:fuel

Thanks,

It’s Been in the back of my mind lately with Winter coming on.
Just revisiting it’s current state now so I can refresh my mind & make a constructive post.

Suspect something Buggy, given the fact that the Values I can’t see in the Integration appear in MQTT Explorer.

Not sure I understand.
Would the code I posted work or you had the same and it didn’t work?

My problem is really with the “thermostat”. I use the heater in manual mode adjusting only the pump speed as I want to avoid the heater turning on and off constantly. It’s bad for the heater and also use a shit load of electricity when heating up the glow plug every time it switches on or off.

But I need to automate the heating control/pump speed with HA based on the interior temperature.

But I haven’t got a clue…

Just got to trying it & the same results as every other thing I’ve tried.
The value shows in Explorer but not in the entity, sensor.afterburner_current_usage

This is the Code Block:-

  - name: Afterburner Current Usage
    unique_id: afterburner_current_usage
    state_topic: “AfterburnerFF4E3C/sts/FuelUsage”
    unit_of_measurement: mL
    value_template: "{{ value }}"

Fine in MQTT Explorer…

AB Explorer

But the Dashboard & Entity show Unknown.


What’s even More Confusing is that if I go to the MQTT Integration & “Listen to the Topic”
Home Assistant Sees it there.

Usage2

That’s the bit that has me thinking something Buggy is going on.

Further to this,
Looking in the Logs I see no mention of “FuelUsage”

Have enabled Debug Logs, but not sure where else to look.

2024-03-11 13:04:10.289 DEBUG (MainThread) [homeassistant.components.mqtt.client] Transmitting message on AfterburnerFF4E3C/cmd/Refresh: 'None', mid: 616, qos: 0
2024-03-11 13:04:10.606 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/RunState (qos=0): b'10'
2024-03-11 13:04:10.607 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '10' with variables {'entity_id': 'climate.van_heating', 'name': 'Van Heating', 'this': <template TemplateStateFromEntityId(climate.van_heating)>} and Template<template=({% if value in ("0", "1", "6", "7", "8") %}
  off
{% elif value in ("10", "12") %}
  idle
{% else %}
  heating
{% endif %}) renders=146>
2024-03-11 13:04:10.611 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/Run (qos=0): b'1'
2024-03-11 13:04:10.611 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '1' with variables {'entity_id': 'climate.van_heating', 'name': 'Van Heating', 'this': <template TemplateStateFromEntityId(climate.van_heating)>} and Template<template=({% if value == "1" %}
  heat
{% else %}
  off
{% endif %}) renders=146>
2024-03-11 13:04:10.612 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/RunString (qos=0): b'Suspended'
2024-03-11 13:04:10.612 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/TempCurrent (qos=0): b'26.8'
2024-03-11 13:04:10.615 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/TempDesired (qos=0): b'22.5'
2024-03-11 13:04:10.615 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/TempBody (qos=0): b'26.0'
2024-03-11 13:04:10.617 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/ErrorString (qos=0): b'E-00: OK'
2024-03-11 13:04:10.620 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/PumpActual (qos=0): b'0.0'
2024-03-11 13:04:10.622 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/FanRPM (qos=0): b'0'
2024-03-11 13:04:10.625 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/GlowCurrent (qos=0): b'0.0'
2024-03-11 13:04:10.628 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/TotalFuelUsage (qos=0): b'488848.8'
2024-03-11 13:04:11.552 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/RunState (qos=0): b'10'
2024-03-11 13:04:11.553 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '10' with variables {'entity_id': 'climate.van_heating', 'name': 'Van Heating', 'this': <template TemplateStateFromEntityId(climate.van_heating)>} and Template<template=({% if value in ("0", "1", "6", "7", "8") %}
  off
{% elif value in ("10", "12") %}
  idle
{% else %}
  heating
{% endif %}) renders=147>
2024-03-11 13:04:11.630 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on AfterburnerFF4E3C/sts/Run (qos=0): b'1'
2024-03-11 13:04:11.631 DEBUG (MainThread) [homeassistant.components.mqtt.models] Rendering incoming payload '1' with variables {'entity_id': 'climate.van_heating', 'name': 'Van Heating', 'this': <template TemplateStateFromEntityId(climate.van_heating)>} and Template<template=({% if value == "1" %}
  heat
{% else %}
  off
{% endif %}) renders=147>
2024-03-11 13:04:11.631 DEBUG (MainThread) [homeassistant.components.mqtt.client] Received message on 

Hmm, this is the whole code in yaml (deleted some unrelated sensors).
What I noticed you missed some quotes and double quotes but I reckon if your other sensors are the same and present then does not make a difference…

#Afterburner Sensors & Switches
mqtt:
  sensor:

    - name: "Afterburner Pump Rate - Desired"
      unique_id: afterburner_pump_rate_desired
      state_topic: "AfterburnerHeater/sts/PumpFixed"
      unit_of_measurement: 'Hz'
      value_template: "{{ value }}"  
      icon: mdi:pump

    - name: "Afterburner Pump Rate - Current"
      unique_id: afterburner_pump_rate_current
      state_topic: "AfterburnerHeater/sts/PumpActual"
      unit_of_measurement: 'Hz'
      value_template: "{{ value }}"  
      icon: mdi:pump

    - name: "Afterburner Fuel Usage - Since Last Reset"
      unique_id: afterburner_fuel_usage_since_last_reset
      state_topic: "AfterburnerHeater/sts/FuelUsage"
      unit_of_measurement: 'mL'
      value_template: "{{ value }}"
      icon: mdi:fuel

    - name: "Afterburner Fuel Usage - Total"
      unique_id: afterburner_fuel_usage_total
      state_topic: "AfterburnerHeater/sts/TotalFuelUsage"
      unit_of_measurement: 'mL'
      value_template: "{{ value }}"
      icon: mdi:fuel

    - name: "Afterburner Fuel Usage - Current"
      unique_id: afterburner_fuel_usage_current
      state_topic: "AfterburnerHeater/sts/FuelRate"
      unit_of_measurement: 'mL/hr'
      value_template: "{{ value }}"
      icon: mdi:fuel

    - name: "Afterburner Thermostat Mode"
      unique_id: afterburner_thermostat_mode
      state_topic: "AfterburnerHeater/sts/Thermostat"
      value_template: "{{ value }}"
      icon: mdi:thermostat

  switch:
    - name: "Afterburner On/Off Switch"
      unique_id: afterburner_onoff_switch
      state_topic: "AfterburnerHeater/sts/Run"
      command_topic: "AfterburnerHeater/JSONin"
      payload_on: '{"Run":1}'
      payload_off: '{"Run":0}'
      state_on: "1"
      state_off: "0"
#      optimistic: false
#      retain: false
#      qos: 0
      icon: mdi:power