Comments (7)
Chapter "4.3 Query Interval" of the Sunny Webbox RPC User Manual specifies that the interval should not be less than 30s ... and more has probably limited value => support for a configurable scan_interval was never enabled.
If you really want to change this, you can modify this line with
# TODO: Move scan_interval to options ? pylint: disable=fixme
interval = timedelta(
seconds=entry.data.get(CONF_SCAN_INTERVAL, entry.data[CONF_SCAN_INTERVAL])
)
I should probably remove that from the configuration.yaml example and config flow to avoid confusion.
from ha-sma.
Were you able modify the file and get desired behavior ?
Also, how do you monitor scan rate ?
from ha-sma.
I tried it, but it did nothing.
from ha-sma.
Did you restarted HA after the modification ? Just to make before I look into this.
How do you monitor scan rate ?
from ha-sma.
Yes i did, I monitor scan rate by looking at how long it takes the sensor to update and it is still 30 s.
from ha-sma.
I'll have a look tomorrow (the update time is related to the latest data change not the latest data fetch I believe -> it could be that it is reading faster but that the value is only updated every 30s within the box).
To make sure, you can enable debug log for this integration in your configuration.yaml and watch fetching time in HA logs (parameters -> system -> logs, load full logs):
logger:
logs:
custom_components.sma_webbox: debug
ex. for mine (with a 30s scan interval)
2023-04-15 22:44:02.355 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] { " v e r s i o n " : " 1 . 0 " , " p r o c " : " G e t P l a n t O v e r v i e w " , " f o r m a t " : " J S O N " , " i d " : " 9 " }
2023-04-15 22:44:02.454 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] {'result': {'overview': [{'meta': 'GriPwr', 'name': 'Puissance', 'unit': 'W', 'value': '0'}, {'meta': 'GriEgyTdy', 'name': 'Énergie dégagée jour actuel', 'unit': 'kWh', 'value': '45.845'}, {'meta': 'GriEgyTot', 'name': 'Rendement total', 'unit': 'kWh', 'value': '70973.919'}, {'meta': 'OpStt', 'name': 'État', 'value': 'Ok, Ok'}, {'meta': 'Msg', 'name': 'Message', 'value': ''}]}, 'format': 'JSON', 'proc': 'GetPlantOverview', 'version': '1.0', 'id': '9'}
2023-04-15 22:44:03.359 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] { " v e r s i o n " : " 1 . 0 " , " p r o c " : " G e t P r o c e s s D a t a " , " f o r m a t " : " J S O N " , " i d " : " 1 0 " , " p a r a m s " : { " d e v i c e s " : [ { " k e y " : " 0 0 8 0 : 7 d c 8 9 8 6 f " , " c h a n n e l s " : [ " I p v " , " U p v - I s t " , " F a c " , " P a c " , " R i s o " , " h - O n " , " h - T o t a l " , " E - T o t a l " , " N e t z - E i n " ] } ] } }
2023-04-15 22:44:03.593 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] {'result': {'devices': [{'channels': [{'meta': 'Ipv', 'name': 'Entrée courant DC', 'unit': 'A', 'value': '---'}, {'meta': 'Upv-Ist', 'name': 'Entrée tension DC', 'unit': 'V', 'value': '---'}, {'meta': 'Fac', 'name': 'Fréquence du réseau', 'unit': 'Hz', 'value': '---'}, {'meta': 'Pac', 'name': 'Puissance', 'unit': 'W', 'value': '---'}, {'meta': 'Riso', 'name': 'Résistance d’isolement', 'unit': 'Ohm', 'value': '---'}, {'meta': 'h-On', 'name': 'Temps d’injection', 'unit': 'h', 'value': '41440.93'}, {'meta': 'h-Total', 'name': 'Temps de service', 'unit': 'h', 'value': '42483.6'}, {'meta': 'E-Total', 'name': 'Rendement total', 'unit': 'kWh', 'value': '70973.92'}, {'meta': 'Netz-Ein', 'name': 'Nombre de connexions au réseau', 'value': '4254'}], 'key': '0080:7dc8986f'}]}, 'format': 'JSON', 'proc': 'GetProcessData', 'version': '1.0', 'id': '10'}
2023-04-15 22:44:03.594 DEBUG (MainThread) [custom_components.sma_webbox] Finished fetching sma_webbox_coordinator data in 1.239 seconds (success: True)
2023-04-15 22:44:33.355 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] { " v e r s i o n " : " 1 . 0 " , " p r o c " : " G e t P l a n t O v e r v i e w " , " f o r m a t " : " J S O N " , " i d " : " 1 1 " }
2023-04-15 22:44:33.455 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] {'result': {'overview': [{'meta': 'GriPwr', 'name': 'Puissance', 'unit': 'W', 'value': '0'}, {'meta': 'GriEgyTdy', 'name': 'Énergie dégagée jour actuel', 'unit': 'kWh', 'value': '45.845'}, {'meta': 'GriEgyTot', 'name': 'Rendement total', 'unit': 'kWh', 'value': '70973.919'}, {'meta': 'OpStt', 'name': 'État', 'value': 'Ok, Ok'}, {'meta': 'Msg', 'name': 'Message', 'value': ''}]}, 'format': 'JSON', 'proc': 'GetPlantOverview', 'version': '1.0', 'id': '11'}
2023-04-15 22:44:34.355 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] { " v e r s i o n " : " 1 . 0 " , " p r o c " : " G e t P r o c e s s D a t a " , " f o r m a t " : " J S O N " , " i d " : " 1 2 " , " p a r a m s " : { " d e v i c e s " : [ { " k e y " : " 0 0 8 0 : 7 d c 8 9 8 6 f " , " c h a n n e l s " : [ " I p v " , " U p v - I s t " , " F a c " , " P a c " , " R i s o " , " h - O n " , " h - T o t a l " , " E - T o t a l " , " N e t z - E i n " ] } ] } }
2023-04-15 22:44:34.591 DEBUG (MainThread) [custom_components.sma_webbox.sma_webbox] {'result': {'devices': [{'channels': [{'meta': 'Ipv', 'name': 'Entrée courant DC', 'unit': 'A', 'value': '---'}, {'meta': 'Upv-Ist', 'name': 'Entrée tension DC', 'unit': 'V', 'value': '---'}, {'meta': 'Fac', 'name': 'Fréquence du réseau', 'unit': 'Hz', 'value': '---'}, {'meta': 'Pac', 'name': 'Puissance', 'unit': 'W', 'value': '---'}, {'meta': 'Riso', 'name': 'Résistance d’isolement', 'unit': 'Ohm', 'value': '---'}, {'meta': 'h-On', 'name': 'Temps d’injection', 'unit': 'h', 'value': '41440.93'}, {'meta': 'h-Total', 'name': 'Temps de service', 'unit': 'h', 'value': '42483.6'}, {'meta': 'E-Total', 'name': 'Rendement total', 'unit': 'kWh', 'value': '70973.92'}, {'meta': 'Netz-Ein', 'name': 'Nombre de connexions au réseau', 'value': '4254'}], 'key': '0080:7dc8986f'}]}, 'format': 'JSON', 'proc': 'GetProcessData', 'version': '1.0', 'id': '12'}
2023-04-15 22:44:34.592 DEBUG (MainThread) [custom_components.sma_webbox] Finished fetching sma_webbox_coordinator data in 1.237 seconds (success: True)
With debug level enabled, you should also see in these logs a message mentionning the scan_interval that has been loaded.
from ha-sma.
Just gave it a try using both configuration.yaml and configflow for integration setup and in both cases, scheduling of requests is taking place at the configured interval using the unmodified code (you can undo the above change, original code was OK already)
-> could you supply your logs ? (add a "default: warning" to the logger to limit debug verbosity to this integration as illustrated below)
logger:
default: warning
logs:
custom_components.sma_webbox: debug
from ha-sma.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-sma.