Detect fire based on the temperature sensors

Simple set the threshold temperature and select the entities of the temperature sensors to monitor.
Than add a action and ready!

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Fire detection based on temperature sensors
  description: Detect if there is a fire based on the temperature
  domain: automation
  input:
    threshold:
      name: Fire temperature level threshold
      description: The temperature thats not normal only posible when there is a fire.
      default: 45
      selector:
        number:
          min: 45.0
          max: 100.0
          unit_of_measurement: "Ā°C"
          mode: slider
          step: 1.0
    include:
      name: Included Sensors
      description: Temperature sensors to include from detection. Only
        entities are supported, devices must be expanded!
      default:
        entity_id: []
      selector:
        target:
          entity:
            device_class: temperature
    actions:
      name: Actions
      description:
        Notifications or similar to be run. {{sensors}} is replaced with
        the names of sensors with there current exceeded temperature.
      selector:
        action: {}
  source_url: https://gist.github.com/RoyOpstals/1b6e06feb2e828b46b716ad86a1495e1
variables:
  threshold: !input "threshold"
  include: !input "include"
  sensors:
    "{% set result = namespace(sensors=[]) %} {% for state in states.sensor\
    \ | selectattr('attributes.device_class', '==', 'temperature') %}\n  {% if 0 <= state.state\
    \ | int(-1) > threshold | int and state.entity_id in include.entity_id %}\n\
    \    {% set result.sensors = result.sensors + [state.name ~ ' (' ~ state.state\
    \ ~ ' Ā°C)'] %}\n  {% endif %}\n{% endfor %} {% for state in states.binary_sensor\
    \ | selectattr('attributes.device_class', '==', 'temperature') | selectattr('state',\
    \ '==', 'on') %}\n  {% if state.entity_id in include.entity_id %}\n    {%\
    \ set result.sensors = result.sensors + [state.name] %}\n  {% endif %}\n{% endfor\
    \ %} {{result.sensors|join(', ')}}"
trigger:
  - platform: time_pattern
    seconds: /30
condition:
  - "{{ sensors != '' }}"
action:
  - choose: []
    default: !input "actions"
mode: single
4 Likes

Hi Roy,

First of all I want to thank you for this good idea. I have a bunch of temperature sensors since months or years now and I never had the idea of using it to detect fire. Great idea :bulb:

But Iā€™m pretty new (less than a week) on home assistant after years of Jeedom and Iā€™m not an expert at all. So when I tried to use {{sensors}} to use in tts to audibly alert which device triggered the alarm the tts read literally ā€œsensorsā€

Here is the sentence I use : Incendie dƩtectƩ dans {{sensors}} witch mean fire detected in {{sensors}}

Can you tell me what Iā€™m doing wrong and how I can fix it?

So how long in to an house fire does it have to go before reaching 45 degrees?
This is a very unconventional method of detecting fire, that is why I ask.
Generally smoke detection is used since that is the first sign of a fire, temperature rising at height of temperature sensors might take a while, and add to this a time pattern trigger which could delay it even more.

Iā€™m skeptical of this to be honest.
But if you know of any tests of this as a method that you can link to then please do, it would be interesting to read about it.

I sure there will be somebody here who works in the fire service. I saw a video at work and was surprised how quickly the temp will rise above 100 degrees C in a room with the door closed. You may not be able to tell from just outside. I donā€™t think you would use this instead of smoke alarms but it could add life saving seconds. I came home and set up a similar notification system setting off buzzers and alerting all media devices and sending alert to Telegram.

1 Like

I believe there are two main factors in those kind of videos.
The closed door as you mention, but also I believe (donā€™t know for sure) they place the temperature sensor where it gets hot to create drama in the video.
It could be that this is a very valid way of doing it but it would be nice to know for sure.

Hi Flink88,
Here is my automation for refference, hope this helps you:

alias: Fire detection based on temperature sensors
description: ""
use_blueprint:
  path: onw-blueprints/fire-detection-based-on-temperature-sensors.yaml
  input:
    threshold: 45
    include:
      entity_id:
        - sensor.temp_hum_press_zolder_temperature
        - sensor.temp_hum_press_main_bedroom_temperature
        - sensor.sensor_kamer_1_air_temperature
        - sensor.sensor_gang_1_air_temperature
        - sensor.temp_hum_press_bijkeuken_temperature
        - sensor.temp_hum_press_garage_temperature
        - sensor.temp_hum_press_bathroom_temperature
    actions:
      - service: notify.mobile_app_iphone_roy
        data:
          title: Fire detected!
          message: Mogelijk brand gedetecteerd. Sensors:{{sensors}}
          data:
            push:
              sound:
                name: default
                critical: 1
                volume: 1
            url: /lovelace/temperature

Hi Hellis81,

This is never intended to replace smoke detectors, but to perhaps give you a few extra life saving seconds. The 45 degrees has not been scientifically recorded, but is a temperature that normally does not occur at my location. If this is the case, I would like to know because it could possibly be due to fire. Of course you donā€™t have to use it.

Hi @Hellis81 As a firefighter myelf i can say you it works. Moreover heat detector are actualy sell on the market. They are prefered in room where non dangerous smoke can be product without a life fire such as kitchen where smoke detector can be triger for nothing. But you are right smoke detectors are prefered where there is no risk of false alarm. The thing is itā€™s better to have a detector who maybe will trigger a litle bit later than a smoke detector without battery becouse somebody was annoyed of false alarm. From my experience heat detector sell on the market (and not on aliexpress, wish abd so on) perform well and could definitly safe life. However i did litle bit test with aqara temperature sensor and the blueprint work well but i see it as an added feature who can act as a backup of a smoke detector. But after all itā€™s better than nothing. I obviously canā€™t garenty that it will work on real fire since it can happen that the sensor will be burn die befor sendind the temperature.

