ilcato / homebridge-mqttswitch

Homebridge accessory plugin that create an HomeKit Switch based on MQTT topics
Apache License 2.0
31 stars 41 forks source link

MQTT Device status not updated in Homekit #10

Closed jaquesp closed 7 years ago

jaquesp commented 7 years ago

Hi - i have an MQTT device which is connecting to a mosquitto broker. if I control the device solely through homekit the device status is correct in homekit, and is mirrored correctly in the device configuration url). However, if I change the device status via the device itself, or via its configuration app - the status isn't reflected similarly in homekit. It seems homebridge-mqttswitch isn't getting the device status correctly or subscribing to the update. Additionally, if the device is on and I restart homebridge, the correct status is not reflected in homekit.

I've pasted my homebridge setup below - is there any way I can enable extra logging to understand what's going on, or can you advise?

` "accessories": [ { "accessory": "mqttswitch", "name": "Gym Fan", "url": "mqtt://localhost", "username": "", "password": "", "caption": "Gym Fan", "topics": { "statusGet": "stat/sonoff/POWER", "statusSet": "cmnd/sonoff/POWER" }, "onValue": "ON", "offValue": "OFF"

    }
]`

Thanks in advance.

jaquesp commented 7 years ago

Additionally, if I publish the ON/OFF commands manually, homekit does reflect the change:

pi@raspberrypi:/var/homebridge $ mosquitto_pub -u bob -P pass -t cmnd/sonoff/POWER -m "OFF" pi@raspberrypi:/var/homebridge $ mosquitto_pub -u bob -P pass -t cmnd/sonoff/POWER -m "ON"

jaquesp commented 7 years ago

IGNORE - USER ERROR!