# Enriching device settings

**URL:** <https://community.homey.app/t/enriching-device-settings/96167>\
**Category:** Developers\
**Tags:** zigbee, homey-pro\
**Created:** [November 29, 2023, 6:21am UTC](https://community.homey.app/t/enriching-device-settings/96167 "2023-11-29T06:21:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johan\_Rossouw](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johan_rossouw/32/79349_2.png) [@Johan\_Rossouw](https://community.homey.app/u/Johan_Rossouw)\
**Post date:** [November 29, 2023, 6:21am UTC](https://community.homey.app/t/enriching-device-settings/96167/1 "2023-11-29T06:21:06Z")

</div>

Hi,

I have a water tank sensor that tells me the water level in a tank (in cm). In my homey driver i want to translate this into the amount of water stored in the tank, so i need to multiply the height reported by the number of liters per cm of water (computed from the tank capacity and height when full). In order to do this i need to store an editable setting somewhere against the device that stores this conversion factor.  
The way I implemented this is to define a device settings in the driver.settings.compose.json file - which then exposes this setting via the Homey GUI. When the setting is updated, in the onSettings method I then use the setStoreValue API to store these settings. When I receive a level update from the device I retrieve the conversion factor using the getStoreValue and then multiply the reported value and set a new capability to store the amount of water in the tank.  
This works, but I don’t think that is the best way to do this - is there a better way?

---

<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:** [November 29, 2023, 6:31am UTC](https://community.homey.app/t/enriching-device-settings/96167/2 "2023-11-29T06:31:21Z")

</div>

Sounds okay to me. If you really want to optimize, instead of using `getStoreValue()` every time you can load the value into an instance variable in your device’s `onInit` and update it when the setting is changed.

---

<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:** [December 2, 2023, 9:35am UTC](https://community.homey.app/t/enriching-device-settings/96167/3 "2023-12-02T09:35:07Z")

</div>

If you already have device setting, you use/read it directly. You don’t need to store it in device store in addition.

---

<div class="post-metadata">

**Author:** ![Johan\_Rossouw](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/johan_rossouw/32/79349_2.png) [@Johan\_Rossouw](https://community.homey.app/u/Johan_Rossouw)\
**Post date:** [December 3, 2023, 9:18am UTC](https://community.homey.app/t/enriching-device-settings/96167/4 "2023-12-03T09:18:38Z")

</div>

Yea - figured that, but was hoping to keep them out of settings as the driver is now attempting to send these to the device. It would be nice if there was a way to indicate that a setting was on the driver side only.
