Flow for temperature monitoring

Hi, I have built a flow for monitoring all my temperature sensors in my home. The mission is to send a push notification to me if the temperature goes above or below certain values.

This flow works great but the flow has some flaws I want to fix.

  1. I have a Høiax water heater and a car charger that also has temperature sensors. I don’t want this units to report the temperature. How can I exlude certain units without making one flow for each unit?
  2. I have tried figuring out a way to make the flow not reporting for every change. The way is works now it sends a notification for each change above 25 degrees. So when the temperature gets to 25.1 I get a notification, and when it goes to 25.2 I get a notification and so one. How can I set it up to pause the notifications until the temperature goes below 25 again?

Hey, in order to answer your first question I would like to know how you currently created the flow that calculates the temperature values? If you are familiar with javascript, I would create a homey script that calculates the highest temperature value and use that value to set a virtual device.
You can create the virtual device using this app.
You can then just use the “When Temperature becomes higher than [Value] C” card to send the push notification. Like this:

Here’s the script you would need to insert in the Homescript card:

const devices = await Homey.devices.getDevices();
const temperatureSensorValues = Object.values(devices)
.filter(({name}) => {
  if (
    name === "Virtual Temperature Sensor" ||
    name === "Høiax Water Heater" ||
    name === "Car Charger"
    ) {
      return false
    }
  return true
})
.reduce((acc,device) => {
  const temperatureValue = device.capabilitiesObj && 
  device.class === 'sensor' && 
  Object.values(device.capabilitiesObj).find(({title, value})=> {
    return title === 'Temperature' && value !== null
  })

  if (temperatureValue) {
    return [...acc, temperatureValue.value]
  }

  return acc
}, [])

return Math.max(...temperatureSensorValues)

You can add the names of all the temperature sensors you don’t wish to include in the filter function separated by double pipes.

You can use these cards instead (like a thermostat works)

When set to 20 degrees:

  • the “greater than” card gets triggered once when the temperature rises above 20 degrees
    ’ the “less than” card gets triggered once when the temperature sinks below 20 degrees

I built the flow like this.

So it will always send me a notification when a temperature is changing, and it is above 25 or below 10. Im not very familiar with Javascript and since I’m also going to build flows for humidity and battery levels I think maybe this is not my way. Thanks for the help though since it looks like a good solution.

I think Peter_Kawa’s solutions is more of something I can manage. It means I need to make one When card for each sensor in my home. A little drawback but if I remeber to add each sensor when I’m mounting new ones in the home it should work fine.

It really depends on what you want. I thought you want to listen to multiple sensors, but you only want a notification once when A sensor gets over 25C right? What if one sensor goes over 25C, and then a few minutes later another sensor goes over 25? Do you then want to receive another notification, or not?
If you just want to monitor each sensor and want to receive a notification every time a sensor goes over 25, then yes, you can just the “when temperature becomes more than 25” cards for all of the sensors you would like to monitor. But if you only want to receive 1 notification when the first sensor goes over 25, you need a way to keep track of them. You could also work with a counter that you increase every time a sensor goes over 25, and decrease again when a sensor becomes lower than 25. You can then use the logic card “When number value becomes higher than 0”. However, I found that these counters are less robust than just calculating a value on the fly. Hence the script.

Yeah my goal is to monitor several sensors. So for instance if the sensor on the main bedroom gets over 25C, and then the sensor in the living room goes over a few minutes later, I want one notification pr. sensor.
It should work with my flow I’m building now. Its going to be a lot of cards in the flow, but it should work as I want.

1 Like

Depending on layout and expected temperature differences between rooms, I’d probably calculate an avarage for the sensors and trigger a flow based on that.

That is indeed a nice improvement as well. You can use the VThermo app to create a virtual thermostat for that. The virtual thermostats have built in options to monitor all temperature sensors in a zone, include/exclude subzones or parent zones. And it allows you to set the calculation method to Average, Minimum, Maximum, Newest or Manual.

Thanks for the tip. But I want to monitor each room by itself. With the average monitoring I dont get a notification if one room goes too high or low.

Also tried the VThermo app, but also here I cant seem to filter out the sensor with the value that is too high or low.