Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solis HMI Firmware FB00 #1143

Merged
merged 13 commits into from
Dec 23, 2024
Merged

Solis HMI Firmware FB00 #1143

merged 13 commits into from
Dec 23, 2024

Conversation

fboundy
Copy link
Contributor

@fboundy fboundy commented Nov 21, 2024

Add support for Solis HMI firmware which:

  • Simplifies the Energy Code Switch options
  • Has 6 charge and discharge slots rather than 3
  • Has separate Current, Target SOC and Voltage for each Charge/Discharge slot

Note that on the inverter and in the SolisCloud API interface each slot also has an On/Off switch. I have not found a ModBus register for this so this will need to be set "ON" once on the inverter or through SolisCloud. It is also not clear what the Voltage target on each slot does.

@fboundy fboundy mentioned this pull request Nov 21, 2024
@ajan1
Copy link

ajan1 commented Dec 18, 2024

I have charge/discharge slot on/off switches in address 43707. Bits 0-5 charge 1-6 and bits 6-11 for discharge 1-6

I tried this pull. I didn't get how to enable/disable my time slots?

My inverter: RHI-3P8K-HVES-5G

@fboundy
Copy link
Contributor Author

fboundy commented Dec 18, 2024 via email

@fboundy
Copy link
Contributor Author

fboundy commented Dec 21, 2024

Now updated to add switches. This is quite a big PR as the SWITCHES platform wasn't previously used. I have added SWITCH_TYPES to the solis_fb00 plugin and empty lists to all the other plugins.

@wills106
Copy link
Owner

Need to relook into #948 (comment) to prevent all of these huge file diff's due to people having different formatting settings. It's making it impossible to know what's actually changed. Same with #1173

@litinoveweedle @fboundy @PatrikTrestik any idea on the best approach / guide on how to set something up?
Last time I looked at VS Code plugin "Black Formatter" it made a right mess locally.

@fboundy
Copy link
Contributor Author

fboundy commented Dec 22, 2024

I use Black in VS Code with --linelength=119 but I think what @litinoveweedle is suggesting would run Black at the server level and solve this. I'd be keen to understand how to implement this on my repos too

@fboundy
Copy link
Contributor Author

fboundy commented Dec 22, 2024

On a separate note, I'm note sure whether it is best to keep this as a separate plugin or to try to merge it with plugin_solis.py. Register 33002 gives the relevant firmware version. If it is >= 0x4B (75) then this new plugin should be used, otherwise the old one is correct. Just not quite sure how to implement this switch.

@fboundy
Copy link
Contributor Author

fboundy commented Dec 22, 2024

Need to relook into #948 (comment) to prevent all of these huge file diff's due to people having different formatting settings. It's making it impossible to know what's actually changed. Same with #1173

@litinoveweedle @fboundy @PatrikTrestik any idea on the best approach / guide on how to set something up? Last time I looked at VS Code plugin "Black Formatter" it made a right mess locally.

ChatGPT says it's easy. I will have a try on one of my repos.

To deploy a GitHub CI workflow that runs the Black formatter on all commits, you can use GitHub Actions. Here's how to set it up:
Steps:

Create a .github/workflows directory in your repository if it doesn’t already exist.

Add a new YAML file for the workflow:
Name it something like black-check.yml.

Write the workflow:
Below is an example workflow that uses Black to check Python files in your repository:

name: Black Formatter Check

on:
  push:
    branches:
      - main  # Specify the branches you want to check (e.g., main)
  pull_request:
    branches:
      - main  # Run checks for pull requests targeting main

jobs:
  black:
    name: Run Black Formatter
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.x'

      - name: Install Black
        run: |
          python -m pip install --upgrade pip
          pip install black

      - name: Run Black Formatter
        run: black --check --diff .


@wills106
Copy link
Owner

I was thinking of adding GEN to older Firmware's and then adding in GEN2 for the newer.
#1142 (comment)
Then have the relevant tags where they spilt. The GEN, GEN2, GEN3 etc used used quite a bit on SolaX as they share base registers and then split. But it's defined by the serial and not an extra Register ie 33002

I have just been too busy over the past few weeks to look at the various PR's on here / do any development.

@litinoveweedle
Copy link
Contributor

Hello,

I am using for my project automatic formatters hooked to the CI (GitHub actions). It works as supposed - runs on PR merge/push so code is always reformatted before merging - therefore you avoid this commits mess. I can try to help, although I am not an expert and my actions are mostly copy paste of existing examples. :-)

@wills106 wills106 merged commit 8456123 into wills106:main Dec 23, 2024
2 checks passed
@wills106
Copy link
Owner

I have added in pyproject.toml with black and line-length 119
Is it possible to force VS Code to have black as a dependency in the pyproject.toml file? I'm quite new to this.

Also added in workflow for black as well with the same line-length

@fboundy
Copy link
Contributor Author

fboundy commented Dec 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants