# setSettings results in Error: invalid\_setting\_type

**URL:** <https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380>\
**Category:** Developers\
**Tags:** developers\
**Created:** [March 9, 2025, 1:53pm UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380 "2025-03-09T13:53:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frickadillus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frickadillus/32/69500_2.png) [@Frickadillus](https://community.homey.app/u/Frickadillus)\
**Post date:** [March 9, 2025, 1:53pm UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380/1 "2025-03-09T13:53:27Z")

</div>

Hi everyone,

I’m currently working on an app for Homey and encountering this issue when trying to update a settings value in the `onInit()` method of `device.js`. Specifically, I’m trying to set the IP address to a label visible in settings using the following code:

```auto
await this.setSettings({
  ip_address: "10.10.10.10",
});

```

Relevant code from `driver.compose.json`:

```auto
"settings": [
  {
    "id": "ip_address",
    "type": "label",
    "label": { "en": "IP address" },
    "value": "192.168.0.10",
    "hint": { "en": "The IP address of the device." }
  }
]

```

However, I’m getting the following error:

```auto
2025-03-09T13:36:32.109Z [err] [ManagerDrivers] [Driver:balboa-spa] [Device:87ddd4b4-affb-455c-ab18-807da51e8088] Device.onInit Error: Error: invalid_setting_type
    at Remote Process
    at HomeyClient.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:1:312)
    at Object.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/manager/drivers.js:78:54)
    at Object.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Driver.js:1:1668)
    at BalboaSpa.setSettings (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:1:5033)
    at BalboaSpa.onInit (/drivers/balboa-spa/device.js:13:16)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async BalboaSpa._onInit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:1:1682) {
  code: 400
}

```

I’ve tried changing the setting type to `text` in `driver.compose.json`:

```auto
"settings": [
  {
    "id": "ip_address",
    "type": "text",
    "label": { "en": "IP address" },
    "value": "192.168.0.10",
    "hint": { "en": "The IP address of the device." }
  }
]

```

But I’m still encountering the same issue and don’t get how the issue were resolved in [this thread](https://community.homey.app/t/setsettings-does-not-work-for-all-types-of-settings/63614). Does anyone have any insights or suggestions on how to resolve this error?

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![OH2TH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/oh2th/32/111414_2.png) [@OH2TH](https://community.homey.app/u/OH2TH)\
**Post date:** [March 9, 2025, 4:01pm UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380/2 "2025-03-09T16:01:11Z")

</div>

IP address setting from go-e Charger

Settings definition: [com.go-e.charger/.homeycompose/drivers/templates/settings.json at main · oh2th-homey/com.go-e.charger · GitHub](https://github.com/oh2th-homey/com.go-e.charger/blob/main/.homeycompose/drivers/templates/settings.json)

And setSettings in code

> <https://github.com/oh2th-homey/com.go-e.charger/blob/1a64c34869fba1ef6428ae3179aea58cee117aa6/drivers/main-device.js#L103C8-L103C19>

---

<div class="post-metadata">

**Author:** ![Frickadillus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frickadillus/32/69500_2.png) [@Frickadillus](https://community.homey.app/u/Frickadillus)\
**Post date:** [March 9, 2025, 6:35pm UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380/3 "2025-03-09T18:35:39Z")

</div>

Thanks @OH2TH for the input! However, making my “setSettings” code identical to the app you provided as a reference did not solve the problem.

Here is the updated code below.

onInit in device.js where I test to setSettings:

```auto
  async onInit() {
    this.log(`BalboaSpa initialized: Name - ${this.getName()}, Class - ${this.getClass()}`);
    this.client = new SpaClient(this.getData().id, this.onSpaUpdate.bind(this), this.onSpaError.bind(this));
    await this.client.connect();
    registerCapabilityListeners(this);
	this.setSettings({
		address: "10.10.10.10",
	});
  }

```

settings in driver.compose.json:

```auto
  "settings": [
    {
      "id": "address",
      "type": "text",
      "label": {
        "en": "IP address",
        "nl": "IP adres",
        "de": "IP-Adresse",
        "fr": "Adresse IP"
      },
      "value": "0.0.0.0",
      "hint": {
        "en": "Fixed IP address of the device.",
        "nl": "Vast IP adres van het apparaat.",
        "de": "Feste IP-Adresse des Geräts.",
        "fr": "Adresse IP fixe de l'appareil."
      }
    },
    {
      "id": "sync_time",
      "type": "dropdown",
      "label": {
        "en": "Sync Time"
      },
      "hint": {
        "en": "Select to sync the current time"
      },
      "values": [
        {
          "id": "no_sync",
          "label": {
            "en": ""
          }
        },
        {
          "id": "sync",
          "label": {
            "en": "Sync Now"
          }
        }
      ]
    },
    {
      "type": "group",
      "label": { "en": "Show/Hide Sensors" },
      "children": [
        {
          "id": "pump1",
          "type": "checkbox",
          "label": { "en": "Show Pump 1" },
          "value": true
        },
        {
          "id": "pump2",
          "type": "checkbox",
          "label": { "en": "Show Pump 2" },
          "value": true
        },
        {
          "id": "pump3",
          "type": "checkbox",
          "label": { "en": "Show Pump 3" },
          "value": true
        },
        {
          "id": "pump4",
          "type": "checkbox",
          "label": { "en": "Show Pump 4" },
          "value": true
        },
        {
          "id": "pump5",
          "type": "checkbox",
          "label": { "en": "Show Pump 5" },
          "value": true
        },
        {
          "id": "pump6",
          "type": "checkbox",
          "label": { "en": "Show Pump 6" },
          "value": true
        }
      ]
    }

```

Error message:

```auto
2025-03-09T18:27:03.637Z [log] [ManagerDrivers] [Driver:balboa-spa] [Device:f5a60b6c-fd55-4b64-8257-9daa81063deb] BalboaSpa initialized: Name - BWGSPA (192.168.20.39), Class - thermostat
2025-03-09T18:27:03.864Z [err] Unhandled Rejection at: Promise {
  <rejected> Error: invalid_setting_type
      at Remote Process
      at HomeyClient.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:1:312)
      at Object.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/manager/drivers.js:78:54)
      at Object.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Driver.js:1:1668)
      at BalboaSpa.setSettings (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:1:5033)
      at BalboaSpa.onInit (/drivers/balboa-spa/device.js:13:8)
      at async BalboaSpa._onInit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:1:1682) {
    code: 400
  }
} reason: Error: invalid_setting_type
    at Remote Process
    at HomeyClient.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:1:312)
    at Object.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/manager/drivers.js:78:54)
    at Object.emit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Driver.js:1:1668) 
    at BalboaSpa.setSettings (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:1:5033)
    at BalboaSpa.onInit (/drivers/balboa-spa/device.js:13:8)
    at async BalboaSpa._onInit (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:1:1682) {
  code: 400
}

```

---

<div class="post-metadata">

**Author:** ![Frickadillus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frickadillus/32/69500_2.png) [@Frickadillus](https://community.homey.app/u/Frickadillus)\
**Post date:** [March 11, 2025, 10:03am UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380/4 "2025-03-11T10:03:38Z")

</div>

Have done some more troubleshooting and I am now even more confused.

I am able to set the settings for “sync\_time”, see code below.

device.js:  
`this.setSettings({ sync_time: "no_sync" });`

driver.compose.json:

```auto
    {
      "id": "sync_time",
      "type": "dropdown",
      "label": {
        "en": "Sync Time"
      },
      "hint": {
        "en": "Select to sync the current time"
      },
      "values": [
        {
          "id": "no_sync",
          "label": {
            "en": ""
          }
        },
        {
          "id": "sync",
          "label": {
            "en": "Sync Now"
          }
        }
      ]
    },

```

But if I duplicate this settings and just add the number 2 after the name, sync\_time2, I get the error invalid\_setting\_type…

device.js:  
`this.setSettings({ sync_time2: "no_sync" });`

driver.compose.json:

```auto
    {
      "id": "sync_time2",
      "type": "dropdown",
      "label": {
        "en": "Sync Time"
      },
      "hint": {
        "en": "Select to sync the current time"
      },
      "values": [
        {
          "id": "no_sync",
          "label": {
            "en": ""
          }
        },
        {
          "id": "sync",
          "label": {
            "en": "Sync Now"
          }
        }
      ]
    },

```

It’s like the app don’t get the compose update.

---

<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:** [March 11, 2025, 10:15am UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380/5 "2025-03-11T10:15:22Z")

</div>

> [@Frickadillus](#):
>
> It’s like the app don’t get the compose update.

You can check the generated `app.json` file.

Also, I assume you’re deleting the device every time you’ve changed the compose file?

---

<div class="post-metadata">

**Author:** ![Frickadillus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frickadillus/32/69500_2.png) [@Frickadillus](https://community.homey.app/u/Frickadillus)\
**Post date:** [March 11, 2025, 10:47am UTC](https://community.homey.app/t/setsettings-results-in-error-invalid-setting-type/132380/6 "2025-03-11T10:47:22Z")

</div>

Hi @robertklep,

I just got it working.

I deleted the defined settings in the driver.compose.json, created a driver.settings.compose.json and carefully rewrote the defined settings based on [Settings | Homey Apps SDK](https://apps.developer.homey.app/the-basics/devices/settings) and now it suddenly works.

I always remove the device before testing. But could it still have been cached? Or did I make a rookie mistake in writing the compose.json? Either way, good point to double check the app.json. Will do so if the problem occurs again.

Thanks!
