Where I live there are currently daytime maximum temperatures above 30°C. At night, however, it is quite common that temperatures drop below the room air temperature, making night cooling possible. I can then open the windows and cool the rooms for free.
But when is the right time in the evening to open the windows for night cooling? That varies from day to day…
To solve this I created a template binary sensor (on when the room temperature is above 22°C and the outside temperature is one degree lower than the room temperature) which triggers a mobile phone notification. On the Sonoff Ns Wall Panels and the Lovelace Dashboard, I have created icons that are only conditionally displayed.
Surely there is a more elegant and clever solution than my presented below, but it’s a start. Have you also implemented something like this? I am curious what you think of it!
Template binary_sensor i added in configuration.yaml
template:
- binary_sensor:
- name: "Central Night Cooling OK"
delay_on: 00:30:00 # to avoid toggling
delay_off: 01:00:00 # to avoid toggling
state: >
{{ (states('sensor.room_temp_average') | float > 22) and (states('sensor.central_outside_temp') | float < (states('sensor.room_temp_average') | float - 1)) }}
Automation for notification on mobile phone
alias: Central Night Cooling Notification
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.central_night_cooling_ok
to: "on"
condition: []
action:
- service: notify.mobile_app_iphone
data:
title: Night Cooling possible
message: Open Windows to cool down the rooms
mode: single
Dashboard with conditional icon in picture-elements card
type: picture-elements
image: /local/floorplan/floorplan.png
elements:
- type: conditional
conditions:
- entity: binary_sensor.central_night_cooling_ok
state: 'on'
elements:
- type: icon
icon: mdi:weather-windy
style:
top: 10%
left: 15%
color: green
Sonoff Ns Panel
The display turns on via a presence sensor, so when I walk by, I see the icon and am reminded to open the windows. The UI is selfmade in the Nextion Editor and integrated via ESPHome.
text_sensor:
- platform: homeassistant
id: nightcooling
entity_id: binary_sensor.central_night_cooling_ok
on_value:
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
int symbol=0; // symbol with question mark
if (id(nightcooling).state == "on")
{
symbol = 44; // wind symbol
}
else
{
symbol = 31; // placeholder with background color
}
id(disp1).send_command_printf("Home.nightcooling.pic=%i", symbol);