Hi - I am trying to get the glitch example to work according to the documentation but am not having success.
When I try to add the device in the mobile app, I can find it in Developer mode and select it, choose a room, hit next, then start getting messages from glitch (preparing, etc.). Then am presented with this page:
Mock OAuth2 Server
UserName:
Enter the email address of the person you want to impersonate.
Password:
This is not mentioned anywhere in the documentation or Glitch readme file. What am I supposed to put here? Note that I do not have a Glitch account - I am running anonymously.
I tried putting my email address but that didnât work, and now am regretting that because I just gave them my email password!! It seems no matter what I provide - valid email or not - it still gives me an error: Connection between SmartThings and Sample Cloud Device encountered an error.
Hi, do you mean this example, for a virtual switch?
The page youâre redirected to is the simulated OAuth 2.0 Server, it doesnât save or validate any data, so donât worry. This is why you donât need to use a real email or password (only the emailâs format is verified).
Make sure you put the correct values in the cloud credentials of the Schema Connector (see the picture below).
The Webhook URL is the live site URL of your Schema Connector (remixed project in Glitch):
This sample doesnât include the commandâs handler, so youâll receive a Network error when you try to change the device status, eg. turning off the switch.
Take a look at this recent sample for this kind of device:
Thanks for the reply! Yes, that is the Glitch example for a dimmer switch. I have all the correct values in the cloud credentials. Everything matches up with the screen shot you provided.
I even had the webhook URL correct despite the lack of clear info on this in the readme, which only says ââŠadd the glitch url as the âTarget URLâ for the âWebHook Endpointââ without specifying WHAT glitch url to use or where to find. Thanks for your additional info, but Iâd request that it really needs to be clarified in the glitch ST app readme file.
Once the remixed app is up and running, you can click on "Show (live)" to check your webhook url in the browser.
How do I know the app is up and running? Is there something I need to do? The âShowâ menu item says âPreviewâ your app (not run), and does not say âliveâ anywhere. If I do click on Show and then either âin a new windowâ or ânext to codeâ, all it ever shows there is the discovery response json.
As you can tell Iâve never used Glitch beforeâŠ
Itâs ok, actually, Iâve seen them change the UI a few times and it took me a while to find the right menu option
To get the Webhook URL youâll use in your Schema Connector, click on âShareâ below the projectâs name. Glitch provides two URLs, one for you to access (and edit) the code, and the other is where the project is executed (live site).
Glitch runs/saves the code automatically and you can see the logs by selecting âToolsâ > âLogsâ. There youâll see if your Schema Connector is called and the interaction typesâ request and response.
I couldnât replicate the error you get, I tracked down the error code from the picture and itâs related to the Token request. For better understanding the process flow is:
You select the connector in the mobile app to install the device.
It sends you to the simulated OAuth server which grants you an Authentication code once you select âAuthorizeâ in the mobile app.
This code is received in your Schema Connector to request the Reciprocal Token used for callbacks.
I believe the error is in step 3, do you see an interaction result in the Connectorâs logs?
I found my problem There was an extra space preceeding the client secret credential in the Developer Workspace. Must have happened when I copy/pasted it from glitch. so USER ERROR!!!