csdozier / device-concord4

Concord 4 SmartThings Device Hander and SmartApp
9 stars 13 forks source link

403 Error: 020204 #14

Open Casuallynoted opened 4 years ago

Casuallynoted commented 4 years ago

Getting an issue here but I’m not sure what I’ve done wrong. I replaced my Superbus thinking that was the culprit but now I don’t believe it is. The cable is also brand new:

Concord 4 Automation Server v2.0
2020-01-27 18:44:05,749 [concordsvr.py:start_logger()] - INFO - Logging started [LEVEL: INFO]…
2020-01-27 18:44:05,757 [concordsvr.py:updateStateOnServer()] - INFO - Panel Information: panelState: connecting
2020-01-27 18:44:05,758 [concordsvr.py:refreshPanelState()] - INFO - Querying panel for state (Concord 4 panel device startup)
2020-01-27 18:44:05,758 [concordsvr.py:updateStateOnServer()] - INFO - Panel Information: state: exploring
2020-01-27 18:44:05,775 [concordsvr.py:logger()] - INFO - Listening for HTTP(S) connections on port: 8066
2020-01-27 18:44:06,262 [concordsvr.py:logger()] - INFO - TX -> https://graph-na04-useast2.api.smartthings.com/api/smartapps/installations/[censoredthenumbershere]/concord/[censoredthenumbershere]/armstatus/disarmed
2020-01-27 18:44:06,264 [concordsvr.py:logger()] - INFO - ST TX Failed: 403 url:armstatus/disarmed
2020-01-27 18:44:06,286 [concord.py:send_message()] - WARNING - Resending message, attempt 2: ‘020204’
2020-01-27 18:44:07,796 [concordsvr.py:updateStateOnServer()] - INFO - Panel Information: state: active
2020-01-27 18:44:10,318 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 1 from TOUCHPAD message
2020-01-27 18:44:10,824 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 2 from TOUCHPAD message
2020-01-27 18:44:13,871 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 3 from TOUCHPAD message
2020-01-27 18:44:14,395 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 4 from TOUCHPAD message
2020-01-27 18:44:14,902 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 5 from TOUCHPAD message
2020-01-27 18:44:15,408 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 6 from TOUCHPAD message

and it just sorta repeats from there with 403 errors.

csdozier commented 4 years ago

So the issue is not with the superbus module side, its an issue with the program talking with smarthings

2020-01-27 18:44:06,262 [concordsvr.py:logger()] - INFO - TX -> https://graph-na04-useast2.api.smartthings.com/api/smartapps/installations/[censoredthenumbershere]/concord/[censoredthenumbershere]/armstatus/disarmed

You need to check your oauth settings.

On Thu, Feb 27, 2020 at 2:22 PM Casuallynoted notifications@github.com wrote:

Getting an issue here but I’m not sure what I’ve done wrong. I replaced my Superbus thinking that was the culprit but now I don’t believe it is. The cable is also brand new:

Concord 4 Automation Server v2.0

2020-01-27 18:44:05,749 [concordsvr.py:start_logger()] - INFO - Logging started [LEVEL: INFO]…

2020-01-27 18:44:05,757 [concordsvr.py:updateStateOnServer()] - INFO - Panel Information: panelState: connecting

2020-01-27 18:44:05,758 [concordsvr.py:refreshPanelState()] - INFO - Querying panel for state (Concord 4 panel device startup)

2020-01-27 18:44:05,758 [concordsvr.py:updateStateOnServer()] - INFO - Panel Information: state: exploring

2020-01-27 18:44:05,775 [concordsvr.py:logger()] - INFO - Listening for HTTP(S) connections on port: 8066

2020-01-27 18:44:06,262 [concordsvr.py:logger()] - INFO - TX -> https://graph-na04-useast2.api.smartthings.com/api/smartapps/installations/[censoredthenumbershere]/concord/[censoredthenumbershere]/armstatus/disarmed

2020-01-27 18:44:06,264 [concordsvr.py:logger()] - INFO - ST TX Failed: 403 url:armstatus/disarmed

2020-01-27 18:44:06,286 [concord.py:send_message()] - WARNING - Resending message, attempt 2: ‘020204’

2020-01-27 18:44:07,796 [concordsvr.py:updateStateOnServer()] - INFO - Panel Information: state: active

2020-01-27 18:44:10,318 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 1 from TOUCHPAD message

2020-01-27 18:44:10,824 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 2 from TOUCHPAD message

2020-01-27 18:44:13,871 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 3 from TOUCHPAD message

2020-01-27 18:44:14,395 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 4 from TOUCHPAD message

2020-01-27 18:44:14,902 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 5 from TOUCHPAD message

