sfstar / hass-victron

Integration for Home Assistant to fetch data from the victron gx device via modbusTCP
Apache License 2.0
168 stars 24 forks source link

Sensors not available on energy dashboard #4

Open FcoCalero opened 1 year ago

FcoCalero commented 1 year ago

Hi,

Would be nice to have the sensors avaiable for the energy dashboard. Thanks for this integration :)

Regards

sfstar commented 1 year ago

Hello @FcoCalero,

Do you mean the home assistant built in energy dashboard? I.e. this:

Screenshot 2022-12-05 at 09 12 26

In that case the sensors should be available in the energy dashboard configuration section. I.e. this page:

image

You can go to this page by clicking the "my energy configuration" button below: Open your Home Assistant instance and show your Energy configuration panel.

If this is not what you meant please let me know.

FcoCalero commented 1 year ago

Yes, is what i meant. I've just done a clean installation to check it a second time and i confirm they are not available in the energy dashboard configuration section after provide the GX ip.

sfstar commented 1 year ago

Hmm strange. This is what I see when I try to add another battery system:

Screenshot 2022-12-06 at 05 32 14

It seems that I can't recreate the observed behaviour on my end. Could you share your local integrations page (namely the victron entry and listed entities): (should look like this):

Screenshot 2022-12-06 at 12 43 25

And also share a screenshot of you trying to add a specific entity in the energy configuration dashboard (to see what entities are available to you).

Thanks in advance

FcoCalero commented 1 year ago

Sure no problem.

image image

sfstar commented 1 year ago

It seems that only the system device (unit 100) was detected during the last scan. Unit 100 doesn't have any kWh based entities that it exposes to home assistant. Tthe energy dashboard only allows you to select mWh, gWh or kWh based entities.

Therefore you aren't seeing any victron entities in the grid consumption selection menu. Devices like a multiplus II, gavazzi grid meter and bms can device do expose registers with kWh as the unit of measurement.

To further troubleshoot could you provide me with a list of components that make up your victron system. (Example: my personal setup) 3 x multiplus II 48/5000 (one is a gx variant) 2 x Gavazzi grid meter ET112 1 x external AC (sunspec) pvinterter SOLAREDGE 1 x bms can battery SEPLOS

Furthermore, if your additional components are visible in the GX dashboard, you could do a rescan of available devices via the "configure" section of the integration. This will, combined with a restart, expose additional devices if they are currently available via modbus TCP.

FcoCalero commented 1 year ago

Here is the equipment i have working.

image image

Also i paste here the sensors i've been using in HA out of this integration. Another thing i've noticed is that for example, Grid lost alarm and Battery State of Charge are not listed but that's for another thread maybe.

  - name: "Grid Power"
    scan_interval: 10
    slave: 100
    address: 820
    data_type: int16
    unique_id: Victron_grid_power
    unit_of_measurement: 'Wh'
    state_class: 'total_increasing'
    device_class: 'energy'

  - name: "AC Loads"
    scan_interval: 10
    unit_of_measurement: 'kWh'
    slave: 100
    address: 817
    data_type: int16
    unique_id: Victron_ac_loads
    state_class: 'total_increasing'
    device_class: 'energy'

  - name: "Inverter State"
    scan_interval: 10
    slave: 227
    address: 31 
    data_type: int16
    unique_id: Victron_inverter_state

  - name: "ESS State"
    scan_interval: 10
    slave: 100
    address: 2900
    data_type: int16
    unique_id: Victron_ess_state

  - name: 'Grid lost alarm'
    slave: 227
    address: 64
    data_type: uint16
    unit_of_measurement: "0=Ok;1=Warning;2=Alarm"

  - name: "Battery State of Charge"
    scan_interval: 10
    slave: 100
    address: 843
    data_type: int16
    unique_id: Victron_ess_battery

  - name: "Battery status"
    unit_of_measurement: 'kWh'
    scan_interval: 10
    slave: 100
    address: 844
    data_type: int16
    unique_id: Victron_battery_status
    state_class: 'measurement'
    device_class: 'energy'

  - name: "Charger power"
    scan_interval: 10
    unit_of_measurement: 'kWh'
    slave: 100
    address: 866
    data_type: int16
    unique_id: Victron_charger_power
    state_class: 'total_increasing'
    device_class: 'energy'
sfstar commented 1 year ago

So I might have found the cause for your issue. Your screenshots show that you are running the following firmware versions: GX: v2.84 multiplus: 481

While i'm running: GX: v2.92 multiplus: 492

Where this might lead to the issues you are observing is that the victron modbus TCP spec sheet states that rev 43 introduces:

  | Add registers for VE.Bus Multi energy counters |  
  | Add registers for wakespeed alternators |  
  | Fix incorrect unit for PV-Inverter powerlimit register |  
  | Add new tank types to fluid type enum |  
  | Add additional diagnostic items for CAN-bms batteries |  
  | Add LowSoc alarm register for Inverter RS and Multi RS |  
  | Fix remarks for register 2903 |  

Specifically:

  | Add registers for VE.Bus Multi energy counters |  

The integration treats all vebus registers as one request. Including:

    "vebus_acin1toacout": RegisterInfo(74, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_acin1toinverter": RegisterInfo(76, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_acin2toacout": RegisterInfo(78, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_acin2toinverter": RegisterInfo(80, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_acouttoacin1": RegisterInfo(82, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_acouttoacin2": RegisterInfo(84, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_invertertoacin1": RegisterInfo(86, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_invertertoacin2": RegisterInfo(88, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_invertertoacout": RegisterInfo(90, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100),
    "vebus_outtoinverter": RegisterInfo(92, UINT32, UnitOfEnergy.KILO_WATT_HOUR, 100)

It might be the case that your firmware version doesn't contain these register entries. Which would cause the scan request for a vebus device on unit address 227 to fail. Hence these registers not being available as entities to you. I will look into creating a seperate list so that the older vebus registers being present (while the above mentioned "new" registers are not) won't cause the entire vebus device to be skipped.

If this fixes your issue it won't mean that all devices running older firmware will work without any issues. Since victron has made more changes and revisions and it isn't that clear what fw matches which modbus tcp spec revision. What makes this (supporting older firmware versions) even more difficult is that it isn't always clear based on the revision information which registers were present before and which were added after.

Victron added register 74 until 92 with information as to the total energy going from/to the acin1/acout and battery. Since you might want to use the information these register provide in your energy dashboard I recommend updating to the latest victron firmware version for the best experience with this integration.

Note: Splitting the integrations register list for vebus into 2 lists will require all users with an vebus device to rescan for available devices. I'm hoping to find an solution that allows me to force a rescan upon an upgrade but if that can't be done it might take a while for this change to be included in an integration update. (In case this is not possible I would like to group breaking changes in order to limit the impact of an upgrade on existing users.)

FcoCalero commented 1 year ago

ok, makes sense, thanks. In my case i think im gonna try to upgrade the firmware and see the differencies, hope for better :). I will let you know the behaviour once the new firmware is working.

About the issue to scan other devices, what if you add a text box during the intial configuration to look for devices ID manually.

FcoCalero commented 1 year ago

After GX device firmware updated, this is how it looks like.

image

After reboot HA

image

Now i have added the entities which i saw they are incrementing

image

Thank so much :)

sfstar commented 1 year ago

No problem, thank you for confirming that a firmware upgrade solved your issues. For now i'm going to leave this issue open until an implementation / decision is reached on whether and how to support older fw versions that want to use this integration