dale3h / hue-mqtt-bridge

MQTT bridge for Philips Hue Dimmer and Hue Tap
MIT License
51 stars 6 forks source link

Support Hue Motion sensor #11

Closed WhistleMaster closed 7 years ago

WhistleMaster commented 7 years ago

Hue Motion sensors seem to not be fully working using hue-mqtt-bridge when integrated into Home Assistant. The sensors values are pushed on the brokers but the binary_sensors are not updated into HA.

dale3h commented 7 years ago

Can you please share your MQTT Binary Sensor config so that I could get a better understanding of what might be going wrong?

WhistleMaster commented 7 years ago

Sure ! I've just replaced the IP, users and the passwords.

{
  "broker": {
    "host": "localhost",
    "username": "user",
    "password": "pwd"
  },
  "bridges": [
    {
      "host": "XXX.XXX.XXX.XXX",
      "username": "user",
      "interval": 1000,
      "prefix": "hue"
    }
  ]
}

I've done some tests. When the sensors are defined as binary_sensor, the state is not updated:

   binary_sensor:
      - platform: mqtt
        device_class: motion
        state_topic: hue/my_sensor/presence
        name: 'Sensor Motion'

In the log, the message is received but the state not update:

2017-08-30 17:27:08 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hue/my_sensor/presence: true

However, when using normal sensor, the state is updated:

   sensor:
      - platform: mqtt
        state_topic: hue/my_sensor/presence
        name: 'Sensor Motion'
WhistleMaster commented 7 years ago

I got it... To use in a binary_sensor, you have to specify:

  payload_on: "true"
  payload_off: "false"
dale3h commented 7 years ago

I had a feeling this was the case. I'm glad you were able to figure it out!