stjohnjohnson / smartthings-mqtt-bridge

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

Push Current Value #67

Open kylerw opened 7 years ago

kylerw commented 7 years ago

during each subscription update, push the current value of each subscribed device.

My ST development is nearly non-existent so there may be a more efficient way to do this but this is working for me.

kylerw commented 7 years ago

This should solve this https://github.com/stjohnjohnson/smartthings-mqtt-bridge/issues/61 and https://github.com/stjohnjohnson/smartthings-mqtt-bridge/issues/51

kylerw commented 7 years ago

Doesn't poll the device but will simply send the current value/state. This helps for periodic reboots that might lose/forget states. Since updateSubscription() runs every 15 minutes there that would be the maximum amount of time that HomeAssistant is without states from ST.

kylerw commented 7 years ago

Also: https://github.com/stjohnjohnson/smartthings-mqtt-bridge/issues/66

AceoStar commented 7 years ago

@kylerw Everytime I turn around I run into a thread where you're working on a commit that I need. We must have the exact same setup. :D

stjohnjohnson commented 7 years ago

I couldn't figure out how to give you a PR to your PR, so I just made a new one with the updated code.

However, it appears this may hit a rate limit issue with the device type.