rcoodey / Pilarm

Integrate existing door or window contact sensors with SmartThings using a Raspberry Pi or C.H.I.P.
Apache License 2.0
7 stars 5 forks source link

Error in SmartThings #2

Closed the-sambot closed 7 years ago

the-sambot commented 7 years ago

I'm getting an error: Pilarm DOES NOT RESPOND TO UPDATED HANDLER

Any ideas?

viguera commented 7 years ago

I had this when I inadvertently used the wrong appid. I know it looks like you're using the right one, but it's probably the one on the previous JSON block. Trust me, I spent a ridiculously long time finding this out myself 😀

the-sambot commented 7 years ago

Figured it out. It actually had the correct appid. However, decided to take a peak inside PilarmServer.py and realized that the same problem I had with the "installations" was causing an issue in PilarmServer. I changed the event_url to point to my shard:

#smartthings_event_url = "https://graph.api.smartthings.com/api/smartapps/installations/" + smartthings_application_id + "/{0}/{1}?access_token=" + smartthings_access_token
smartthings_event_url = "https://graph-na02-useast1.api.smartthings.com/api/smartapps/installations/" + smartthings_application_id + "/{0}/{1}?access_token=" + smartthings_access_token

Voila, now it works. Thanks @viguera for keeping me going. I owe you a case of beer.

viguera commented 7 years ago

Yeah I guess there's a mention of the shard in the readme but it's hardcoded in the Python script, so maybe that should be a variable as well.

the-sambot commented 7 years ago

Defininitely worth clarifying and making a variable. Also would be helpful to have an actual circuit diagram; fortunately I found those elsewhere.

Have you had any false alarms? I had one last night. I'm wondering if adding a short delay would be prudent or maybe some addition to the circuit.

rcoodey commented 7 years ago

Just pushed an update adding a variable in the config for the "shard url". When I originally built Pilarm I did not know about shards, so great idea on making it a variable.

Also added an image for the circuit diagram for a single contact.

I haven't had any false alarms, been running good now for 6 or more months and haven't really touched it until this config change. Initially had a few rare times where the gpio event didn't trigger, that is why there is the scheduled update of all alarm zones. But haven't had the opposite of that with false alarms. Maybe there is a loose connection on a sensor? Keep an eye on if it is happening with the same zone each time.