Tenergy Solis 6 Meat thermometer - openmqttgateway - HA integration

I spent a great deal of time on getting my meat thermometer to work the way i wanted in HA, so i figured i would post here and maybe someone out there might have a cleaner way of doing what i did. I have only known about and HA for a few months and esp boards even less but here goes.

First off i used openmmqttgateway to integrate my tenergy with mqtt. @1technophile was extremely helpful in this so i will link to that conversation rather than go through it again.

Once i got the esp32 populating the mqtt, and whitelisted only the device i cared about (there were over 100 devices coming up), thanks to the openmqttgateway, HA sensors were automatically created wihch i could then use for my dashboard.

From there i borrowed liberally from @Nathan_Byrer (who borrowed from @stogs ) for my initial dashboard.
image
I from there ran into some small issues and wanted to post them and how i resolved them to see if there is anyone out there that knows better ways of doing it.

  1. When the thermometer is not reporting anymore (turned of for instance) whatever the last measurement was left as the current value. unless of course HA was reset in which case unknown was the value.
  2. When probes were not plugged in (this unit has 6, and often we only use a couple) the values that were returned were over 10K degrees. This rendered the History graph pretty useless.

For number 1

i created some new template sensors to be used for the dashboard cards including the probes, the visual rainbow graph, and the history graph…

  - platform: template
    sensors:
      grill_probe1_status:
        unit_of_measurement: "°F"
        value_template: >
          {% if states.sensor.solis_6_tempc.state == "unknown" %}
            0
          {% elif states.sensor.solis_6_tempc.state | int > 1000 %}
            0
          {% else %}
            {{ states.sensor.solis_6_tempc.state | int}}
          {% endif %}


      grill_probe2_status:
        unit_of_measurement: "°F"
        value_template: >
          {% if states.sensor.solis_6_tempc2.state == "unknown" %}
            0
          {% elif states.sensor.solis_6_tempc2.state | int > 1000 %}
            0
          {% else %}
            {{ states.sensor.solis_6_tempc2.state | int}}
          {% endif %}
      grill_probe3_status:
        unit_of_measurement: "°F"
        value_template: >
          {% if states.sensor.solis_6_tempc3.state == "unknown" %}
            0
          {% elif states.sensor.solis_6_tempc3.state | int > 1000 %}
            0
          {% else %}
            {{ states.sensor.solis_6_tempc3.state | int }}
          {% endif %}
      grill_probe4_status:
        unit_of_measurement: "°F"
        value_template: >
          {% if states.sensor.solis_6_tempc4.state == "unknown" %}
            0
          {% elif states.sensor.solis_6_tempc4.state | int > 1000 %}
            0
          {% else %}
            {{ states.sensor.solis_6_tempc4.state | int }}
          {% endif %}
      grill_probe5_status:
        unit_of_measurement: "°F"
        value_template: >
          {% if states.sensor.solis_6_tempc5.state == "unknown" %}
            0
          {% elif states.sensor.solis_6_tempc5.state | int > 1000 %}
            0
          {% else %}
            {{ states.sensor.solis_6_tempc5.state | int }}
          {% endif %}
      grill_probe6_status:
        unit_of_measurement: "°F"
        value_template: >
          {% if states.sensor.solis_6_tempc6.state == "unknown" %}
            0
          {% elif states.sensor.solis_6_tempc6.state | int > 1000 %}
            0
          {% else %}
            {{ states.sensor.solis_6_tempc6.state | int }}
          {% endif %}

this fixed the issue with the huge phantom temps and the unknown readings.

for number 2
this one i had a little problem figuring out. but ultimately the road i went down was to literally post to the mqtt where openmqttgateway posts to replacing the values with zeros in Celsius. I did this with Node Red.
image
It watches the topic for updates and puts them through the JSON node (which converts the mqtt topic to an object) then through the function node ( which checks if there is NOT a 0 in the msg.payload.tempf attribute)

if (msg.payload.tempf != 0) 
{
 return msg
} 

else if (msg.payload.tempf == 0) 
{
 return
}

I have since removed the switch since the function returns nothing of the tempf = 0. Then the trigger node does nothing, waits 6 minutes, then sends the following json right back into the original mqtt topic in JSON format.
image
image

This replicates what the thermometer would normally send but with zero values (-17.7778 for the Celsius values since that appears to be where openmqttgateway is sourcing its temps but likely converting them to F somewhere along the way)

Finally you will note that i had -17.7778 for those temps, well that resulted in the probes on the dashboard reading -0.0. the negative was annoying to me so this is why i added “int” to the end of the ELSE lines in the sensors i created earlier. Perhaps someone smarter than i can tell me why that worked, because its my understanding that an integer is a whole number, and could be negative or positive. the only thing i can think of is perhaps the int recognizes that the number is zero and understands that there is no negative zero.

And of course when that node red flow posts to the mqtt topic with zeros, it also pops up a notification in my phone letting me know that it did that. this was for a couple reasons. first, once in a while the thermometer just stops posting to HA. i don’t know why, and at the moment i don’t know what to blame, but either way i want to be notified of the temp stops updating for more than 6 minutes. also usually when it is updating, it changes more than once in 6 minutes so the node red flow does not trigger.

so, if anyone can help with cleaning up what i got, by all means, I’m all ears

if anyone needs help getting to where i am at with this thermometer, let me know.

2 Likes

Thanks for sharing your experience!

For information @digih have added to the development version of the decoder improvements that will avoid publishing the temperature if the probe is not connected:

I will integrate this into OpenMQTTGateway and TheengsGateway soon.