davidrapan / ha-solarman

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

update_interval not working #30

Closed gedger closed 4 months ago

gedger commented 4 months ago

Adding the default section to the inverter configuration and then restarting HA does not change the update rate. Code from commit c55af98

default:
  update_interval: 30
  digits: 6
davidrapan commented 4 months ago

Run it with debug enabled please a place the log here.

Don't forget to obfuscate the serial.

gedger commented 4 months ago

Edit: Forgot to obfuscate serial from all places. So I downloaded it and deleted this message 😉

davidrapan commented 4 months ago

Ah never mind I know what is the issue...

Registers which will be part of a request are decided dynamically (when not set in the inverter profile)

  • Can be requested individually in specific intervals according to their 'update_interval' value set in the inverter profile file (defaults to 60 seconds)

when not set in the inverter profile ... is crucial here.

And problem is that it's not yet designed to work with any other code than 0x03 and you are using 0x04.

davidrapan commented 4 months ago

afdcc0e

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

And delete whole requests segment.

gedger commented 4 months ago

Still some issues, have added debug log.

Are there any plans on adding support for different Modbus function codes? My inverter uses function code 2 for fault status, function code 3 for reading inverter settings and function code 4 for status so my current inverter configuration has all 3 codes in use! For testing I have deleted everything except the function code 4 as these are the most important.

Screenshot 2024-07-23 at 09 27 42

home-assistant_solarman_2024-07-23T08-17-46.803Z.log

davidrapan commented 4 months ago

I still barely understand this implementation cause there is so little whings which really makes sense but yeah I would love to support as much as possible. :-)

When comes to the log.. oh god that's strange... can you show me your profile file?

Edit: You know what try to also add 'min_span':

default:
  update_interval: 30
  code: 0x04
  min_span: 100
  digits: 6

Edit2: Oh I think I found the culprit!

davidrapan commented 4 months ago

f422188

gedger commented 4 months ago

Fixed it and the update_interval issue :clap: