slsys / Gateway

Web site
https://slsys.github.io/Gateway/
245 stars 108 forks source link

Add feature - Xiaomi Aqara RTCGQ01LM occupancy "false" after occupancy timeout #30

Closed snakuzzo closed 4 years ago

snakuzzo commented 4 years ago

I added the a Xiaomi Aqara RTCGQ01LM (https://www.zigbee2mqtt.io/devices/RTCGQ01LM.html) This is the topic when it detects the presence..

Zigbee7634/sensore_presenza {"battery":100,"illuminance":1,"linkquality":78,"occupancy":true,"occupancy_timeout":90,"voltage":3.06,"model_name":"lumi.sensor_motion.aq2"}

...but gateway doesn't send any topic with occupancy: false after occupancy_timeout

For now I have solved creating a binary sensor like this...

binary_sensor:
- platform: "mqtt" 
  name: "Sensore Presenza" 
  state_topic: "Zigbee7634/sensore_presenza" 
  availability_topic: "Zigbee7634/bridge/state"
  payload_on: true 
  off_delay: 10 
  value_template: "{{ value_json.occupancy }}" 
  device_class: "motion"

...but using homeassistant autodiscovery, binary sensor entity is not set as showed (with off_delay) and it's required an automation to change PIR state to false.

it would be useful if the gateway sent a topic with occupancy: false

kasitoru commented 4 years ago

Уже было реализовано, но пришлось от этого временно отказаться (таймеры были нестабильны и доставляли проблем). В будущем автор обещал это исправить. В качестве временного решения я уже предлагал добавить поддержку off_delay для MQTT Discovery.

kasitoru commented 4 years ago

Вариант временного решения на основе автоматизации hallway.yaml#L53

snakuzzo commented 4 years ago

мое временное решение уже в порядке

Avenitos commented 4 years ago

done