# \[Homey Script\] - How to get / set device (firmware) settings?

**URL:** <https://community.homey.app/t/homey-script-how-to-get-set-device-firmware-settings/86308>\
**Category:** Developers\
**Tags:** homeyscript, devices\
**Created:** [August 6, 2023, 11:32am UTC](https://community.homey.app/t/homey-script-how-to-get-set-device-firmware-settings/86308 "2023-08-06T11:32:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_R](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tim_r/32/82292_2.png) [@Tim\_R](https://community.homey.app/u/Tim_R)\
**Post date:** [August 6, 2023, 11:32am UTC](https://community.homey.app/t/homey-script-how-to-get-set-device-firmware-settings/86308/1 "2023-08-06T11:32:31Z")

</div>

Hey all,

Is there a way though Homey Script to get all the device settings on board of a device, alter it and re-upload it to a device?

This is what I have so far. I have not ran it yet, since I’m not comfortable running is before getting your feedback 🙂 🙂

```auto
const deviceID = 'ce713301-f469-484c-b444-196c20063dab';

let deviceSettings = await Homey.devices.getDeviceSettingsObj({ id: deviceID })

for (const subSettings of Object.values(deviceSettings)) {
  if (subSettings.title === 'Dimming') {
    let children = subSettings.children
    for (const child of Object.values(children)) {
      if (child.id === "maximum_brightness") {
        child.value = 50;
      }
    }
  }
}
// write new settings
await Homey.devices.setDeviceSettings({ id: deviceID, settings: deviceSettings })

```

one command is `getDeviceSettingsObj()` Note the object, and the other is `setDeviceSettings()` sans the `Obj`. [Looking at the docs](https://athombv.github.io/node-homey-api/HomeyAPIV2.ManagerDevices.html#setDeviceSettings) I cannot figure out what the command expects. Or in other words could I brick it when I’m not sending the right format?

Another step back. Are this even the right methods to use to read/write device settings from/to a device?

I’ve got 10+ of the same devices and I’m currently tweaking the settings to get them to a desirable situation. Changing 6 settings of 10 devices a few times a day for a few days is no fun 🙂 Yes, once the settings are done you don’t need the script anymore. But in the process I also learn about HS. So double win 🙂
