davidrapan / ha-solarman

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

Solis Hybrid - Inverter configuration from integration (Moved from StephanJoubert's) #98

Closed OneScuzzie2k closed 2 months ago

OneScuzzie2k commented 3 months ago

I have moved from a old working addon, but this one will not work with my Solis Hybrid I am getting this

Logger: custom_components.solarman.api Source: custom_components/solarman/api.py:206 integration: Solarman (documentation, issues) First occurred: 15:56:34 (34 occurrences) Last logged: 15:59:40

[4090370252] Querying (33029 - 33152) failed. #0 [V5FrameError: V5 frame does not contain a valid Modbus RTU frame]
[4090370252] Querying (33029 - 33152) failed. #0 [IllegalDataAddressError: The data address received in the request is not an allowable address for the server. ]
[4090370252] Querying (33022 - 33147) failed. #0 [IllegalDataValueError: The value contained in the request data field is not an allowable value for the server. ]
davidrapan commented 3 months ago

Hey @OneScuzzie2k, those errors means that you are trying to read incorrect registers. What exactl model and definition profile are you using?

And from which version are you migrating?

OneScuzzie2k commented 3 months ago

Hi David thanks for getting back to me so quickly, I am coming from Solaman v1.5.1. I am using a Solis Hybrid, this is what I also use on StephanJoubert one and it all seems to work great.

I tried a install over the top to keep all the names for my setup, and a uninstall of the old one and a new install of yours.

davidrapan commented 3 months ago

So you used your own definition profile?

OneScuzzie2k commented 3 months ago

I tried my own one that I used on the StephanJoubert one and your solis_hybrid.yaml neither work. I just get failed to setup

OneScuzzie2k commented 3 months ago

I am rolled back to StephanJoubert to get it working works straigh away. Just putting your version back on just incase you want some more informtion

davidrapan commented 3 months ago

Try to put in the profile file into default section:

  min_span: 1

or add section into your custom one:

requests_fine_control:

If you are not sure where those belongs just show me here where did you put it and I'll correct you if needed.

OneScuzzie2k commented 3 months ago

Same I am afraid image image

OneScuzzie2k commented 3 months ago

Its just clicked in and started working.... let me try my yaml

davidrapan commented 3 months ago

Good. Can you then please test for me continuously increasing the value until it stops working again? And tell me the highest number you could put there?

It should be somewhere between 1 and 25

OneScuzzie2k commented 3 months ago

OK on it now....

davidrapan commented 3 months ago

Anyway to explain what is happening. In our integration are requested registers decided by sensor descriptions. And somewhere in the range 33029-33152 are registers which can't be read from your device for some reason. And lowering the min_span from 25 will create more requests from that range and just single one and that's why it works. 😉

OneScuzzie2k commented 3 months ago

Seems to have stopped all together now even with min_span set to 1 doh!

OneScuzzie2k commented 3 months ago

Ignore that its kicked in, i thing anything other than 1 breaks it

OneScuzzie2k commented 3 months ago

Think its gonna have to stay on 1!

davidrapan commented 3 months ago

Seems to have stopped all together now even with min_span set to 1 doh!

Yeah you have to give it some time to adjust and properly restart and sh*t ;)

With lower values there is going to be clearly visible which registers causes the issues. So maybe you could look for them? If you want ofc.

OneScuzzie2k commented 3 months ago

OK, writing back, can you tell me on these:

- name: "Solis Timed Charge Start Hour"
  class: "current"
  state_class: "measurement"
  uom: ""
  scale: 1
  rule: 1
  registers: [43143]
  icon: 'mdi:clock'
- name: "Solis Timed Charge Start Minute"
  class: "current"
  state_class: "measurement"
  uom: ""
  scale: 1
  rule: 1
  registers: [43144]
  icon: 'mdi:clock'
- name: "Solis Timed Charge End Hour"
  class: "current"
  state_class: "measurement"
  uom: ""
  scale: 1
  rule: 1
  registers: [43145]
  icon: 'mdi:clock'
- name: "Solis Timed Charge End Minute"
  class: "current"
  state_class: "measurement"
  uom: ""
  scale: 1
  rule: 1
  registers: [43146]
  icon: 'mdi:clock'

If i set 43142 to 3, 43143 to 31, 43144 to 6 and 43145 to 32 I get these figures? image

Sorry really greatful for your cleverness in doing this plugin, I would not have a clue, this is the other reason I needed to move as I cannot write times on demand to change charge on demand and dump to grid on demand.

OneScuzzie2k commented 3 months ago

In matter of fact it does the same as the other driver does it shows in the solarman driver as these times, yet it does not change them at all, they do not match on the invertor.

OneScuzzie2k commented 3 months ago

WhatsApp Image 2024-08-18 at 19 01 51_5359b2cc

OneScuzzie2k commented 3 months ago

Strange the Modbus reads something that is not set

davidrapan commented 3 months ago

I'm doing it too with my device (Deye SG04LP3) but we have in the profile properly setup registers as writable and we can configure them without that service.

Maybe we could try to implement it for your device too hm?

Edit: Let's try it with single value, gimme a sec and i try to give you sensor description which you can put in your profile :)

OneScuzzie2k commented 3 months ago

I am happy to try anything, I want to be able to change the times on the invertor to force a discharge to grid or to charge on demand, I wanted to be able to set the Discharge start hour to "{{ states('sensor.solarman_solis_hour')}}" and the discharge minute to "{{ states('sensor.solarman_solis_minute') | int + 2 }}" and reverse on charge on demand

