Skip to content

frimtec/home-assistant-awning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant Awning

License

Project Maintenance

"Home Assistant Awning" can be used to manually build up a low cost but high functional awnings control system for the home assistant platform. Low cost at least if you already have the mechanical installation of the awnings including the motors to move them.

In my case I control two independent awnings for the south and the west side of my winter garden. The installation is already over 20 years old and the controller was a closed system not offering any connectivity.

Sunlight and wind sensor

Each awning is moved with a retractable awning motor having an 240V AC input for expand and one for retract. The retractable awning motors are controlled by a Zigbee blinds actuator from NEXENTRO.

On the top of the winter garden two sensors are mounted:

  • Sunlight sensor (LDR - Light Dependent Resistor)
  • Mechanical wind sensor (simple impuls output)

Sunlight and wind sensor

A thermostat located in the winter garden can open and close the wire to the sunlight sensor. If the temperatur threshold of the thermostat is reached, the wire is closed.

The scope of this project is the low power hardware and the configuration to integrate the sensors and awning actuator into a home assistent instance.


SAFTY WARNING

Be aware that the installation of the awnings motors must be done by a trained electrician!
Don't risk your life or burn down the house.

Hardware

The hardware consists of two parts:

  • Sensor adapter board
  • ESP32 with status LED

Bill of material

Sensor adapter board

Sensor adapter board

The sensor adapter board is quite simple and can be wired best on a Circuit board according the given schema. The schottky diodes (SMD diodes) mounted on the backside, require good eyesight and a steady hand. The diodes are important to protect the GPIO pins of the ESP32 from over or under volatge coming in via spikes over the potential long sensor wires.

The components placed on the board are:

  • J1: Connector to the wind sensor
  • J2: Connector to the sunlight sensor (with optional thermostat)
  • J3: Connector to the ESP32
  • R1: 10k ohm resistor
  • R2: 1k ohm (or other depending on the sunlight sensor LDR)
  • R3, R5: 100 ohm resistors
  • D1-D4: Fast schottky diodes with low forward volatge (e.g. Infineon BAT60A SOD-323-2 10 V)

Schema adapter board

ESP32 with status LED

ESP32 in case ESP32 with LED

The ESP32 including the RGB-LED fits perfectly into the case that can be 3D printed.

Wiring instruction

Sensor adapter board

The wiring can be done best with jumper cabels (e.g. jumper-cable).

Sensor adapter board ESP32
VCC 3V3
GND GND
SUN A32 (GPIO32)
WIND D13 (GPIO13)

RGB LED

It is advisable to add a resistor of about 1k Ohm between each color pin of the RGB-LED and the ESP32 GPIO pin. Your best bet is to use a small piece of the circuit board.

LED ESP32
RED D2 (GPIO2)
GREEN D4 (GPIO4)
BLUE D5 (GPIO5)
GND GND

Flash ESP32

Once you've connected all the hardware, we'll get started with the configuration for ESPHome.

In this repository you will find the file esphome/frimtec-awning-sensors.yaml, which you can copy into the esphome folder of your Home Assistant config. Finally go through the installation wizard of ESPHome and flash the ESP32.

Configuration

The automations to control the awnings are prepared in blueprints.

First copy the complete folder structure blueprints into your Home Assistant config folder.

Awning sensor automations

Create two automations to integrate the sensor board from the blueprint awning-sensor.yaml as follows, using threshold values and times as desired for your sensors:

Name Sensor State light
Awning Sensor Sun sensor.awning_sensor_sun_light Awning Sensor - Status Green
Awning Sensor Wind sensor.awning_sensor_wind_speed Awning Sensor - Status Red

Awning control automations

Create an automation for each awning to control. Use the blueprint awning-control.yaml as follows:

Field Value
Name Use a name to identify the awning
Sun state sensor light.awning_sensor_status_green
Wind state sensor light.awning_sensor_status_red
Awning Select awning entity to control
Min/Max sun azimuth Define Min/Max sun azimuth

Calibrate the wind sensor

The wind sensor reports the wind speed in km/h. To have accurate results two characteristics of the used cup anemometer needs to be configured in the home assistant device:

  • radius: cup anemometer radius in millimeter (default value: 38 mm)
  • impulses_per_rotation: cup anemometer impulses per full rotation (default value: 1)

The wind speed is measured as impulses per minute (x) and then converted into km/h with the following formula:

v = x * ((2 * Pi * radius * 60) / (impulses_per_rotation * 1'000'000))   

Example Dashboard

Dashboard example

Credits