Extract certain item state changes, for later analysis

The current situation
I’ve got a temperature sensor in my gas fireplace, and I hoped it would register temperature changes that were immediate and significant enough to easily register whether the fireplace was on or off. Unfortunately, if the temperature inside the fireplace had dropped to room temperature, it doesn’t register a significant rise until after a few minutes, and if the fireplace is being shut down before it had reached its maximum temperature, the sensor keeps registering rising temperatures for minutes after shut-down.

What I ultimately want to achieve
I want openHAB to know as quickly as possible whether the fire is on or off.

How I think I could try to tackle this problem
I hope that if I gather a significant amount of data (the registered temperatures and the status change of the on-off switch), I can somehow find a pattern, based on which I can write a rule. Or better yet (since finding patterns yourself is so 2022), have some AI do it :stuck_out_tongue:

But:

  1. I don’t know the cleanest way to extract all status updates, for only a few selected items.
  2. I have no idea how I could get that data “analyzed” by AI. :slight_smile:

I assume we’ll start with first things first? :slight_smile:

Does anyone have some tips?

Thanks in advance!

Is this switch for the fireplace? Meaning, you know when it’s turned on/off, and just want to verify whether it’s functioning properly?

If this is the case and you’re finding that it’s unreliable, I’d recommend getting a technician to service your fireplace. If it’s not turning on consistently, it could just be that the thermopile needs cleaning or replacement. If it’s not turning off, you may have bigger issues.

I’m not sure what a rule would accomplish. If you can’t trust the fireplace and aren’t physically present to confirm it yourself, you need a device to do that for you. A rule based on a pattern would only be a guess, not a confirmation. Am I misunderstanding your intentions?

I would just use an external temperature sensor mounted close to the fireplace (e.g. on the underside of the mantel). Since it’ll be outside of the chamber, it should react very quickly to temperature changes from the fire starting or stopping.

Apologies for the vagueness. I’ve attached an ESP32 driven relais to what should be the contacts for an expensive Wi-Fi module. I haven’t had any issues there, but I would like a check.

Furthermore, the fireplace can still be switched on or off by the out-of-the-box remote. And ideally, openHAB would pick up on those status changes. The ESP32 board only sends out signals, it doesn’t receive any from the fireplace.

The temperature sensor I talk of, is a MAX6675 (which I installed in the fireplace), linked to the same ESP32, so it’s not an ‘official’ part of the fireplace.

It’s down there somewhere:

I think the issue is the placement of the sensor, which only enables it to measure ambient temperature in the fireplace.

When the fireplace turns on, it will take awhile to heat the entire chamber. And since the heat rises, the bottom (where the sensor is located) is the last spot to warm up. It’s also going to be slow to react when the fireplace turns off, since it’s reading the chamber’s temperature more than direct heat from the fire.

You could try mounting the sensor higher up so that it’s more directly in the fire’s path, but I still think it would be better to have a sensor outside of the fireplace. Ideally, it would be right above the vents where the heat comes out). That would expose it to room-temperature air and enable it to rapidly cool when the fireplace turns off.

Thanks for the tips. But any hardware modifications won’t be done for the foreseeable future, I’m afraid…

So I was hoping to make sense of the (sub-ideal) temperature readouts I do have at the moment.

I agree with @rpwong, if you want to know faster and more reliably when the fireplace is turned on, you need a better sensor/position of the sensor to tell you when it’s on. Adding additional analysis most likely goiing to increase the amount of time required to detect this since it needs more sensor readings to analyze before it can make a determination.

In short, your time would be better spent finding a more reliable way to determine when fireplace is on. Temperature is alwayys going to be slow and hard to rely on because there are so many many variables that control how fast the temperature will rise and fall (humidity, current temperature, amount of gas feeding into the fireplace, etc.). I’d go so far as to assert that it is impossible to use temperature alone except where the temperature gets above a threshold that can only be explained by the fire being on or a the temperature is changing fast enough that the only explanation can be that the fire is on.

You may need to think outside the box. Is there a circuit you can detect current crossing when the fire is on? Maybe a sensor to measure when gas is flowing through the pipe. Maybe you can use a light sensor or even video processing to “visually” detect when the fire is on.

But to answer your questions:

  1. That’s what persistence is for. In a rule you can call “getAllStatesSince” and you’ll get a list of all the states saved to the database between now and the time you pass to the call. From there you can analyze the the points to your heart’s content. You can also pull the data through the API Explorer.

  2. That’s going to best be answered by what ever AI you choose to use.

Which brings us back to:

And on that note…

I kind of love the idea of a light sensor pointed at the fireplace, which would be pretty darn quick to report. The challenge would be placing it so that it only picks up light from the fire, doesn’t melt, and doesn’t look silly in front of the fireplace.

There might be a spot below the ‘bottom’ of the fireplace. But indeed, that sensor should be heat resistant then…

Outside will be difficult, if not impossible (considering esthetics). But I suppose I could somehow get a temperature sensor in the hole leading to the chimney:

Maybe this PT1000 sensor?