Season change: notifications Home Assistant when the outside temperature is higher than the internal one (and vice versa)

3 minutes of reading
PURPOSES OF PROJET:
  • Define an automation that automatically sends a notification to tenants when the atmospheric temperature is detected greater than that inside the home automation environment (and vice versa)
  • Difficulty level: bass
  • Cost: null
CONCEPTS FACED:
SOFTWARE COMPONENTS USED:
PHYSICAL DEVICES USED:
  • Any temperature sensor already integrated on Home Assistant (measure provided indirectly by third-party integrations, for example that of an intelligent thermostat)
PROJET MOST INDICATED FOR:

All environments

Notes and disclaimer
  • qualsiasi eventuale modifica agli impianti domestici dev'essere progettata ed realizzata SOLO da personale qualificato;
  • any changes implemented in probefore is a propersonal responsibility as well as a profirst risk and danger (the contents of the present page are purely educational);
  • any changes implemented in proprior to a device it voids the guarantee, quality approvals and certifications.
revision projet: 2.3

Abstract

Season changes they are, for many, rappmake it a difficult time of year to overcome: proproblems related to sleep quality, allergies, overall decrease in energy and so on.

Not only do living beings, however, suffer the effects of the change of season (from cold to warm, as well as from warm to cold): even the houses they live a moment in which curious, unexpected situations arise, which, if managed, can ensure greater well-being and - which does not hurt - allows us to achieve a certain energy saving.

At the gates of spring it happens, for example, that on certain fairly calm and sunny days the atmospheric temperature during the day rises rapidly during the central hours of the day, to the point of overcoming the internal one of the appartamenti (maybe, at that moment, paradoxically heated by the heating system). Conversely, it happens that at the end of the late summer days the outside temperature is cooler than the internal one.

Personal home automation comes to meet us, allowing us to define automatisms such as to alert us when - based on the time of year - the above conditions are met - allowing us to turn off heating or conditioningnamenti and open the finestre.

Logic of projet

What we will do is define the two entity automation, one that sends a notification when the atmospheric temperature is higher than the internal one and vice versa.

But first we'll define a sensor which contains in probefore the current season, so as to use it as a condition of the two automations: if we did not do so, it is clear that the first automation would continuously trigger in the middle of summer and vice versa the second in winter. We will therefore use this sensor, configuring it properly, as a discriminant for the execution of automations.

Assumptions

As per the prerequisites indicated above, it is assumed that they have already been integrated:

  • an internal thermal sensor, which we will assume to be called “sensor.temperatura_interna";
  • an external (virtual) thermal sensor (surveyed via a "Weather" platform, for example "Darksky"), Which we will assume to be called"sensor.temperatura_esterna";
  • a notification platform (for example “Pushbullet"), Whose resulting entity we will assume to be called"notify.marco"

Sensorand "season"

As anticipated, we need a sensor that contains, in the profirst state, the current season. To do this we will use a "Season Sensor"We're going to wire in configuration:

sensor:
  - platform: season
    type: astronomical

We will thus have created the entity "sensor.season"

Spring automation

At this point we create the first one automation in configuration, the one dedicated to the spring period, the one in which, from time to time, the external temperature is greater than the internal one:

automation:
  alias: "Notifica temperatura esterna maggiore a quella interna"
  hide_entity: true
  initial_state: 'on'
  trigger:
    platform: template
    value_template: "{{ ((states.sensor.temperatura_esterna.state|float) > (states.sensor.temperatura_interna.state|float)) and states.sensor.temperatura_interna.state|float > 0 }}"
  condition:
    condition: state
      entity_id: sensor.season
      state: "spring"
  action:
     service: notify.marco
     data:
       title: "Domotica"
       message: "Rilevata temperatura esterna superiore a quella interna."

When the trigger occurs (ie, "greater external temperature than indoor") The season will be checked if it is spring, will trigger a notification to the device registered with the entity "notify.marco"

Home Assistant - Notification of higher external temperature inside

obviously, all these parameterizations can be customized a proliking it.

Autumn automation

Similarly to the previous paragraph, we create autumn automation:

automation:
  alias: "Notifica temperatura esterna inferiore a quella interna"
  hide_entity: true
  initial_state: 'on'
  trigger:
    platform: template
    value_template: "{{ ((states.sensor.temperatura_esterna.state|float) < (states.sensor.temperatura_interna.state|float)) and states.sensor.temperatura_interna.state|float > 0 }}"
  condition:
    condition: state
      entity_id: sensor.season
      state: "autumn"
  action:
     service: notify.marco
     data:
       title: "Domotica"
       message: "Rilevata temperatura esterna inferiore a quella interna."

At this point it will be sufficient restart Home Assistant to make the changes effective and be alerted on the basis of what has been set.

Customizations

Obviously that promail is an elementary configuration: through multiple sensors, multiple notification and other entities is possible customize this type of notification. Just think of notifications that provide information on a "room" basis and not just on the basis of a single reading, so as not to report the possibility of sending such notifications only in the presence of the tenants.

And much more.


Home Assistant Official LogoATTENZIONE: remember that there is on our FORUM community an ad hoc section dedicated to Home Assistant, for any doubt, question, information on the specific merit of these components.

inDomus telegram channel