2020-01-27 18:44:15,408 [concordsvr.py:panelMessageHandler()] - INFO - Learning new partition 6 from TOUCHPAD message

and it just sorta repeats from there with 403 errors.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/csdozier/device-concord4/issues/14?email_source=notifications&email_token=ADJF754DQ2BPJC7AYYJP2ODRFAHINA5CNFSM4K5BRDKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IQ4T5WQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJF756O4LORS4VQITQLXFTRFAHINANCNFSM4K5BRDKA .

Casuallynoted commented 4 years ago

I'm running through the code generation process but it's given me a hassle every single time. I've gotten the auth code via the simulator but now that I'm trying to run the curl command to get the API Token, it just always gives me the code for a 500 internal server error.

Error 500: Internal Server Error URI /oauth/token Reference Id 300fefa4-f360-497d-8480-3cd7d76ce714 Date Thu Mar 12 20:26:10 UTC 2020

If there's any other way to do this in a way that ensures I'm doing it right, or some kind of script to generate the url and make it easier I'd love to do that. The last several times I've tried this, I wind up getting a result seemingly at random.

Casuallynoted commented 4 years ago

According to Samsung SmartThings Dev support, the code needs to be updated to SmartThings (non-classic) in order to work properly. That could be total misinformation but I thought I should pass it on. This is their response when I asked about the issue:

“ Unfortunately, the project that you've shared with us hasn't been updated to the current documentation. If you're the owner of this project, I suggest you implement the proper update, otherwise, you can request these changes directly to the project's GitHub.”

Casuallynoted commented 4 years ago

One possible solution (or idea in general) is to have a local alternative supported like Hubitat, Home Assistant or Homebridge.

Sent with GitHawk

csdozier commented 4 years ago

I'm running through the code generation process but it's given me a hassle every single time. I've gotten the auth code via the simulator but now that I'm trying to run the curl command to get the API Token, it just always gives me the code for a 500 internal server error.

Error 500: Internal Server Error URI /oauth/token Reference Id 300fefa4-f360-497d-8480-3cd7d76ce714 Date Thu Mar 12 20:26:10 UTC 2020

If there's any other way to do this in a way that ensures I'm doing it right, or some kind of script to generate the url and make it easier I'd love to do that. The last several times I've tried this, I wind up getting a result seemingly at random.

I have not run through the steps in a long time. I'm waiting to revamp this whole project into the new smart things app when it seems there is good porting documentation.

I tested the code generation process and it still seems to work..

  1. In chrome incognito construct a url like below, where you put in your client-id from smart app: https://graph.api.smartthings.com/oauth/authorize?response_type=code&client_id=caed733c-xxxx-xxx-xxx-xxxxxxxxxxx&scope=app&redirect_uri=https%3A%2F%2Fgraph-xx.api.smartthings.com%2Foauth%2Fcallback

you will be presented with a page like this:

image

You check the zones and click authorize.

You get to another page with 404 error, but the code is in the url box (mine starts with rv)

image

Casuallynoted commented 4 years ago

See, I can generate that code fine, but it's the second code retrieval process using curl that's been giving me problems. I'll see if I can get it working using this method for code retrieval though.

Casuallynoted commented 4 years ago

It wants me to sign in with a samsung account every time I do it, is that expected behavior?

Casuallynoted commented 4 years ago

Here's what the curl command output gives me, when I get the code in the previous step by signing into samsung smartthings:

https://pastebin.com/dfDzkxk4

Edit: tried the whole process over again and this time it gave me a code, but when I added it to my settings I still got the 403 error.

Casuallynoted commented 4 years ago

Edit: I got it, had to use the app ID from "Concord4 Integration". The status seems to be really delayed and I can't arm the alarm system (it claims it's arming but then it sorta just hangs), but eventually the statuses do seem to update (except the smoke detector which is stuck on "triggered").

automaton82 commented 4 years ago

I have not run through the steps in a long time. I'm waiting to revamp this whole project into the new smart things app when it seems there is good porting documentation.

As an FYI the Classic app is being sunsetted on October 14th and there's currently no custom UI allowed for DTHs. There's a basic API available but it isn't able to do the things required for alarm DTHs like we have here.

As such I've begun the process to move to Home Assistant instead, and with that I ported your web-server code to MQTT as HA (and others) work well with this. I haven't fully tested it yet, but I made a new repository with it working with basic cases here:

https://github.com/automaton82/MQTT-concord4

It's an unfortunate situation with SmartThings.

csdozier commented 4 years ago

Thanks for letting me know of the fork. I've thought about moving the Home Assistant as well. I havent looked at developing apps on the new app for a few months, but we I did look at it, it didnt seem like it was going to work for this app.

On Wed, Aug 12, 2020 at 11:57 AM automaton82 notifications@github.com wrote:

