Read device setting value and output this value to variable

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?

I managed to get the value I needed using this code

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.

1 Like

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.