Skip to main content

Bed presence detection with Aqara window and door sensor and a cheap car part

· 2 min read

Bed presence detection could be very useful in home automation to control the lights and appliances you don’t need at night, but want to be ready in the morning. And today we will build a bed presence sensor out of a very universal device for DIY IoT. It is an Aqara ZigBee window and door sensor. Why it is so universal? Let’s take a closer look at its internals.

Using variables as configuration for Home Assistant automation

· 4 min read

Home Assistant 0.115 got the ability to use variables in automation and scripts. You can declare variables even using templates and use them across the script or automation. Here is an example from the release notes:

automation:
trigger:
platform: sun
event: sunset
offset: -00:30
variables:
notification_service: notify.paulus_iphone
action:
- service: "{{ notification_service }}"
data:
message: Beautiful sunset!