HeaterMeter integration

@idomp

I forked your fork. :wink:

I added the Alarm code, and made a few other adjustments. Unfortunately I didnā€™t have time to fix the Temperature C/F and reverted it back F for my purposes.

1 Like

Great job!
my HeaterMeter was broken. just got it fixed a couple of weeks ago. so zero progress from my side.

The change from ā€œCā€ to ā€œFā€ is mostly cosmetic, as the API use the absolute numbers.
removing the user/password break the support for older (or not up-to-date) HeatMeters. as it doesnā€™t harm anything, I think its good practice to support backwards if possible.

I hope that I can get back to adding the missing features soon - Iā€™ll merge what i can from your branch when i do.

Just wanted to say thank you!! Works great!! I love the heatermeter.

1 Like

I implemented automatic temperature unit selection based on ā€˜Unit Systemā€™ setting in Configuration\General. Its a bit ugly (most of my code is) but it works.

1 Like

New features added:

  • High/Low Alarm Sensors for each probe.
  • Added ā€˜set_alarmsā€™ service to set probe alarms.

Thereā€™s MQTT support (readonly).
Setting stuff still neds the API.
But we do not need to poll the API when using MQTT :slight_smile:

in configuration.yaml I have this example that works.

sensor:  
  - platform: mqtt
    name: Heatermeter pit fan (current)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fan
    unit_of_measurement: "%"
    device_class: power_factor
    value_template: '{{ value_json.fan.c }}'

  - platform: mqtt
    name: Heatermeter pit temperatur (set)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{{ value_json.set }}'
    
  - platform: mqtt
    name: Heatermeter pit temperatur (min)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Pit" %}{{x["a"]["l"] }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter pit temperatur (max)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Pit" %}{{x["a"]["h"] }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter pit temperatur (current)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Pit" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'
    #json_attributes:
    #- temps
    #expire_after: 60
  
  - platform: mqtt
    name: Heatermeter meat1 temperatur
    state_topic: "heatermeter/hmstatus"
    icon: mdi:pig
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat1" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat1 temperatur (min)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat1" %}{{x["a"]["l"] }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat1 temperatur (max)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat1" %}{{x["a"]["h"] }}{{ break }}{% endif %}{% endfor %}'

  - platform: mqtt
    name: Heatermeter meat2 temperatur
    state_topic: "heatermeter/hmstatus"
    icon: mdi:pig
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat2" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'    
    
  - platform: mqtt
    name: Heatermeter meat2 temperatur (min)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat2" %}{{x["a"]["l"] }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat2 temperatur (max)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat2" %}{{x["a"]["h"] }}{{ break }}{% endif %}{% endfor %}'
    
    
  - platform: mqtt
    name: Heatermeter meat3 temperatur (min)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat3" %}{{x["a"]["l"] }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat3 temperatur (max)
    state_topic: "heatermeter/hmstatus"
    icon: mdi:fire
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat3" %}{{x["a"]["h"] }}{{ break }}{% endif %}{% endfor %}'

  - platform: mqtt
    name: Heatermeter meat3 temperatur
    state_topic: "heatermeter/hmstatus"
    icon: mdi:pig
    unit_of_measurement: "Celsius"
    device_class: temperature
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat3" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'    
    

