mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
304 stars 79 forks source link

rapid reading of grid power #239

Closed elektrinis closed 2 months ago

elektrinis commented 5 months ago

I want to implement my own energy management system, and for that I need to read grid power quite frequently, more than once per second. Is this possible? All other values can remain slow, like they are now.

Louisbertelsmann commented 5 months ago

Unfortunately, Home Assistant doesn't support readings faster than once a second. It would only be possible outside Homeassistant or using a python integration, but I am no expert at that. Also, if you go far enough, you might also overwhelm the inverter.

elektrinis commented 5 months ago

What about once per second? How would I go about this? I remember reading somewhere that anything below 10s can crash the inverter. Is this true?

Louisbertelsmann commented 5 months ago

I am using 1s refresh times on my inverter and it actually works better than 10s (Sungrow is weird, so the inverter basically closes the connection and isn't ready when modbus tries to read it...) You would change the scan_interval of the sensors you want to read faster to 1 or something like that.

elektrinis commented 2 months ago

Just confirming that I have changed the time to 1 second in yaml and it works. Would love to get this more frequent though.

Louisbertelsmann commented 2 months ago

Unfortunately you can't change the delay to a lower one. For that one would need to use pymodbus directly, which we would have to write an integration for.