davidrapan / ha-solarman

⚡ Solarman Stick Logger integration for 🏠 Home Assistant
MIT License
110 stars 25 forks source link

Update kstar_hybrid.yaml #240

Closed Derick8619 closed 3 weeks ago

Derick8619 commented 3 weeks ago

DATA FROM MODBUS SHEET 3450 PACKSOC PACK1 % U16 0~100 04H 3494 PACKSOC PACK2 % U16 0~100 04H 3638 PACKSOC PACK3 % U16 0~100 04H

To include individual Battery Pack SOCs.

This will allow users to see if the battery packs are balanced, the overall SOC of all batteries is an average percentage of all the cells.

I added these registers to the bottom of the YAML, unsure if the rules etc need adjusting

    - name: "Battery Pack 1 SOC"
    update_interval: 5
    class: "battery"
    state_class: "measurement"
    uom: "%"
    scale: 0.1
    rule: 1
    registers: [3450]
    icon: "mdi:battery"

    - name: "Battery Pack 2 SOC"
    update_interval: 5
    class: "battery"
    state_class: "measurement"
    uom: "%"
    scale: 0.1
    rule: 1
    registers: [3494]
    icon: "mdi:battery"

    - name: "Battery Pack 3 SOC"
    update_interval: 5
    class: "battery"
    state_class: "measurement"
    uom: "%"
    scale: 0.1
    rule: 1
    registers: [3638]
    icon: "mdi:battery"
davidrapan commented 3 weeks ago

Hi @Derick8619, thanks!

  1. Name them Battery 1, Battery 2 and Battery 3 to better resemble extension of already existing Battery sensor which also does not contain SOC suffix.
  2. Is the scale property correct? Scale of main Battery sensor is 1.

As those are proly not really crucial sensor what about to make them hidden from overview dashboard by default?

Derick8619 commented 3 weeks ago

Hi David,

Thanks for getting back to me :)

I'm unsure how to re-edit the file for this 'Pull Request' to rename them Battery 1 etc....

With regards to the scale, I am not sure about that either, I copied and pasted (then edited) the code from this line as I believe this is the overall SOC register:

Below is the sensor that is currently returning the output for the overall battery SOC. sensor.inverter_battery

The scale for Battery SOH is 1 but that is a different thing altogether (STATE OF HEALTH).

I agree they are not crucial for dashboard but I would like the ability to add them to mine as this information is far more valuable than lots of the current sensors that are currently available by default.

Kind regards

Derick

frsantos commented 3 weeks ago

Also, the file already have a Battery group on line 292, I think these new registers should be moved in that group with other related registers.

Maybe after the name: "Battery" register?

davidrapan commented 3 weeks ago

Below is the sensor that is currently returning the output for the overall battery SOC. sensor.inverter_battery

Ah I was looking into wrong profile, my bad. 😉

I agree they are not crucial for dashboard but I would like the ability to add them to mine as this information is far more valuable than lots of the current sensors that are currently available by default.

That does not conflict with my proposal you will still be able to. 😉

frsantos commented 3 weeks ago

With regards to the scale, I am not sure about that either, I copied and pasted (then edited) the code from this line as I believe this is the overall SOC register:

  • name: "Battery" update_interval: 5 class: "battery" state_class: "measurement" uom: "%" scale: 0.1 rule: 1 registers: [3066] icon: "mdi:battery"

That is a different register and (for whatever reasons) has a different scale. The battery SOC for the different packs use a 1 scale, while the main battery SOC has a 0.1 scale

image

Derick8619 commented 3 weeks ago

Also, the file already have a Battery group on line 292, I think these new registers should be moved in that group with other related registers.

Maybe after the name: "Battery" register?

sounds like a good idea

Derick8619 commented 3 weeks ago

Guys I am new to this and in all honesty dont really know what I am doing!

Please can you edit the YAMYL to implement these changes as I will likely do something wrong. :/

davidrapan commented 3 weeks ago

Few more notes:

davidrapan commented 3 weeks ago

Looks good to me (I think) is it ready to download and test?

Yes.

Derick8619 commented 3 weeks ago

Few more notes:

  • class: battery can be used only once as this is how HA determines battery for device and I'm really not sure if it strictly follows order

