# setSettings does not work for all types of settings

**URL:** <https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614>\
**Category:** Developers\
**Created:** [May 13, 2022, 10:20pm UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614 "2022-05-13T22:20:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [May 13, 2022, 10:20pm UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/1 "2022-05-13T22:20:13Z")

</div>

It seems like I may have hit a bug with the Athom software:  
setSettings should accept settings of “any” type according to the documentation:

> **[Device - Homey Apps SDK v3](https://apps-sdk-v3.developer.homey.app/Device.html#setSettings)**

However, if I have a setting defined with  
“type”: “dropdown”,  
as described here:

> **[Settings](https://apps.developer.homey.app/the-basics/devices/settings#dropdown)**
>
> Device settings allow users to customize the behaviour of their devices from Homey.

then calling setSettings will report an error as follows:

```auto
Device.onInit Error: Error: invalid_setting_type
    at Remote Process
 {
  code: 400
}

```

This essentially makes the dropdown setting partially useless unless there is another way to set it.

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [May 13, 2022, 10:52pm UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/2 "2022-05-13T22:52:04Z")

</div>

on a similar note using “type”: “label”

> **[Settings](https://apps.developer.homey.app/the-basics/devices/settings#label)**
>
> Device settings allow users to customize the behaviour of their devices from Homey.

Then the app does not validate against level ‘debug’  
When trying to run  
`homey app run`

Seems like both “dropdown” and “label” types has issues.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 14, 2022, 6:13am UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/3 "2022-05-14T06:13:56Z")

</div>

How do you set the settings? Do you pass the value as string?  
Are you passing a JSON object as parameter like { fieldname: “dropdown-id”}?

I had issues when more than one setting had no default value and I tried to set only one of then. So pleass make sure that every setting has a default value on devide adding.

See: [device.setSettings( ) resulting in exception for valid values if other settings than this setting are not already existing in device · Issue #248 · athombv/homey-apps-sdk-issues · GitHub](https://github.com/athombv/homey-apps-sdk-issues/issues/248)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 14, 2022, 6:16am UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/4 "2022-05-14T06:16:31Z")

</div>

The latest `homey` CLI tool still doesn’t validate if a setting has a default value 🙄

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 14, 2022, 6:25am UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/5 "2022-05-14T06:25:10Z")

</div>

Do you have an example? I just added a new setting with a default value. I have latest CLI installed (the latest update automatically shown).

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [May 14, 2022, 6:48am UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/6 "2022-05-14T06:48:05Z")

</div>

```auto
        {
          "id": "username",
          "type": "text",
          "label": {
            "en": "Username"
          },
          "hint": {
            "en": "The name of the user."
          }
        },

```

No default value, no errors when uploading the app to my Homey.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [May 14, 2022, 7:27am UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/7 "2022-05-14T07:27:37Z")

</div>

And no update on github. I think it has a really low priority.

---

<div class="post-metadata">

**Author:** ![frodeheg](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frodeheg/32/49010_2.png) [@frodeheg](https://community.homey.app/u/frodeheg)\
**Post date:** [May 15, 2022, 10:25pm UTC](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614/8 "2022-05-15T22:25:16Z")

</div>

> How do you set the settings? Do you pass the value as string?

It turned out that I was trying to set the “dropdown” and “label” type settings to values while it was required to set them to strings.  
Thanks
