jbasen / Crestron-SmartThings

26 stars 11 forks source link

Switch not changing feedback state and only triggering once #5

Open bricklep opened 6 years ago

bricklep commented 6 years ago

I am having a problem where when I trigger a switch off it doesn't change the state to off. And I am only able to trigger the device one time. If I re-upload the simpl file I am able to trigger the device again, but only one time.

albertlc1 commented 6 years ago

I'm having the same issue, has anyone found a fix or work-around?

Caseyr7 commented 6 years ago

Do you have the proper port specified in the Crestron API smartapp forwarded? IE 9999 to the control processor?

BNelt commented 6 years ago

Well I have port 80 as that's what the router defaulted to when selecting http service to forward. So I have http://IPaddress:80 in the groovy

On Sat, May 26, 2018, 1:22 AM Caseyr7 notifications@github.com wrote:

Do you have the proper port specified in the Crestron API smartapp forwarded? IE 9999 to the control processor?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbasen/Crestron-SmartThings/issues/5#issuecomment-392237896, or mute the thread https://github.com/notifications/unsubscribe-auth/Alzfz1K1utCSlAdj5x_1CsSC4w7G1wFkks5t2OaogaJpZM4TfBX3 .

Caseyr7 commented 6 years ago

I would change that to a non standard port as 80 is usually reserved. Choose something in a higher range. You should be safe with anything over 9000 but I know that 9999 works for me. Also make sure that the port is 1:1 NATd (forwarded to the control processor. I'm betting that this is why you are getting denied since 80 is standard http traffic for everything. You are practically going to flood your control processor with web requests that aren't secured.

Caseyr7 commented 6 years ago

Luckily most websites have moved to https so you aren't getting a lot of traffic but if you were trying to access http sites most likely your other device would not get connection. Also probably why you are getting denial.

BNelt commented 6 years ago

Ahh that makes sense. I'll make that change. Do I have to put in the actual IP address of the public IP or the crestron dns name?

Once i get this setup do I have to go back and redo everytime I add a new device to the hub I want to control?

On Sat, May 26, 2018, 1:48 AM Caseyr7 notifications@github.com wrote:

I would change that to a non standard port as 80 is usually reserved. Choose something in a higher range. You should be safe with anything over 9000 but I know that 9999 works for me. Also make sure that the port is 1:1 NATd (forwarded to the control processor. I'm betting that this is why you are getting denied since 80 is standard http traffic for everything. You are practically going to flood your control processor with web requests that aren't secured.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbasen/Crestron-SmartThings/issues/5#issuecomment-392238977, or mute the thread https://github.com/notifications/unsubscribe-auth/Alzfz9Qsl7PYkqH8CfkGDBp-zU2WqSDKks5t2OzHgaJpZM4TfBX3 .

Caseyr7 commented 6 years ago

You can use your Crestron DNS so long as that is actually working :). I use my Asus routers built in DDNS just to make it easier for me but as long as your Crestron DNS is working properly you will be good. You only have to auth once so long as you don't refresh your auth token or leave your hub/proc offline for a long time. I did this once and ran into the same issue when they expanded servers since my hub was migrated to a new one.

BNelt commented 6 years ago

Yeah my crestron dns was working up till a few weeks ago when I upgraded my router. I dont have any other ddns working right now. I just used the actual IP address and changing the port to 9999 it worked.

Thank you for your help!

On Sat, May 26, 2018, 1:58 AM Caseyr7 notifications@github.com wrote:

You can use your Crestron DNS so long as that is actually working :). I use my Asus routers built in DDNS just to make it easier for me but as long as your Crestron DNS is working properly you will be good. You only have to auth once so long as you don't refresh your auth token or leave your hub/proc offline for a long time. I did this once and ran into the same issue when they expanded servers since my hub was migrated to a new one.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jbasen/Crestron-SmartThings/issues/5#issuecomment-392239391, or mute the thread https://github.com/notifications/unsubscribe-auth/Alzfz3-5kQ81RCRSQr05fDtYelqgD60zks5t2O8XgaJpZM4TfBX3 .

Caseyr7 commented 6 years ago

No problem! Your DNS issue could also be linked to using port 80 if that was around the same time. 😜

bricklep commented 6 years ago

I am using a non-standard port and have a dynamic dns server that is setup correctly and still having this problem.

bricklep commented 6 years ago

I just figured out why I was only triggering the device once. changed the SIMPL+ module for the switches under event handlers so that it doesn't do a feedback check. The reason it triggered once is that the logic stops an event from happening depending on the feedback. I commented out the feedback check and now I am able to trigger switches as many times as I want on and off.

It looks like the problem is that I am not getting changes to feedback from smartthings in order for that logic to actually work. When I restart the program it successfully gets the correct feedback values once and then any state changes do not update the feedback on each switch. I wonder what is stopping the feedback changes from coming through.

bricklep commented 6 years ago

smarrthings IDE log shows this error when I trigger an event from crestron or any other method:

99a9debd-9322-462c-b02d-ae029b14ff45 5:44:16 PM: error java.lang.reflect.UndeclaredThrowableException @line 258 (SendUpdate)

could this be related?

bricklep commented 6 years ago

The line that the log is referring to is this line:

private SendUpdate(String path) { def pollParams = [ uri: "my correct ip address and port", path: "${path}" ] httpGet(pollParams) }

bricklep commented 6 years ago

Ok, I solved my problem. In the groovy code where I inserted my IP address I didn't add http://. Man I feel stupid, but it's satisfying to get this working.