1 Like

Hi Roy,

thanks. I was trying to read it loud on my sonos and google cast with TTS but it seems that TSS read it literaly. I tried to sens it via telegram and there the sensor name and temperature is well prompt. Thanks for your help.

Nice work, @RoyOps. I will use this (or a variation of this blueprint).

One questionā€¦ As you are using device_class == temperature to filter out other sensors, why donā€™t you ask for ā€œexclusionsā€ instead of ā€œinclusionsā€.
I mean, the automation will check all the sensors, except by one you exclude. It would be much easier to setup for people with dozens of sensors at home and will reduce the chance of a sensor to be left behind.

1 Like

I did not know there was heat detectors sold as fire alarms. Good to know.
Either way I still believe the blueprint has a flaw that it uses timepattern and not just state based.
Or perhaps even better a derivative of the temperature, but this probably could trigger if the sun hits the sensor.

But when you have your training, is there any possibility that you could ask for a temperature sensor to be placed in the opposite side of the room at 1-ish meter height to test the scenario compared to a normal smoke detector?
Without doubt I understand that if we are comparing nothing against this blueprint then obviously the blueprint is better, but Iā€™m just curious how it compares.
Is it faster or slower than a smoke detector placed correctly, if slower, how much slower?
Iā€™m obviously not as qualified as you in this area, but as I have understood the difference between now and one minute later is perhaps a fire that you can extinguish and just get out as fast as possible.

Hi Edward,

Thatā€™s a good question, in my case I used include because then I am better in control. I have a lot of temperature sensors created by weather forecast and sensor outside the house in the sun. Then I had to exclude all them. Using include is more explicit.

I donā€™t see how can i do this test since it mean me going to our training facilities with all my domotic including my 4 bay NAS. But i have tested this script by heating the sensor with a hair dryer and it trigered whithin seconds. I would say less than 10 seconds. From my knowledge (i canā€™t speak about experience since alarme are usualy trigered since minutes or already dying from bunr when we arrive on scene) heat detectors are prety much as slow as that.

You donā€™t have to exclude the external sensors, as hopefully they will never trigger (or if that happens it mean you might have a fire coming from the outside).
But you might be rightā€¦ Exclude the deviceā€™s internal temperature sensors, CPU temperature, phones temperatures, etc. can be a nightmare.

I didnā€™t mean your sensors. I meant (assumed) the fire station has some sensors, probably wired connected to something. :man_shrugging:
It was just a guess. Perhaps this does not exist on each fire station but more a ā€œscienceā€ fire station.

Anyone consider the fact thatā€¦ I might be good to get a text letting you know your home is on fireā€¦when your not at home? Dunno about yall butā€¦ I can hear my smoke alarm when Iā€™m out to dinner or at the arena for a hockey matchšŸ˜‰.
Just sayingšŸ˜

1 Like

@RoyOps this is a really useful idea for a blueprint! Any chance youā€™d be willing to tweak it to also support low temperature threshold as well (e.g. heating has failed when away?) Iā€™ve searched for an existing blueprint for this and canā€™t seem to find any.

Just to throw in a curve and potentially an easier solution for someone looking for a new install.

The #Velbus Thermostats all have four extra output triggers, that could easily be set as over temp alerts.

HomeAssistant can easily detect these triggers.

Hi Some-guy,
I made a blueprint that should do what you want. just changed the > threshold into < threshold and changed some text.
You can find it here: Low temperature detection Ā· GitHub
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: Low temperature detection
  description: Detect if there the temperature is too lo on any sensor
  domain: automation
  input:
    threshold:
      name: Temperature level threshold
      description: When the temerature goes belwo this threshold, the automation is triggerd.
      default: 10
      selector:
        number:
          min: -45.0
          max: 100.0
          unit_of_measurement: "Ā°C"
          mode: slider
          step: 1.0
    include:
      name: Included Sensors
      description: Temperature sensors to include from detection. Only
        entities are supported, devices must be expanded!
      default:
        entity_id: []
      selector:
        target:
          entity:
            device_class: temperature
    actions:
      name: Actions
      description:
        Notifications or similar to be run. {{sensors}} is replaced with
        the names of sensors with there current exceeded temperature.
      selector:
        action: {}
  source_url: https://gist.github.com/RoyOpstals/014c41d7bf996e625718f66ca05fc156
variables:
  threshold: !input "threshold"
  include: !input "include"
  sensors:
    "{% set result = namespace(sensors=[]) %} {% for state in states.sensor\
    \ | selectattr('attributes.device_class', '==', 'temperature') %}\n  {% if 0 <= state.state\
    \ | int(-1) < threshold | int and state.entity_id in include.entity_id %}\n\
    \    {% set result.sensors = result.sensors + [state.name ~ ' (' ~ state.state\
    \ ~ ' Ā°C)'] %}\n  {% endif %}\n{% endfor %} {% for state in states.binary_sensor\
    \ | selectattr('attributes.device_class', '==', 'temperature') | selectattr('state',\
    \ '==', 'on') %}\n  {% if state.entity_id in include.entity_id %}\n    {%\
    \ set result.sensors = result.sensors + [state.name] %}\n  {% endif %}\n{% endfor\
    \ %} {{result.sensors|join(', ')}}"
trigger:
  - platform: time_pattern
    seconds: /30
condition:
  - "{{ sensors != '' }}"
action:
  - choose: []
    default: !input "actions"
mode: single
2 Likes

Sorry for the late response, didnā€™t see this until now. Thanks very much!