Well it nothing is crashing Thatās good. Look in the lower right log output box, thereās an https linkā¦open that in a web browser and tell me what you get in response.
{āerrorā:true,ātypeā:āAccessDeniedā,āmessageā:āThis request is not authorized by the specified access tokenā}
So the token is broken. Time to double check. Are you using both the device id from the Endpoint url in the simulator and the token from the simulator? Do you have the id & token in the right variables in the lambda code, or flip flopped?
i am using those two tokens. Iāll check if they are reversed
iām using the right tokensā¦ as far as i can tell
this is what comes up on the https website now.
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<error_description>d9edca94-011f-4af2-ae67-e91edcc335a0</error_description>
invalid_token
can you send that https link to me privately?
Keith, trying to break down the code so I can see if I am able to implement this as it looks great! My question is you have a device called āallbatā, is that an actual device? a custom device type? Is that needed for the capability response Battery All?
Hi Chris,
Those are just handle variables that get attached to the devices you pick from a list in the inputs. I named that one allbat and put the appropriate text prompt in ā¦so it reminded me to select all batteries for that input during the app configuration, not just one. Later in the switch case section, I use allbat as the handle that holds all the batteries selected and I call a routine that looks through all the batteries and checks to see if any of them are low, and then reports the results.
āKeith
You got the right codes, just flip flop the token and appID.
Thanks Keith, just so I understand here for example:
input ābasmokā basement smoke detector
input ābabatā basement smoke detector battery
basmok is the actual device name in Smartthings, babat is a handle created for the battery capability of the actual device.
So for something like fdlockcon, you did not include the battery capability for the sensor so it will not be included in batteries all?
Any work around to get the token/app ID? I cannot get the sim to run in the SmartThings IDE. Just sits and spins.
Hey Chris,
They are totally independent (except for the fact the hardware is in the same box)
basmok is the handle for the capability.smokeDetector of the smoke detector detecting smoke
babat is the handle for the capability.battery of the smoke detector giving battery status
same device, but two different handles, one for each feature.
every input is going to be a handle that connects a device capability to a way to talk to that option in the device. later you use the handles in the switch/case subrotines to identify which capability of which device we want reported or changed.
Hi Big Jim!
No workarounds for the tokenā¦thatās where you get it. (UPDATE: the ID and token show up on the device selection screen when you install the smartApp) But use the AskHome-Bare-1-device.groovy codeā¦it has everything but a light switched cleaned out of itā¦when you use the simulator you have to fill in the devices, and we donāt have the same devices. Just pick a light from the list and install. Let me know if it works.
Thatās what I was using. I canāt get the sim to work for any smart app. Even the ones I know work.
I donāt think I can fix the simulator. You might have to open a smartthings ticket for that. I have seen on the boards that others have had a problem with the sim very recently. You did turn on OAUTH in the smartapp editorās app settings. You donāt use the numbers from there, but it does have to be on for the sim to report a token.
Yeah, I did turn on OAuth. Just hate entering support tickets. Here goes nothingā¦
Awesome job Jason getting your first device working! Whoo hoo!
Well, I got two working nowā¦ Of things Iād I canāt get any more than that.
Taking a break for a bit lol
Making progress! BUT now I think that I am getting the same issue with the IDE simulator. Keith, I assume I have to set the location and when the simulator populates it will give me the appid info needed for the lambda code. I tried the id info from app settings and got errors.