Reading Pit Temperature with bash script


 

ScottZ

New member
This is going to sound like a total newb question, but what is the syntax for reading the pit temperature?

command:
lmclient LMST,pcurr0

returns:
OK

I have been referencing the wiki page and can set/config values, but I am not sure how to readback such things at "pcurr0", etc. I have tried various parameter usage the the "lmclient" via a SSH when remoting into the Heatermeter. I am looking to read the value into a variable in a bash script.

https://github.com/CapnBry/HeaterMeter/wiki/Alarm-Script-Recipes

Thanks,

Scott
 
Ah, to answer my own question. I didn't have good results into the forum search and had better luck through Google. I am in the process of learning the scripting features of the Heatermeater and haven't run across the available options of the lmclient.

I found someones email code to read the temperature:
lmclient LMGT,pcurr0

https://tvwbb.com/archive/index.php/t-68163.html

Nevermind... :)
 
Thanks Steve. I am not familiar how to tap into the JSON stream. From the quick search I did it looks something like using curl and probably piping into jq to parse the desired fields.

For the ash script I had to use "PitTemp=$(lmclient LMGT,pcurr0)". This allowed me to get a number for follow-on comparisons.

I am using shell scripts and discovered a number of things missing from "ash" versus "bash" scripts. For example I didn't know that bash couldn't do floating point math. I'm so used to C, C++, and Python. But I did find a way by using "bc" to do the calculations. Example: SetPoint=`echo "$SetPoint+($PhaseOneRate*$tdelay)" | bc -l`

This is for a project where I am re purposing the Heatermeter to be a coffee roaster controller. I am having good luck using a time delay control in the background to change the setpoint to various controlled ramp-ups to give an exponential rise profile. I may post the details in another forum post after further testing.
 

 

Back
Top