davidrapan commented 3 months ago

Technical question, how many "rows" or entries it has? (When I'm looking at the pic from inverter's display)

OneScuzzie2k commented 3 months ago

I only use the 4 Charge and 4 dischard so as below, but I did read the extra time 2 and time 3 ones but not needed.

43142

43146

davidrapan commented 3 months ago

Okay but when you change those values in the inverter, are they then properly displayed in the Home Assistant?

OneScuzzie2k commented 3 months ago

Yes

OneScuzzie2k commented 3 months ago

But If i change them on the write holding, the show on HA as incorrect values to what I set, but dont update the invertor

davidrapan commented 3 months ago

And did you also tried the other service for writing?

davidrapan commented 3 months ago

Anyway, try add into the profile this:

      - name: "Program 1 Time Start Hour"
        platform: number
        state_class: measurement
        uom: "H"
        scale: 1
        rule: 1
        registers: [43143]
        icon: "mdi:wrench-clock"

Restart the HA or reload the integration and then you should see in the device detail page configurable value.

OneScuzzie2k commented 3 months ago

No as these are the only ones I need to change, I had the same experince with StephanJoubert Solarman. In mater of face I changed them using the Modbus, but they still display incorrect on the HA, yet different on the invertor still.

OneScuzzie2k commented 3 months ago

image Added let me reboot and try

davidrapan commented 3 months ago

And when you change the value there try wait let's say at least 30 seconds before you check the inverter.

OneScuzzie2k commented 3 months ago

Perfect I actually added:

- name: "Program 1 Time Start Hours"
  platform: number
  state_class: measurement
  uom: "H"
  scale: 1
  rule: 1
  registers: [43142]
  icon: "mdi:wrench-clock"
  - name: "Program 1 Time Start Minutes"
  platform: number
  state_class: measurement
  uom: "H"
  scale: 1
  rule: 1
  registers: [43143]
  icon: "mdi:wrench-clock"
davidrapan commented 3 months ago

You have a spacing typo before the second dash.

OneScuzzie2k commented 3 months ago

Yeah noticed corrected before restart :)

davidrapan commented 3 months ago

Another typo: Hour: 43143, Minute: 43144 solis_hybrid_programs_times

OneScuzzie2k commented 3 months ago

Doh!

davidrapan commented 3 months ago

I'll return back for a sec to the request problem best for you will be to set requests like this (instead of setting that min_span):

requests_fine_control:
requests:
  - start: 33022
    end:  33095
    mb_functioncode: 0x04
  - start: 33116
    end:  33179
    mb_functioncode: 0x04
  - start: 33206
    end:  33282
    mb_functioncode: 0x04
  - start: 43000
    end: 43150
    mb_functioncode: 0x03

Notice the requests_fine_control: it's right above and aligned with the requests: and it will ensure the requesting will follow what's exactly set in the requests section. 😉

And remove the min_span: 1

OneScuzzie2k commented 3 months ago

Just trying the time setting via the write on the driver atm....

OneScuzzie2k commented 3 months ago

Didnt work, the change show on the Modbus values but not the invertor. Set to start hour 2 start minute 31, but the invertor does not update. still shows as 2 and 30

OneScuzzie2k commented 3 months ago

I'll return back for a sec to the request problem best for you will be to set requests like this (instead of setting that min_span):

requests_fine_control:
requests:
  - start: 33022
    end:  33095
    mb_functioncode: 0x04
  - start: 33116
    end:  33179
    mb_functioncode: 0x04
  - start: 33206
    end:  33282
    mb_functioncode: 0x04
  - start: 43000
    end: 43150
    mb_functioncode: 0x03

Notice the requests_fine_control: it's right above and aligned with the requests: and it will ensure the requesting will follow what's exactly set in the requests section. 😉

And remove the min_span: 1

This is what I had orginally on my old YAML

davidrapan commented 3 months ago

With requests_fine_control: too? It's important.

Didnt work, the change show on the Modbus values but not the invertor. Set to start hour 2 start minute 31, but the invertor does not update. still shows as 2 and 30

Show me. Also enable debug before you try to set it and then wait some time, try to set, wait some time. Disable debug and give the log file please.

OneScuzzie2k commented 3 months ago

With requests_fine_control: too? It's important.

Didnt work, the change show on the Modbus values but not the invertor. Set to start hour 2 start minute 31, but the invertor does not update. still shows as 2 and 30

Show me. Also enable debug before you try to set it and then wait some time, try to set, wait some time. Disable debug and give the log file please.

No just added this, let me try again....

OneScuzzie2k commented 3 months ago

Adding this: requests_fine_control: requests:

has now stopped it working again.... image

davidrapan commented 3 months ago

Try increase the first number: 33022 to 33029

davidrapan commented 3 months ago

Oh wait a minute: start: 43000 end: 43150 is also too long i think? It can only be 125 at max. try to separate that one into 2

OneScuzzie2k commented 3 months ago

Try increase the first number: 33022 to 33029

Just rebooting, normally 33022 reads fine as its the invertor rime

davidrapan commented 3 months ago

Just rebooting, normally 33022 reads fine as its the invertor rime

Yeah I know I'm just guessing honestly. That long request is probably the issue, imo.

OneScuzzie2k commented 3 months ago
davidrapan commented 3 months ago

Maybe better will be to not to push that 125 limit and go 43000 - 43100.

When you are done with this show me then those new configurable items in the device view.

davidrapan commented 3 months ago

According to sensors in the file you need only 43011 - 43025 and 43141 - 43150 anyway.