# Read device setting value and output this value to variable

**URL:** <https://community.homey.app/t/read-device-setting-value-and-output-this-value-to-variable/101113>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [January 14, 2024, 1:02pm UTC](https://community.homey.app/t/read-device-setting-value-and-output-this-value-to-variable/101113 "2024-01-14T13:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bMi](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bmi/32/16417_2.png) [@bMi](https://community.homey.app/u/bMi)\
**Post date:** [January 14, 2024, 1:02pm UTC](https://community.homey.app/t/read-device-setting-value-and-output-this-value-to-variable/101113/1 "2024-01-14T13:02:04Z")

</div>

Hi,

I have an EV charger from Easee and I manually change the current based on assumptions on how much power the rest of the house draws.

This works well as I only have to change this during the winter season to keep the house from drawing more than 10 kWh per hour. A better solution would be to dynamically assign current, but I do not have real time data about the consumption.

In order to calculate how many hours of charging the car needs, I have a calculation that needs a variable that gives me the manually set maximum current (A) of the EV charger.

I can see the value in Developer tools \> Devices \> Car charger \> Settings \> ‘maxChargerCurrent’.

_How can I read this value and store it as a variable?_

---

<div class="post-metadata">

**Author:** ![bMi](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bmi/32/16417_2.png) [@bMi](https://community.homey.app/u/bMi)\
**Post date:** [January 14, 2024, 1:41pm UTC](https://community.homey.app/t/read-device-setting-value-and-output-this-value-to-variable/101113/2 "2024-01-14T13:41:46Z")

</div>

I managed to get the value I needed using this code

```auto
const device = await Homey.devices.getDevice({ id : '[DEVICE ID HERE' });
console.log( device.settings.maxChargerCurrent );

```

This returns the value 16. What I need to do is to write this to a variable, preferably a variable in Better Logic.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [January 14, 2024, 2:07pm UTC](https://community.homey.app/t/read-device-setting-value-and-output-this-value-to-variable/101113/3 "2024-01-14T14:07:47Z")

</div>

With the right HS flowcard, in an Advanced Flow, you can return this value as a (number) tag. Save that tag into a BLL variable.