I have not run through the steps in a long time. I'm waiting to revamp this whole project into the new smart things app when it seems there is good porting documentation.

As an FYI the Classic app is being sunsetted on October 14th and there's currently no custom UI allowed for DTHs. There's a basic API available but it isn't able to do the things required for alarm DTHs like we have here.

As such I've begun the process to move to Home Assistant instead, and with that I ported your web-server code to MQTT as HA (and others) work well with this. I haven't fully tested it yet, but I made a new repository with it working with basic cases here:

https://github.com/automaton82/MQTT-concord4

It's an unfortunate situation with SmartThings.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/csdozier/device-concord4/issues/14#issuecomment-672961082, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJF757O22YAUHEIACWSGWLSAK3W3ANCNFSM4K5BRDKA .

automaton82 commented 4 years ago

Sure no problem. I'm setting up HA now so once that's done if I can get the cards to work with MQTT I'll update that repository with any more information / files that might be helpful. At this point it appears it might be a lot less work to make it work with HA than it was for you to make it work with ST, but we shall see.

automaton82 commented 4 years ago

Update - HA now working and the latest in my fork is now sending messages to HA MQTT, so I can see the door / CO2 etc status without problem. Overall I'd say integrating via MQTT and HA in general is much easier than ST..

doozers-do commented 4 years ago

This has worked very reliably for me for a couple years now. Many thanks!! Although I have been able to reconfigure automations an scenes to work with the limited lock capability in the new ST app, the limits placed by their “improvements” leave much to be desired.

Are you planning on using the smartthings hub for zigbee/zwave interface into HA with direct control of the concord 4 through HA (there are articles on HA that describe how to do this). Or are you recommending jumping ship from ST entirely and adding a zwave radio to your HA harware?

automaton82 commented 4 years ago

This has worked very reliably for me for a couple years now. Many thanks!! Although I have been able to reconfigure automations an scenes to work with the limited lock capability in the new ST app, the limits placed by their “improvements” leave much to be desired.

Are you planning on using the smartthings hub for zigbee/zwave interface into HA with direct control of the concord 4 through HA (there are articles on HA that describe how to do this). Or are you recommending jumping ship from ST entirely and adding a zwave radio to your HA harware?

I left ST entirely. I bought a Pi4 and a Z-Wave stick. If you want to know how to control concord4 through HA you can use my github repository - https://github.com/automaton82/MQTT-concord4

It's a lot easier to setup in HA and it now works for me successfully (been using for a couple days now). It uses MQTT instead of REST, so HA itself only needs to enable MQTT. After that you just add entities for each zone, and the built-in alarm panel. That repository has the related .yaml changes. If you have trouble setting it up open an issue on that repository and I can try to help.

marbaugh commented 4 years ago

This has worked very reliably for me for a couple years now. Many thanks!! Although I have been able to reconfigure automations an scenes to work with the limited lock capability in the new ST app, the limits placed by their “improvements” leave much to be desired. Are you planning on using the smartthings hub for zigbee/zwave interface into HA with direct control of the concord 4 through HA (there are articles on HA that describe how to do this). Or are you recommending jumping ship from ST entirely and adding a zwave radio to your HA harware?

I left ST entirely. I bought a Pi4 and a Z-Wave stick. If you want to know how to control concord4 through HA you can use my github repository - https://github.com/automaton82/MQTT-concord4

It's a lot easier to setup in HA and it now works for me successfully (been using for a couple days now). It uses MQTT instead of REST, so HA itself only needs to enable MQTT. After that you just add entities for each zone, and the built-in alarm panel. That repository has the related .yaml changes. If you have trouble setting it up open an issue on that repository and I can try to help.

@automaton82 I have been using SmartThings for year with this concord4 integration. I have played with HomeAssistant a bit, do you use the mobile app (iOS/Android)? Also how do you access it remotely? I enjoyed how the SmartThings classic app 'just worked' but know the HomeAssistant takes a bit more setup with HTTPS and port portforwarding. Just wanted to get your thoughts.

automaton82 commented 4 years ago

@automaton82 I have been using SmartThings for year with this concord4 integration. I have played with HomeAssistant a bit, do you use the mobile app (iOS/Android)? Also how do you access it remotely? I enjoyed how the SmartThings classic app 'just worked' but know the HomeAssistant takes a bit more setup with HTTPS and port portforwarding. Just wanted to get your thoughts.

Yes I use the mobile app on both iOS and Android. I access it remotely by first VPNing in to my home. I did not port forward nor setup HTTPS.

If setting up a VPN seems like too much work, they do offer a $5/mo subscription service that re-hosts your HA deployment in the cloud so you can access it anywhere without setting anything up, just like ST.

I've been using HA for a few weeks now after years of ST, and so far I like HA better.