Jump to content

Monitoring a wood stove flue temp and capturing the data


Recommended Posts

Posted

Those that heat or augment their heating with wood stoves are always concerned with control.  I use surface temperature probes to monitor the blower air temp, but you have to be watching them.  I also use a flue insert probe to monitor the temperature of the gases coming out of the firebox, but again it is a physical readout and you have to physically monitor the performance. 
 

Since my stove is in the basement, it concerns me that if an over temp situation is brewing that I could miss it. 
 

What I want to do is to use a k-type probe designed for inserting into the flue pipe and capture the temperature reading so my EISY can notify me to address the situation.  
 

Insulated k-type thermocouples are widely available and there are lots of discussions about using an Arduino to gather data, but I have not seen discussions about capturing the data and sending it with a REST command to the EISY.   I do something similar with the DS18B20 and a WebController CAI 8bit board for monitoring room temperatures and I was looking to see if there was a way to do something similar with a k-type thermocouple  

Any thoughts?

Posted
3 minutes ago, ISY4Me said:

Those that heat or augment their heating with wood stoves are always concerned with control.  I use surface temperature probes to monitor the blower air temp, but you have to be watching them.

I have a wood stove. I added a furnace air return on one wall above it, with an older Venstar thermostat (T6800) that activates a blower in the air return to draw more air into it when the temperature exceeds a threshold. It's an external thermistor mounted just behind the return grille. This particular thermostat isn't compatible with the eisy Venstar plugin, but a newer one could be used (I also have two T7900's working with the plugin). An alternative thermostat would be an Insteon 2441TH, often available used for very cheap. The temperature sensing thermistor in those is very easily accessed and removed for mounting externally. I actually have two of these that I'll be using for a solar pool heating project, to have the eisy turn the diverter valve based on the water temperature vs the air temperature in the rooftop panel boxes. I've been doing this for years with my Ocelot automation controller but this will now be an improved version on the eisy.  

For the wood stove, you'd be monitoring the air temperature close to it, the thermostat's temperature range isn't high enough to directly monitor surface temperatures, but you could establish a correlation of the air temperatures vs surface temperatures first, and go with that.

  • 2 weeks later...
Posted

Thank you @Guy Lavoie, but since there is always going to be some lag in temperatures my objective it to directly monitor the temperature where the flue mounts to the stove.  I have experienced some overtires that happen very quickly, so I believe the lag could be a factor.

I have made some advances since the original posting.  Using a K-Type steel encased probe with insulated cable you will be able to drill a small 1/4" hole in the flue pipe and directly insert the probe.  With the k-Type signal being low amplitude, it is recommended to connect it to an amplifier... I used a MAX31855.

This morning I connected every thing together on a Raspberry Pi and tested on the workbench and everything works as expected.  I did not test with a blow torch, but this k-type probe is listed to work/monitor over 1000C.

I put together the python code to extract and display the temperature and that works as well.  However not being a fluent Python programmer, I feel I missing the key feature of being able to write that variable to an EISY state variable using REST.

I use the Webcontroller WC8 PCL to do this for low temperatures from a DB18B20 thermocouple using the PLC built in settings and that works fine in pushing the temp to the EISY variable.  However, trying to emulate that and sending a URL from the Raspberry Pi no data is written.

Can any users offer some guidance?

Posted
41 minutes ago, ISY4Me said:

Can any users offer some guidance?

Can't help with the specific application and certainly not programming, but have you considered something like a YoLink monitor with the cable attachment?

https://shop.yosmart.com/collections/smart-sensors/products/ys8004?_pos=1&_fid=4068542a8&_ss=c

Not sure what your temps are reaching where you are trying to measure, but this seems to handle up to 200°F+ (the "sensor" operating range only up to 158°F, but alerts up to 221°F). Then getting the YoLink plugin to get alerts and other automation with the IoX system. 

I know a lot of members here (myself included) use the YoLink products (and the plugin) for other general monitoring and other product inclusion with the IoX system. Worth looking into.

Posted

@Geddy  The K hardware can handle well past 1000F.  It appears the problem I have now is getting the output from a Raspberry Pi Python code into the EISY. 

It is a work in progress and I am sure I will learn more once I get past the point where I am.  I seem to be stuck on how to use REST on the RPi running Python to push data to a state variable in EISY.

  • Like 1
Posted
2 hours ago, ISY4Me said:

 I seem to be stuck on how to use REST on the RPi running Python to push data to a state variable in EISY.

Are you able to open a socket in Python, connect to a tcp socket, and send raw data? If so, I can give you some help with what the raw bytes need to be to create a REST request.

Posted

Well let me dig up the sample Python code that I did to do that. I'm still learning Python and created two plugins, in wanting to learn to create a fancier one. I have a code sample that connects to a socket and writes data, and I also have VB6 samples of creating REST commands, so know how to make http GET commands with raw bytes. I'll just need to put the two together...

I might have a chance to check that out tomorrow.

 

Posted (edited)

I had a bit of time this afternoon and got it tested and working. Here is a python test program that sends "/rest/vars/set/2/6/9" to a eisy at IP address 192.168.0.145. This sets state variable id #6 to a value of 9. 

Notice the part "Basic cGFzc3dvcmQ=", that's the admin password "password" encoded to a Base 64 value (I used "password" so that you can test that you get the same result, you'll need to encode you own password). You an encode a password here:

