KhaosT / homebridge-amazondash

Amazon Dash Button plugin for Homebridge
58 stars 14 forks source link

Scene not triggered #17

Closed benzman81 closed 7 years ago

benzman81 commented 7 years ago

Hi,

I tried to get the plugin to work but without success. I tried Apple Home, Eve and Hesperus to configure it correctly, but my scene is never triggered. Starting in debug shows no entries when I click the button. That's why I forked the plugin to add some logging myself. Now I can see, that the button press is recognized and method dashEventWithAccessory is called, but it doesnt do anything.

Any help is appreciated.

Regards, Markus

KhaosT commented 7 years ago

Are you running homebridge v0.4.19?

benzman81 commented 7 years ago

No, still 0.4.17. Should I upgrade?

KhaosT commented 7 years ago

Yeah, the updated plugin requires some recent changes in homebridge (and hap-nodejs) to work properly.

benzman81 commented 7 years ago

ok, I'll try and give feedback

benzman81 commented 7 years ago

still no luck, the method targetChar.setValue(0); is called as my log is printed for it.

KhaosT commented 7 years ago

@benzman81 and if you run homebridge with debug env variable (DEBUG=* homebridge ...), does it print out anything when setValue(0) is called?

benzman81 commented 7 years ago

wait I double check, with last version it didn't

KhaosT commented 7 years ago

huh ... can you make sure that homebridge is using hap-nodejs with a version that is at least v0.4.23?

benzman81 commented 7 years ago

what is the best way to check? looking in my global node_modules folder it states 0.4.24.

KhaosT commented 7 years ago

npm list -g and find hap-nodejs under homebridge?

benzman81 commented 7 years ago

it states 0.4.24, too

no debug log entries after setValue(0)

KhaosT commented 7 years ago

Huh interesting, it should say "Sending HTTP event ..." if everything work as expected. Can you try remove the trigger on iOS device, wait a few minutes and add another trigger?

benzman81 commented 7 years ago

Now configured it via Details screen in Apple Home. Still no luck. Other homebridge plugins trigger background events as expected.

KhaosT commented 7 years ago

Ah wait I know what's wrong, since you first added the button in an earlier version of homebridge, the accessory cached is missing a special flag for programmable switch characteristic. You can try to remove the accessory cache (normally under ~/.homebridge/cachedAccessories) and restart homebridge to recover. Sorry for inconveniences.

benzman81 commented 7 years ago

Do I loose settings of all the accessories and platforms?

KhaosT commented 7 years ago

@benzman81 normally it shouldn't, since plugins should be able to add them back. If you are comfortable with modifying json, you can try to manually add eventOnlyCharacteristic = true to ProgrammableSwitchEvent (you can search 00000073-0000-1000-8000-0026BB765291 to find the location) characteristic in the accessory cache (remember to close homebridge before making changes).

benzman81 commented 7 years ago

@KhaosT within "props" or right next to the display name?

KhaosT commented 7 years ago

Would you mind upload a screenshot of that section?

KhaosT commented 7 years ago

It's at the same level as display name and UUID.

benzman81 commented 7 years ago

I deleted the cachedAccessories and now it works. Big thanx for your fast help!

KhaosT commented 7 years ago

No problem :) Good to know you got it working.