#No notification when temprature sensor change above or below a certain temp.

58 messages · Page 1 of 1 (latest)

copper rose
#

HI all,

I try set a automasation to have a notification send to my phone when the temprature is above or below a certain temprature. Could yu please help me?

Here is the YAML code:

platform: device
device_id: f38eb65973de3955a731043aeea7d7ca
entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
domain: sensor
above: 28
below: 25
for:
  hours: 0
  minutes: 0
  seconds: 1```

action: notify.mobile_app_smartphone_dirk
metadata: {}
data:
message: Temprature Meterkast needs attention!
title: Temprature Meterkast needs attention!```

repeat:
sequence: []
while:
- type: is_temperature
condition: device
device_id: f38eb65973de3955a731043aeea7d7ca
entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
domain: sensor
below: 25
above: 28

Thank you for your help in advance.
solid halo
#

Can you edit your message and wrap your YAML code around triple backtick. ` (three time this above and below)

Like this 
#

Never mind I find the issue 😅
Do it anyway it will help others read better!

#

Your trigger is when your temperature is above 28 AND bellow 25. Which is impossible

Create two triggers

#

You can have as many triggers as you wish on a single automation

copper rose
#

Finally I manged it 🙃

solid halo
#

Don’t worry. Btw I see multiple code block. Next time click on the « 3 dots » menu on the automation editor. Then « Edit in YAML » and paste the WHOLE thing on one go (wrapped on a code block)

#

So anyway.
Multiple issues.
The one a said above. Your trigger is impossible

Second issue : Why the repeat 😊? The repeat has an empty sequence. Nothing gets repeated

#

What are you trying to achieve with that repeat exactly ?

copper rose
#

I tried to let it repeat every 30 minutes. So it checks the temprature and sends me a notification (or not when it's ok)

solid halo
#

Ah that’s not how automation works. Exactly

#

You need to understand the concept of triggers

#

Triggers is what triggers your automation. So right now it’s a sensor going above or below a value.

#

Then the sequence of action gets executed

#

What you want is more of that format (I think)

  • Trigger : every 30 minutes
  • Condition: If the temperature is above below bla-bla-bla
  • Action: Send notification
#

Correct ?

copper rose
#

Yes correct 🙂

solid halo
#

In this case the trigger will be a « time pattern » trigger located under the time and location menu on the automation editor

#

The syntax is not the easiest but it will look like this

#

This will trigger at every « whole hour » like 13:00 and every half hour like 13:30

#

Then condition is your device condition you seem to get the hang of this one

#

And the action will be the notification that also, at first glance, seems simple

copper rose
#

I just gave this a try and I set it to :44 and the clock changed right after that and I got a notification 🙂

solid halo
#

No repeat. A repeat is more useful when you need to repeat a sequence of action from a SINGLE trigger.
I dont know like « repeat an alarm song until a disarm the alarm » or whatever

solid halo
#

On the « 3 dot menu » of every action you’ll find a « run » button. So you can test your actions

copper rose
#

Let me try that.

solid halo
#

And if you sit on the automation editor WHILE a trigger gets … well triggered you’ll get a banner on the trigger itself telling you it’s triggered (that one is more complex to test cause you cannot TEST per say a trigger. You just need to to wait for something to happen)

copper rose
#

Yes it works! Thank you so much.

solid halo
#

No pb !!!

#

Just additional tips (I’m an automation lover so I need to give those) 😊😅

#

I would add pretty quickly a time condition like « before 22:00  and after 07:00 » cause I would not personally want to be woken up but that kind of notification

languid drift
solid halo
#

Basically ask yourself the question « why do I want to receive the notification. When is it actionable and when is it not »

#

And you’ll find plenty of things to add to make it more « smart »

solid halo
#

Do you want to receive the notification if you’re not home, if your sleeping, if the AC or Heating is already on, if you are ventilating a room windows open …. Etc etc

#

But hey… welcome to HA 😊

copper rose
#
platform: time_pattern
minutes: "30"

platform: time_pattern
minutes: "00"

type: temperature
platform: device
device_id: f38eb65973de3955a731043aeea7d7ca
entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
domain: sensor
above: 28
below: 24
for:
  hours: 0
  minutes: 0
  seconds: 1

action: notify.mobile_app_smartphone_dirk
metadata: {}
data:
  message: Temperature meterkast needs attention.

I am wondering what I have set incorrectly.

solid halo
#

You need two conditions I think.

#

Conditions are a list. They all need to be true for the actions to run

#

Wait … sorry … one sec 🙂 I’m slow

#

A OR building block

In your condition list. Add a OR building block a add two condition inside

  • Temp above 28
  • Temp below 25
#

The OR main condition will be true if any child condition is true.

#

And BTW. You can leave out the « for one minute » I think. The automation gets fired every 30 minutes you do not really need to verify that your condition is true for the last minutes

#

As you’re telling me that right now it’s just in between and you do not expect the automation to fire.
Build the condition with the OR and the two child condition
And test it as I shown you before with the TEST button

#

It should not be satisfied

#

BTW now I am back at my computer so I can show you how to properly share automations cause I still see that you are pasting block by bloc are we're missig a few information (I can live without but it will be better for the future)

#

So you can paste the whole thing. Not n individual things

copper rose
# solid halo

Thank you.

alias: Temperature meterkast
description: ""
trigger:
  - platform: time_pattern
    minutes: "30"
  - platform: time_pattern
    minutes: "13"
    seconds: "15"
condition:
  - type: is_temperature
    condition: device
    device_id: f38eb65973de3955a731043aeea7d7ca
    entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
    domain: sensor
    above: 24.9
  - condition: or
    conditions:
      - type: is_temperature
        condition: device
        device_id: f38eb65973de3955a731043aeea7d7ca
        entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
        domain: sensor
        below: 20
action:
  - action: notify.mobile_app_smartphone_dirk
    metadata: {}
    data:
      message: Temperature Meterkast Alert
mode: single

I just made it like this. Condition is above 24.9 (it's 25.00C) and it still doesn't send a notification on the time of minute. When I run a test it sends it, just always.

#

It's getting late here in Netherlands. I will continue tomorrow. Thank you so much for your help so far.

solid halo
#
condition:
  - condition: or
    conditions:
      - type: is_temperature
        condition: device
        device_id: f38eb65973de3955a731043aeea7d7ca
        entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
        domain: sensor
        above: 24.9
      - type: is_temperature
        condition: device
        device_id: f38eb65973de3955a731043aeea7d7ca
        entity_id: a0bcbeb5c7b85191a7f90a5944e1e5fd
        domain: sensor
        below: 20
#

like this.

#

Two child condition under the or condition

copper rose
#

@solid halo You're a the best! It's working perfectly fine now! I duplicated it and it works as well for the humidity. Thank you so much 👍 👍 👍

solid halo
#

Nah You’re the best 👀
Happy automating! Hope you learnt a few things