stjohnjohnson / smartthings-mqtt-bridge

Bridge between SmartThings and MQTT
https://hub.docker.com/r/stjohnjohnson/smartthings-mqtt-bridge/
MIT License
363 stars 242 forks source link

Initial states aren't published to MQTT #172

Open rwagoner opened 5 years ago

rwagoner commented 5 years ago

There is no way to push the initial state to MQTT from the SmartThings app. The state is only pushed to MQTT on change. When first installing I have to touch every device I want to use in MQTT to see the topic appear. Additionally if your system is offline the state can be out of sync. I'm proposing adding a Refresh button in the SmartThings app to enumerate all items and immediately push the state.

Shadowpheonix commented 5 years ago

If a global Refresh button is not an option, how about support for state queries via MQTT publish? IE: sending an MQTT publish command to "smartthings/Bedroom Fan/switch/cmd" with a payload of "?" (or whatever you feel would be appropriate) would cause the bridge to return "smartthings/Bedroom Fan/switch/state = on" or "smartthings/Bedroom Fan/switch/state = off" without actually changing the current state.