bwitting / homebridge-ttlock

Homebridge plugin for the TTLock Platform
Apache License 2.0
14 stars 5 forks source link

TTlock current state #12

Open wlee69 opened 1 year ago

wlee69 commented 1 year ago

Hi - this plugin works great on homebridge but have one issue I can't seem to resolve. I have an automation set with the lock to unlock (from a trigger) if the trigger is set to on. It works great, but with most it would check to see if its unlocked first and then run to unlock. This plugin seems to just trigger regardless, so if the locks current state is unlock, then the automation locks the door not knowing the door is unlocked.

I tried in shortcuts (not homekit automation) to put an if statement to check the current state first before running the automation and that doesn't seem to work (same behavior as before, whatever the current state, it runs and flips it the other way). Any thoughts on whether the current state is getting passed to homebridge/homekit? and what the actual values are ? Maybe I could try that instead..sometimes I get an error in homebridge that it can't get the current state as well. I have this all running in a child bridge so performance to lock and unlock is great. Just need to sort out current state!

abear2010 commented 1 year ago

Same issue here. Seems to be a callback() in the configuration either in json or hardcoded in the plugin js file.