MQTT and Heatermeter 'Code' (SUCCESS!!!)


 

Chris D Norton

TVWBB Member
Took me a bit but I finally figured this out.. LOL (Here is all that you need to connect this to Home Assistant over MQTT... I just need to read.. If i want to adjust I go to the app or the actual site.. But if anyone knows how to use the API in some other way let me know.. I'm pretty Amateur.. I have 2 so one is called blue and one is called black.. I just posted the blue stuff.. but below the lines in the yaml file will be the black, or whatever you have.. If you have 2..

This goes in your 'Local Startup" (sleep 15 was the final issue that i found to work)

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

sleep 15

lmclient @LMSS,1 | mosquitto_pub -h 192.168.1.xx -p 1883 -u 'usermqtt' -P 'passmqtt' -i 'heatermeterblue' -t 'heatermeterblue/hmstatus' -l

exit 0

Heatermeter YAML file (You have to have the name in the valu_template the same as the Heatermeter...
Mine is in

mqtt: !include mqtt.yaml


sensor:

#Heatermeter(Blue)

- name: Heatermeter Fan (Blue)
state_topic: "heatermeterblue/hmstatus"
icon: mdi:fan
unit_of_measurement: "%"
device_class: power_factor
value_template: '{{ value_json.fan.c }}'


- name: Heatermeter Set Temperature (Blue)
state_topic: "heatermeterblue/hmstatus"
icon: mdi:fire
# unit_of_measurement: "Fahrenheit"
device_class: temperature
value_template: '{{ value_json.set }}'


- name: Heatermeter Pit Temperature (Blue)
state_topic: "heatermeterblue/hmstatus"
icon: mdi:fire
# unit_of_measurement: "Fahrenheit"
device_class: temperature
value_template: '{% for x in value_json.temps %}{% if x["n"] == "Pit" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'


- name: Heatermeter Probe 1 (Blue)
state_topic: "heatermeterblue/hmstatus"
icon: mdi:pig
# unit_of_measurement: "Fahrenheit"
device_class: temperature
value_template: '{% for x in value_json.temps %}{% if x["n"] == "Probe1" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'


- name: Heatermeter Probe 2 (Blue)
state_topic: "heatermeterblue/hmstatus"
icon: mdi:pig
# unit_of_measurement: "Fahrenheit"
device_class: temperature
value_template: '{% for x in value_json.temps %}{% if x["n"] == "Probe2" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'


- name: Heatermeter Probe 3 (Blue)
state_topic: "heatermeterblue/hmstatus"
icon: mdi:pig
# unit_of_measurement: "Fahrenheit"
device_class: temperature
value_template: '{% for x in value_json.temps %}{% if x["n"] == "Probe3" %}{{x["c"] }}{{ break }}{% endif %}{% endfor %}'
 
For some reason the mdi should end in p i g, but this website puts a smiley in there.

Here is the full mqtt that was from an old Forum page Home Assistant if you want to reference the rest.. You'll notice that MQTT has changed to its own yaml in home assistant now.
 

Attachments

 

Back
Top