https://www.base64encode.net/

Let me know if that works!

 

 

 

import socket

HOST = "192.168.0.145"

PORT = 8080

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:

      s.settimeout(2)

      try:

            s.connect((HOST, PORT))

      except socket.timeout as err:

            print("timeout!")

      except socket.error as err:

            print("error!")

      else:

            # send REST command

            s.sendall(b"GET /rest/vars/set/2/6/9 HTTP/1.0\x0d\x0aHost: 192.168.0.145\x0d\x0aAuthorization: Basic cGFzc3dvcmQ=\x0d\x0a\x0d\x0a")

            data = s.recv(1024)

            s.close

                        print(f"received {data!r}")

Edited by Guy Lavoie
Posted

I took a look and understand some of your method.  I copied it in Python did the necessary changes and I am getting a timeout on the data = s.recv(1024) line.  I noticed that things are running slow right now so I will try again later.

On my side I too was able to get the Python code doing mostly what I want.  The Python on the RPi does the temp extraction very reliably and has demonstrated that it can push it over to the EISY.  The current and hopefully last issue with this approach is when data loops. the EISY will not update the data point, the value has to change for that to occur.  Even when I force the state variable to change in the Python code it is not always updating... so a little more work to do there too.

I will update you when I can look at your code.

Posted

I just resolved why the EISY variable was not updating.  

In the string that sets up the GET line, I was just using the temp variable defined in Python.  Originally I wrote the GET Line (abbreviated) /rest/vars/set/2/6/9 I simply replaced the value (9 in your code) with the Python variable.

The problem with that is the Python was a floating variable and would not allow a floating variable to be added to a string.  After looking deeper, it also appears that the str() command will round off the floating number.  To adjust for that I multiply the floating variable by x10 first, then convert to a string then concatenate the data of the variable... so now it looks like /rest/vars/set/2/6' + str(tempF).  I will have to think about this as there was similar when using the WebController WC8, so I may end up x100 and then on the EISY side simply divide by 100 to get a xx.xx floating temp.

This day has brought more progress than I expected.  I will look at your suggest and see which will be more efficient, but it is clear there is a way.  Thank you so much... your comments help me thing through what I was try to do as well.

Posted

Start by sending a hardcoded value, just to test that the plumbing works. Then you can work in your actual data and other details.

Posted (edited)

I have modified the target EISY IP and the data variable ID and value and the authorization encrypted and I believe that is all.  When I run your code it gives me

Traceback (most recent call last):
  File "/home/pi/Programming/MAX31855/FromGuyLavoie.py", line 28, in <module>
    data = s.recv(1024)
socket.timeout: timed out

I have compared the files multiple times and see no differences.  The only thing I could not find help on is whether or not there is a package I have to install to "import sockets".

Edited by ISY4Me
Posted

Well that's the thing you need to determine. That test program is pretty well the absolute minimal program you can have to try this. If you're getting a timeout error on the "recv" part, then the initial "connect" seems to be working, but not getting the response. Try just connecting first. Like this (changes are after the "else" statement).

import socket

HOST = "192.168.0.145"

PORT = 8080

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:

      s.settimeout(2)

      try:

            s.connect((HOST, PORT))

      except socket.timeout as err:

            print("timeout!")

      except socket.error as err:

            print("error!")

      else:

            print ("connected")

 

Posted

I quickly isolated that there was an issue with the s.sendall line.

After finding a relatively good web document on constructing web links for sockets, I had everything working.  When I compared the working s.sendall line to the original I found that there was a syntax error when the original line was copied.

With both my original approach using the requests method or the sockets method, do you feel the sockets method will be faster and/or more reliable?

At this point I am pleased that both methods are working and I have options.  Many thanks. 

  • Like 1
Posted


From zero to two solutions...isn't life grand?
Really, whatever works for you. I don't think we can say there is a right or wrong way. I usually like to stick to the most adaptable way (that I can reuse in the future). The sockets method is the lowest level, and can be adapted for use with other things like tcp connections, raw, etc. Think of the options you see in the networking module on the eisy.

  • Like 1
Posted

Thank you to all that provided suggestions.  Using a k-type thermocouple (design options will limit the highest temp you are monitoring), MAX31855 as the signal amplifier and a Raspberry Pi to read the temperature data from the amplifier… then push the data to the EISY using REST.  Both @Guy Lavoie suggestion to use sockets and my original http formatted for EISY REST worked great. 
 

I did find one restriction in choosing to use the MAX31855 as the amplifier… it will not allow the use of a grounded thermocouple.  If you have a grounded thermocouple you can use the older MAX6675 (discontinued but still available new) and it allows use of grounded thermocouples to extract the data using the Raspberry modules. 
 

You will want to be careful which thermocouple you purchase.  If you want to go to the max levels of a k-type you will need to be very selective as to the thermocouple construction.  If you want to protect the thermocouple from the atmosphere, look at the shielded type,  but be aware the shielded design couple limit your max temperature to approximately 500C - 600C due to how it is constructed.  A pure ceramic non-shielded thermocouple will probably be the best way to get readings all the way to 1300C. 

Posted

So what exactly are you reading with the amplifier, a voltage? What is the voltage range? I imagine that the output impedance of a thermocouple is pretty high, so a very high input impedance is needed for the amplifier. And the Raspberry pi is providing an analog to digital input?

A description and/or block diagram would be interesting.  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...