Skip to content

⚑ Solarman Stick Logger integration for 🏠 Home Assistant

License

Notifications You must be signed in to change notification settings

Kolbi/ha-solarman

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Solarman Stick Logger

Stable GitHub Activity License HACS Supported Discussions Wiki

Signpost

Note

If you are curious about what's planned next look into πŸͺ§ Milestones
Use πŸ’¬ Discussions for πŸ™ Q&A and πŸ’‘ Development Planning, etc. and leave 🚩 Issues for 🐞 bug reporting, 🎁 feature requests and such...

Note

It's still 🚧 work in progress but currently very 🐎 stable πŸ˜‰
I mean at least for my device as I'm not able to πŸ§ͺ test it for any other so any 🧍 volunteers? 😊

Important

This integration builds on and is heavily inspired by @StephanJoubert (but W/ decent amount of changes):

  • Using asynchronous part of @jmccrohan + small adjustments to the inner workings of the library itself
  • Fetching is implemented through DataUpdateCoordinator + incorporates many more up to date features of HA
  • Supports configuration of inverter parameters (Battery, Work Mode, ...)
  • Improved stability (no more disconnects and missing values)
  • Discovery and not just for configuration but also as part of initialization (i.e. adapts to changed IP)
  • New Inverter profiles features *See 'deye_sg04lp3.yaml' for examples:
    • Different registers can be requested in different intervals according to their 'update_interval' set in inverter definition file
    • Registers which will be part of a request are decided dynamically (when missing from the inverter definition file)
    • Added attribute type of a sensor which can be attached to any other sensor
    • Added configuration for Battery Nominal Voltage and Battery Life Cycle Rating for calculating SOH and life cycles of the battery
  • And many more fixes and improvements (while trying to fully preserve backward compatibility)

Warning

It's note worthy that some names of the SG04LP3 sensors did change for different reasons (some were due to aestetics, etc.)
So look through the file and change them as you see fit manually before I'll make it available from the HA configuration.
One more thing.. It's not possible to use this integration side by side (with the same device) with the implementation from Stephan! It will override it.
TODO: Rest of the info... πŸ˜ƒ

πŸš€ Miscellaneous

Some might wonder why Energy Dashboard shows different(higher) Load Consumption than sensor like for example "Today(Daily) Load Consumption. And it's because the Energy Dashboard does it's own calculations by summing up Imported(Bought) and Produced energy which also includes consumption of the inverter itself + some AC/DC losses along the way."

So for those curious enough here is some insight...

Inverter power losses calculation [W]:

Power losses = Battery Power + PV1 Power + PV2 Power - Inverter Power

Total losses calculation [kWh]:

Total losses = Total Energy Imported(Bought) + Total Production + Total Battery Discharge - Total Energy Exported(Sold) - Total Battery Charge - Total Load Consumption

Today(Daily) losses calculation [kWh]:

Today(Daily) losses = Today(Daily) Energy Imported(Bought) + Today(Daily) Production + Today(Daily) Battery Discharge - Today(Daily) Energy Exported(Sold) - Today(Daily) Battery Charge - Today(Daily) Load Consumption

To get value which is in Energy Dashboard as "Home Consumption" remove subtraction of Load Consumption from the above.

🏭 Diagnostics

I was using during the development also this sensor bundle:

template:
  - trigger:
      - platform: time_pattern
        seconds: /1
    sensor:
      - name: "Update Ticker"
        unique_id: "update_ticker"
        state: "{{ '%0.6f' % as_timestamp(now()) }}"
        icon: "mdi:metronome-tick"
  - sensor:
      - name: "Inverter Device Since Last update"
        unique_id: "inverter_device_since_last_update"
        availability: "{{ has_value('sensor.inverter_connection_status') }}"
        state: "{{ max((states('sensor.update_ticker') | float - as_timestamp(states.sensor.inverter_connection_status.last_updated)) | round(0, 'ceil'), 0) }}"
        state_class: "Measurement"
        device_class: "Duration"
        unit_of_measurement: "s"
      - name: "Inverter Device Last update"
        unique_id: "inverter_device_last_update"
        availability: "{{ has_value('sensor.inverter_connection_status') }}"
        state: "{{ (states.sensor.inverter_connection_status.last_updated | as_local).strftime('%H:%M:%S') }} ❘ {{ '%02d' % states('sensor.inverter_device_since_last_update') | int(0) }} seconds ago"
        icon: "mdi:calendar-clock"

Which provides informantion about how long it is since last update (with resolution of seconds).
Maybe it will be useful for some, but since the stability of the polling improved a lot it's not really needed.

πŸ”¨ Installation

πŸ”Œ Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

πŸͺ› HACS (Manually)

πŸ”§ Manually

  • Copy the contents of 'custom_components/solarman' directory into the Home Assistant with exactly the same hirearchy within the '/config' directory

πŸ‘€ Contributors

About

⚑ Solarman Stick Logger integration for 🏠 Home Assistant

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%