Hello
I’m about to integrate my Aqara door sensor correctly into HomeAssistant and can’t get any further. I don’t have a Xiaomi bridge but a flashed CC2531 USB stick and use zigbee2mqtt.
Maybe to mention: This is my first setup with HomeAssistant, MQTT and Zigbee. So if you have “stupid” questions, please understand.
Current status:
- HomeAssistant set up v0.89.0
- Mosquitto Broker Addon v4 set up and configured
- zigbee2mqtt v1.1.1 installed and set up
- Aqara door sensor paired with USB stick
In the zigbee2mqtt log I can already see the payloads arriving when I move the sensor:
3/7/2019, 11:24:17 PM - info: MQTT publish: topic 'zigbee2mqtt/DoorTest', payload '{"contact":false,"linkquality":63,"battery":100,"voltage":3005}'
3/7/2019, 11:24:18 PM - info: MQTT publish: topic 'zigbee2mqtt/DoorTest', payload '{"contact":true,"linkquality":60,"battery":100,"voltage":3005}'
The goal is the following:
I want to create an automation that switches on the light in the entrance when the front door opens and the sun has set and has not risen yet.
Problem:
Now I have (understanding) problems to configure the sensor in HomeAssistant. How is the payload read out?
In the configuration.yaml I have defined the following sensor:
# Sensors
sensor:
- platform: mqtt
name: "DoorTest"
state_topic: "zigbee2mqtt/DoorTest"
In the HomeAssistant under States I see the sensor as follows:
Now I only need the information about the “contact” for my application purpose. How do I have to configure the sensor to get this value? Or is this correct so that all values are received and then I read out the corresponding value in the automation? And if so, how is a corresponding value read out?
I hope this is explained in an understandable way.
Thanks for the help in advance,
Dave