Oh really, so its possible no data will be pulled from each individual sensor?

  • Fixed that scale but please someone confirm it's correct

I'm unsure how to confirm if the scale is correct, sorry! I am useless.

Can I test the YAMYL file and get back to you?

davidrapan commented 3 weeks ago

Oh really, so its possible no data will be pulled from each individual sensor?

No, it's not about that. This is just sensor classification for HA. Nothing to do with data itself.

davidrapan commented 3 weeks ago

More about that classification here.

Derick8619 commented 3 weeks ago

Looks good to me (I think) is it ready to download and test?

Yes.

Where do i download it from? The file in supported devices for KSTAR still shows the original file

davidrapan commented 3 weeks ago

You could replace the file directly in you HA using File editor.

Derick8619 commented 3 weeks ago

I was trying to add FILE EDITOR to my HA yesterday but I was unable to find it when searching in HACS repos or via standard integrations :(

davidrapan commented 3 weeks ago

I was trying to add FILE EDITOR to my HA yesterday but I was unable to find it when searching in HACS repos or via standard integrations :(

Cause it's not an integration but addon. Those are added from Settings >> Add-ons.

Derick8619 commented 3 weeks ago

I was trying to add FILE EDITOR to my HA yesterday but I was unable to find it when searching in HACS repos or via standard integrations :(

Cause it's not an integration but addon. Those are added from Settings >> Add-ons.

got it, downloading now

Derick8619 commented 3 weeks ago

please can you send me the updated YAMYL file so i can paste it into the editor? I cant see the updated file on here anywhere. Sorry!

davidrapan commented 3 weeks ago

kstar_hybrid.yaml

Derick8619 commented 3 weeks ago

Screenshot_28-10-2024_124537_192 168 1 93

Derick8619 commented 3 weeks ago

so i paste it into here and save?

not sure what all the dropdowns to the left had side do or whether they will affect anything?

davidrapan commented 3 weeks ago

Yeah, just replace the content of the file (CTRL+A >> CTRL+V) and hit the save button and then restart HA.

Derick8619 commented 3 weeks ago

Yeah, just replace the content of the file (CTRL+A >> CTRL+V) and hit the save button and then restart HA.

Ok but all i did was open the editor, I havent selected the original YAMYL, cant see it in the list to the left. confused.com

davidrapan commented 3 weeks ago

But on the image you have the file already open??? What???

Derick8619 commented 3 weeks ago

That was the file you sent me I just pasted it into the blank file editor page. Sorry I have never done this before

Sent from Yahoo Mail for iPhone

On Monday, October 28, 2024, 12:55 pm, David Rapan @.***> wrote:

But on the image you have the file already open??? What???

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

davidrapan commented 3 weeks ago

Ah I see... hah...

There is folder icon in the top next to the HA menu. There you can browse the whole folder tree. File of which content you want to replace is located: custom_components/solarman//inverter_definitions/kstar_hybrid.yaml

Derick8619 commented 3 weeks ago

ok pasted in the new file, restarted HA and now looking at the sensors, i cant see the new battery sensors, looks the same as before

davidrapan commented 3 weeks ago

Make sure you did it correctly:

Derick8619 commented 3 weeks ago

#

KSTAR Hybrid Inverter

Modbus information taken from "MODBUS RS485 Communication Protocol V2.5" document provided by KSTAR

#

This inverter exposes its data in the following registers (although not all of them are used by this definition file):

#

- INPUT_REGISTERS 3000 - 3792 decimal, 0x0BB8 - 0x0ED0 hexadecimal, 0x04 function code

- HOLDING_REGISTERS 3200 - 3246 decimal. 0x0C80 - 0x0CAE hexadecimal, 0x03 function code

#

info: manufacturer: KSTAR model: Hybrid Inverter

default: update_interval: 60 code: 0x04 digits: 6

parameters:

Derick8619 commented 3 weeks ago

sensors are definitely in the new file, i did CTRL+A then CTRL+V and then saved

Derick8619 commented 3 weeks ago

got it! they have appeared. i did a full restart initially rather than a full restart

Derick8619 commented 3 weeks ago

image

Derick8619 commented 3 weeks ago

you absolute legend