just add the config.yaml file to right folder for your platform.
so long as you have these lines it should solve the authentication problem.
default:
token: βyour tokenβ
Hello @Smartphi,
For the config.yaml
file, the content should look similar to the sample below, indicating that this is the default profile to use in the SmartThings CLI and with the correct indentation:
default:
token: xxxx-xxx-xxxx
An alternative is to add the --token parameter in the command. For example:
smartthings devices --token=xxxx-xxx-xxxx
same issue: womp womp
there must be something else not configured correctly (if only there was documentation on how to properly setup and test the cli
@jody.albritton can you make the token generator also create yaml file so people can just drop it inside the cli folderβ¦
Also some test to make sure your ENV is setup correctly before even trying out the capabilities:create commandβ¦
Thanx ===>An alternative is to add the --token parameter in the command. For example:
smartthings devices --token=xxxx-xxx-xxxx
This worked, wow what a headache just to get to this stepβ¦
couldnβt get it to work with config.yaml file
On to the next headache not documented
Does the cli generate the capability json file?
Where would I find the file generated in the image below:
Thereβs only three files, no where is the json file.
If you want the CLI to generate a local file copy of the capability you need to ask for it.
For example, if you use the -j
argument the capability will be displayed in JSON format instead of the summary form in your example.
Alternatively you can use, for example, --output=filename.json
to get a file created for you.
cool thnx! generatedβ¦
Adding pics for others if it helps along this migration process.
oops donβt forget use the " "
If you do it this way does the output file also have the presentation or do we have to specify that separately in the json before doing presentation:create
I guess what Iβm saying is Iβm unclear when and how I set the display type and everything. Do I have to write the json for that myself? Can I auto generate it?
I have a custom capability to display a Temperature set point. I added a βstepperβ to the presentation and I am using the increase/decrease commands as shown below:
"detailView": [
{
"label": "Temperature Set Point",
"displayType": "stepper",
"stepper": {
"command": {
"increase": "increaseSetPoint",
"decrease": "decreaseSetpoint"
},
"value": "attr.value",
"range": [0, 100],
"step": 1
}
}
I defined the increaseSetPoint/decreaseSetpoint in the capability and in my DTH, which just currently logs that command was called. However, I am not seeing any logs when the stepper buttons are pressed. Instead, it appear the stepper is automatically trying to increase/decrease the attribute value. Unfortunately, this wonβt work for me b/c the βattr.valueβ is really just a string, which is populated from an API call and is displayed as friendly text which can vary (e.g. β88.3 Β°Fβ, βHigh of 77 Β°Fβ, etc.). So I want to just have the stepper call my increaseSetPoint/decreaseSetpoint methods so that I can just call the API to increase/decrease value and then update attribute via SendEvent(β¦).
Any ideas?
Thanks.
Iβve decided not to waste anymore time messing with this until the caching issue is fixed. Itβs so frustrating not knowing if youβve done something wrong or if itβs just the dumb app not refreshing.
Edit: oh and the fact that device config produces the same vid for devices with a different ordering
Your capability for the temperature set point should define a setter command. Then your presentation just specifies the setter command:
"detailView": [
{
"label": "First Value (A)",
"displayType": "stepper",
"stepper": {
"command": { "name": "setValueA"},
"value": "valueA.value",
"unit": " ",
"range": [-1000, 1000],
"step": 1
}
}
],
In my case βsetValueAβ is my setter command. Each time the value is changed by the stepper, the setter command will be called. It is up to you what you do then. The value it wants to set will be passed into your function and then you can create your string using it. If you need to know whether it is going up or down you would have to add some more logic but I donβt think you need it. Hope this helps.
I havenβt played about with this much lately. I thought Iβd seen that pushButton
worked, but it seems that is only in the dashboard. I donβt get any widget at all in the details view. Strange as I thought Iβd got further than that previously.
The really utterly crippling thing is that you get one chance to get the order of the device config right. Given that the first entries of the dashboard states
and actions
arrays are used in the dashboard tile, two device configs with either the dashboard states
or actions
arrays orders swapped clearly represent different presentations. Yet they produce the same vid
.
Question: If another user produces a device config with e.g. Motion Sensor
as the first capability in the dashboard states
array, and then I produce an otherwise identical device config but with the order swapped so e.g. Acceleration Sensor
is first, will they result in the same vid
and so leave me stuck with someone elseβs configuration?
ok. so what I understand is :
if I want to display multiple pushbutton and state βdisplay typesβ on new ST app ,
EITHER:
wait for the problem with multiple attributes be solved.
OR:
I have to create custom capabilities for all of them and include all of them in the device config.
is this a correct βtemporaryβ approach ?
And finally, how can I use the command defined to my pushbutton ?
"detailView": [ { "label": "Current State 1", "displayType": "pushButton", "pushButton": { "command": "setActive", } },
here, I defined a function named βsetActiveβ on the DTH and just put a log.debug command under it to see if it is called.
However, when I use the pushbutton, I donβt see it being called on the log.
what am I missing ?
@morgan.bridges @nayelyz suggestion, it would be nice of the alternatives had a default option or an option where the attribute had no value. Especially that visibleCondition
is not working, many attributes have a default state or a no value state (for DTHβs with dynamic controls), this one should be able to display βUnsupportedβ or some default text where thereβs no value to attribute. Right now if I try to set a key with ""
or null
it gives me error.
Hello @mrmrmrmr,
The issue with the pushButton display type has already been reported to our engineering department. In this case, the lack of logs when trying to interact with this element is because no commands are being generated. Our team continues working to have it fixed as soon as possible.
As if things werenβt bad enough, the documentation links are now giving me error 404, eg:
https://smartthings.developer.samsung.com/docs/Capabilities/capabilities.html#Creating-a-Capability-Presentation
@orangebucket @RBoy have either of you successfully made a list view custom capability, and if so, can you share your working presentation json
All Iβm trying to do is make a list with three options, canβt be that hard but havenβt gotten it to work yet.
Hi,
This drives me nuts. But I have a fan that I want to control. The speed can be HIGH, LOW (or OFF). The DTH in the old code worked fine. I created a custom capability:
Attributes:
βββββββββ¬βββββββββ¬βββββββββββ
β Name β Type β Setter β
βββββββββΌβββββββββΌβββββββββββ€
β speed β string β setSpeed β
βββββββββ΄βββββββββ΄βββββββββββ
Commands:
ββββββββββββ¬ββββββββββββββββ
β Name β Arguments β
ββββββββββββΌββββββββββββββββ€
β setSpeed β value: string β
ββββββββββββΌββββββββββββββββ€
β fanHigh β value: string β
ββββββββββββΌββββββββββββββββ€
β fanLow β value: string β
ββββββββββββ΄ββββββββββββββββ
So far so good. Iβm trying to create the capability representation, but whenever I call the CLI I get a http 500 no explanation. Can anybody spot the problem in my json please?
{
"dashboard": {
"states": [
{
"label": "{{speed.value}}"
}
],
"actions": [
{
"displayType": "switch",
"switch": {
"command": {
"name": "setSpeed",
"on": "HIGH",
"off": "LOW"
}
},
"group": "main"
}
],
"basicPlus": []
},
"detailView": [
{
"label": "Speed",
"displayType": "switch",
"switch": {
"command": {
"name": "setSpeed",
"on": "HIGH",
"off": "LOW"
}
},
"state": {
"label": "speed.value"
}
}
],
"automation": {
"conditions": [
{
"label": "Speed",
"displayType": "textField",
"textField": {
"value": "speed.value"
}
}
],
"actions": [
{
"label": "Speed",
"displayType": "textField",
"textField": {
"command": "setSpeed"
}
}
]
},
"id": my_id_I_got_from_creating_the_capability",
"version": 1
}
Thank you for the help!
Iβve finally gotten the hang of these but PLEASE fix the deviceconfig.json layout hashing issue.
(ergo the vid should not be the same if the layout order is changed).