arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
462 stars 104 forks source link

Startpub Usage? #647

Closed pliesenfeld closed 7 months ago

pliesenfeld commented 8 months ago

Here is my current config for the back porch light that I’d like to know the status of the light when I restart homebridge. I read that startpub will accomplish this, but I’m not very savvy at programming this.. here is my current config, can somebody tell me where to put the startpub and what it should look like? Thank you! { "type": "switch", "name": "Back Porch", "url": "192.168.", "username": "", "password": "", "topics": { "getOnline": "tele/tasmota_2E3CC3/LWT", "getOn": "stat/tasmota_2E3CC3/POWER", "setOn": "cmnd/tasmota_2E3CC3/POWER" }, "onlineValue": "Online", "offlineValue": "Offline", "onValue": "ON", "offValue": "OFF", "accessory": "mqttthing" },

arachnetech commented 7 months ago

Unfortunately startPub can publish a known state to the light on restart, but it doesn't help with storing the existing state. There's another ticket for a feature request to add that, so I'll close this one.