Review:
Xiaomi Aqara Window Door Sensor
Installation via Home Assistant (HASS):
Adding this sensor to HASS is super simple if you have linked the Xiaomi Gateway. The sensor is then added of itself. Of course it must have been added to the Xiaomi Gateway, see above for an explanation.
Dashboard:
Open and close sensor.
Configuration:
Example flow:
I would like that when the door opens, the lamp goes on, and off again when I close it. I use the Node-red add-on to get this done easily.
I use for this:
- Xiaomi Door / window sensor
- Fibaro Dimmer 2
Start Node save and drag the "events: state" puzzle into the flow plane. Then double click on it and enter the following value:
- Name: give a clear name
- Entity ID: This is the ID of the sensor. Every device in Hass has its own ID / name. You can look it up at your states. So I enter: binary_sensor.door_window_sensor_123d000248ef5b. Then click on "Done". So we have now created a trigger. But we would like the lamp to go on and off. So we have to ensure that there is a condition.
We can arrange this condition with a switch. So make sure that the "Switch" puzzle also appears on the flow. Double-click it again and enter the following value:
- Name: give a clear name
- on (note is case sensitive)
- off (note is case sensitive)
So now we have a condition if the sensor is on and the sensor is off. But now we still want the lamp to go on / off. For this we use the "Call service" puzzle. This allows you to provide a service to, for example, turn things on / off. Retract it again and enter the following value:
- Name: give a clear name
- Domain: Light. Here you indicate what kind of device you are going to switch.
- Service: turn_on. With service you indicate what the device should do. In our case, it must be turned on (turn_on).
- Entity ID: this is again the ID / name of the device. I enter: light.fibaro_system_fgd212_dimmer_2_level
Then copy the node (via CTRL + C and CTRL + V) and provide an off (off) version.
After this you give the flow a name and you have to deploy the flow to the Hass. Then of course you check if everything works properly by opening and closing the door.