binary_sensor:
  
  - platform: mqtt    
    name: "Heatermeter lid (open)"
    state_topic: "heatermeter/hmstatus"        
    value_template: '{{ value_json.lid }}'
    
  - platform: mqtt
    name: Heatermeter Pit alarm (min)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Pit" %}{{x["a"]["r"] == "L" }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter Pit alarm (max)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Pit" %}{{x["a"]["r"] == "H" }}{{ break }}{% endif %}{% endfor %}'    
  
  - platform: mqtt
    name: Heatermeter meat1 alarm (min)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat1" %}{{x["a"]["r"] == "L" }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat1 alarm (max)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat1" %}{{x["a"]["r"] == "H" }}{{ break }}{% endif %}{% endfor %}'    
    
  - platform: mqtt
    name: Heatermeter meat2 alarm (min)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat2" %}{{x["a"]["r"] == "L" }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat2 alarm (max)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat2" %}{{x["a"]["r"] == "H" }}{{ break }}{% endif %}{% endfor %}'    
    
  - platform: mqtt
    name: Heatermeter meat3 alarm (min)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat3" %}{{x["a"]["r"] == "L" }}{{ break }}{% endif %}{% endfor %}'
    
  - platform: mqtt
    name: Heatermeter meat3 alarm (max)
    state_topic: "heatermeter/hmstatus"    
    value_template: '{% for x in value_json.temps %}{%  if x["n"] == "Meat3" %}{{x["a"]["r"] == "H" }}{{ break }}{% endif %}{% endfor %}'        
    

  

    
1 Like

lmclient @lmss,1 | mosquitto_pub -h 192.168.1.174 -p 1883 -u ā€œsomeuserā€ -P ā€œsomepassā€ -i ā€œheatermeterā€ -t ā€œheatermeter/hmstatusā€ -l

Do I need to put this under the startup tab in home assistant? But change the address to my mqtt address and the user/pass to the mqtt user/pass?

This is exciting. Iā€™m trying to add to my HA and when clicking ā€œCheck Configurationā€, I get the following, ā€œComponent error: heatermeter - Integration ā€˜heatermeterā€™ not found.ā€

ledhed-jgh/HAHeaterMeter

Iā€™m using this one and it works for me, but I have 2 and wondering how to get 2 enabled into Home assistant.

You guys have any idea on how to integrate 2 into Home Assistant?

Figured out how to have 2 in there. Just changed the names to heatermeter2ā€¦ LOLā€¦ Now Iā€™m trying to get the alarms to have a set feature like the Setpoint. i see that i can call the service and change the individual alarmsā€¦ alarms: ā€˜-190,-250,-100,-205,-100,-100,-100,-100ā€™ā€¦ But how do i just expose one alarm instead of doing all 8?

@Chris8837

Sorry for the late response, I havenā€™t had much time lately to work on this integration.

Unfortunately the HeaterMeter API doesnā€™t provide a method to update an individual alarm value.
Iā€™ve created an Entities Card and am working on a script to read the input numbers and send them to the set_alarms service. The HeaterMeter API interprets negative values as a disabled alarm.

entities:
  - type: section
    label: Pit
  - entity: input_number.probe0_hi
    name: 'Hi:'
  - entity: input_number.probe0_lo
    name: 'Lo:'
  - type: section
    label: Food-1
  - entity: input_number.probe1_hi
    name: 'Hi:'
  - entity: input_number.probe1_lo
    name: 'Lo:'
  - type: section
    label: Food-2
  - entity: input_number.probe2_hi
    name: 'Hi:'
  - entity: input_number.probe2_lo
    name: 'Lo:'
  - type: section
    label: Ambient
  - entity: input_number.probe3_hi
    name: 'Hi:'
  - entity: input_number.probe3_lo
    name: 'Lo:'
  - type: section
  - action_name: Set
    icon: 'mdi:blank'
    name: ' '
    service: script.heatermeter_set_alarms
    type: call-service
title: Alarms (Incomplete)
type: entities

This is exciting, MQTT would be my preference to monitor sensors. I may add a config option that allows you to specify whether you want to use MQTT or API sensors.

1 Like

Canā€™t wait to try it.

Thanks!!

@Chris8837

Entities Card

