Notification when temperature drops a X amount

Hello everyone,

Tried to find the solution working for me. But can’t seem to get it to work.
I have Switchbot sensors inside and a Ecowitt weather station outside.
I would like to receive a notification on my phone or Google assistant that the temperature is rising and we need to close the windows. But also the other way around. When it’s dropping, that we can open the windows.

I’ve found this, but can’t find a way to reconfigure it to my products.



- alias: Bericht sturen als buiten kouder dan kamer en binnen >20 graden
  trigger:
    - platform: numeric_state
      entity_id: sensor.delta_temp_kamer
      above: 1
      for: 
        minutes: 10
  condition:
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.netatmo_kamer_temperature_2
        above: 20
      - condition: state
        entity_id: binary_sensor.window_sensor_1
        state: 'off'
  action:
    - service: notify.telegram_me
      data_template:
        message: '*Het is nu buiten {{ states.sensor.delta_temp_jasper.state }} graden kouder dan binnen in de kamer waar het {{ states.sensor.netatmo_jasper_kamer_temperature_2.state }} graden is, tijd om het raam open te zetten*'

- alias: Bericht sturen als buiten warmer is dan de kamer en buiten >20 graden
  trigger:
    - platform: numeric_state
      entity_id: sensor.delta_temp_kamer
      below: -0.5
      for: 
        minutes: 10
  condition:
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.rotterdam_temperature
        above: 20
      - condition: state
        entity_id: binary_sensor.window_sensor_1
        state: 'on'
  action:
    - service: notify.telegram_me
      data_template:
        message: '*Het is nu buiten {{ (float(states.sensor.delta_temp_jasper.state))*-1 }} graden warmer dan binnen in kamer waar het {{ states.sensor.netatmo_jasper_kamer_temperature_2.state }} graden is, tijd om het raam dicht te doen*'

My weather station is: sensor.ws2900_v2_01_18_outdoor_temperature

My room temperature sensor:
sensor.slaapkamer_switchbot

Can anyone help me out! Thanks a lot!Preformatted text

Hi, welcome to the forums! Please format your code correctly.

1 Like

I would set up a series of choose statements in an automation where any change in the outside temperature triggers it.

Draw a flowchart to start…
when I see this above that, preform action1
then
If I see that above this, preform action 2
then as default
I don’t know what happened, do the other thing as a failsafe. (maybe that is close the window as well.)

Take the notes and start building the automation in the UI. Test as you go.
During building I always add a temporary trigger on my magic cube so I can force a trigger that is a real trigger to test, then throw that away later.

1 Like

The first thing you need to do is set up a sensor (or sensors) that has access to you temperature readings over time such as the Derivative Integration.

1 Like