tfyoung / esphome-junctek_kgf

Component for esphome to read status from a Junctek KG-F coulometer/battery monitor via UART
MIT License
27 stars 20 forks source link

Current polarity inverted #2

Closed dann2008 closed 1 year ago

dann2008 commented 2 years ago

batt curr history

batt curr

The values shown in HA are inverted but on the junktec display polarity is shown correctly

The green side is for Charging + and the red side is discharging -

How can i change polarity ?

Quattrohead commented 1 year ago

Hi Dann, are you on diysolarforum ? Would like to chat to you about this on here or there.

tfyoung commented 1 year ago

I'm not doing any maths to invert it, just taking the value read by serial. Once I hook up my unit again, i'll try and provide a config option to invert it so it matches the display.

dann2008 commented 1 year ago

Ok, let me now how are your readings I had to invert the shunt in order to display correct polarity But its wrong, because now the battery capacity is inverted Thank you

tfyoung commented 1 year ago

Hi,

I'm still not sure if it's currently right or wrong (my setup has no load connected again yet to test), but I've added the option to change it. there is now an "invert_current" option. It defaults to "false" to match previous behaviour, but once i have things setup and confirm which way i think it should be, then that may change. @dann2008 you definitely want to add the "invert_current: true" line, to get the behaviour you want.

dann2008 commented 1 year ago

junktek Hi,

I've just added the "invert_current: true" line on my config, now the polarity is shown correctly Values shown in the photo are positive but my battery is discharging, when i'll invert back the shunt it will show the correct values Thank You !!!