Hi, I started using Homeassistant a few days ago. I have set up a lot of things already, but am struggling with my door sensors (Xiaomi / Aqara MCCGQ11LM).
I already have a running Zigbee2MQTT installation, and my devices are connected and running. In HA I set up the MQTT sensor, connected it to my existing mosquitto installation. In the MQTT integration config in HA, I can listen to the topics, that works fine. Here is some sample output:
{
"dateCode": "20161128",
"description": "Aqara door & window contact sensor",
"friendly_name": "19 - Hausanschluss",
"hardwareVersion": 2,
"ieeeAddr": "0x00158d00047c6524",
"lastSeen": 1655924598753,
"manufacturerID": 4151,
"manufacturerName": "LUMI",
"model": "MCCGQ11LM",
"modelID": "lumi.sensor_magnet.aq2",
"networkAddress": 33094,
"powerSource": "Battery",
"softwareBuildID": "3000-0001",
"type": "EndDevice",
"vendor": "Xiaomi"
},
But I can’t wrap my head around the config. Here’s where I am right now, the entities are shown in the enitity list (:
mqtt:
sensor:
- name: "Z2M - 34 Wohnzimmer klein unten"
state_topic: "zigbee2mqtt/0x00158d0004a973ef"
value_template: "{{ value_json.contact}}"
- name: "Z2M - 06 Büro oben"
state_topic: "zigbee2mqtt/0x00158d00044a0540"
value_template: "{{ value_json.contact}}"
This is what the messages look like:
{"battery":100,"contact":true,"device":{"applicationVersion":3,"dateCode":"20161128","friendlyName":"34 - Wohnzimmer klein unten","hardwareVersion":2,"ieeeAddr":"0x00158d0004a973ef","manufacturerID":4151,"manufacturerName":"LUMI","model":"MCCGQ11LM","networkAddress":14660,"powerSource":"Battery","softwareBuildID":"3000-0001","stackVersion":2,"type":"EndDevice","zclVersion":1},"device_temperature":30,"elapsed":3016129,"last_seen":"2022-06-22T21:17:18+02:00","linkquality":25,"temperature":30,"voltage":3015}
But how do I get the actual values, like status, battery etc to show in HA? I read several topics up and down and just got more confused.
Thank you for helping me!