entities:
  - action_name: Refresh
    icon: 'mdi:refresh'
    name: ' '
    service: script.update_heatermeter_input_numbers
    type: call-service
  - type: section
    label: Pit
  - entity: input_number.probe0_hi
    name: 'Hi:'
  - entity: input_number.probe0_lo
    name: 'Lo:'
  - type: section
    label: Food-1
  - entity: input_number.probe1_hi
    name: 'Hi:'
  - entity: input_number.probe1_lo
    name: 'Lo:'
  - type: section
    label: Food-2
  - entity: input_number.probe2_hi
    name: 'Hi:'
  - entity: input_number.probe2_lo
    name: 'Lo:'
  - type: section
    label: Ambient
  - entity: input_number.probe3_hi
    name: 'Hi:'
  - entity: input_number.probe3_lo
    name: 'Lo:'
  - type: section
  - action_name: Set
    icon: 'mdi:blank'
    name: ' '
    service: script.heatermeter_set_alarms
    type: call-service
title: Alarms
type: entities

script.heatermeter_set_alarms

heatermeter_set_alarms:
  alias: HeaterMeter Set Alarms
  sequence:
  - service: heatermeter.set_alarms
    data_template:
      alarms: '{{ states("input_number.probe0_lo") }},{{ states("input_number.probe0_hi") }},{{ states("input_number.probe1_lo") }},{{ states("input_number.probe1_hi") }}",{{ states("input_number.probe2_lo") }},{{ states("input_number.probe2_hi") }},{{ states("input_number.probe3_lo") }},{{ states("input_number.probe3_hi") }}'
  mode: single

script.update_heatermeter_input_numbers

update_heatermeter_input_numbers:
  alias: Update HeaterMeter Input Numbers
  sequence:
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe0_hi") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe0_hi") | int }}
        {% endif %}'
    entity_id: input_number.probe0_hi
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe0_lo") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe0_lo") | int }}
        {% endif %}'
    entity_id: input_number.probe0_lo
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe1_hi") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe1_hi") | int }}
        {% endif %}'
    entity_id: input_number.probe1_hi
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe1_lo") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe1_lo") | int }}
        {% endif %}'
    entity_id: input_number.probe1_lo
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe2_hi") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe2_hi") | int }}
        {% endif %}'
    entity_id: input_number.probe2_hi
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe2_lo") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe2_lo") | int }}
        {% endif %}'
    entity_id: input_number.probe2_lo
  - service: input_number.set_value
    data_template:
      value:
        '{% if states("heatermeter.probe3_hi") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe3_hi") | int }}
        {% endif %}'
    entity_id: input_number.probe3_hi
  - service: input_number.set_value
    data_template:
      value: 
        '{% if states("heatermeter.probe3_lo") == "-" %}
          {{ -1 | int }}
        {% else %}
          {{ states("heatermeter.probe3_lo") | int }}
        {% endif %}'
    entity_id: input_number.probe3_lo
  mode: single

Iā€™ll update the Github Readme tomorrow. Done. I also added an example automation to announce when your food is ready.

1 Like

So awesome!!

Iā€™ll check it out tomorrow.

Thanks for all your work with this. Really appreciate it.

Updated everything to the new scriptsā€¦ Works great!!

1 Like
alias: Update Heatermeater (No/Therm) Alarms
description: ''
trigger:
  - platform: state
    entity_id: heatermeter.probe0_hi
  - platform: state
    entity_id: heatermeter.probe0_lo
  - platform: state
    entity_id: heatermeter.probe1_hi
  - platform: state
    entity_id: heatermeter.probe1_lo
  - platform: state
    entity_id: heatermeter.probe2_hi
  - platform: state
    entity_id: heatermeter.probe2_lo
  - platform: state
    entity_id: heatermeter.probe3_hi
  - platform: state
    entity_id: heatermeter.probe3_lo
condition: []
action:
  - service: script.turn_on
    data:
      entity_id: script.update_heatermeter_input_numbers
mode: single

I added an automation to update the alarms from the interface in the Native Heatermeter page. So now all is in sync if I update from there.

I was doing it when probe0_temperature changed from Unknown, which basically updated the alarm values when the HM was first turned on after being off for a period of time.

Yours is better since any change to any alarm value will cause an update. Excellent!!!

Do you mind if I add it to the GitHub Readme?

Absolutely!!