tkupka / ad-growatt

Controlling Growatt inverter, grid first, battery frist, export limit
0 stars 1 forks source link

Unexpected error in worker for App get_charge_settings: #2

Closed RienduPre closed 6 months ago

RienduPre commented 6 months ago

Hi,

other reported issue is solved, now I get this new error Thanks for you help. I think we are close to solve this.

`s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to INFO s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-appdaemon: starting s6-rc: info: service init-appdaemon successfully started s6-rc: info: service appdaemon: starting s6-rc: info: service appdaemon successfully started s6-rc: info: service legacy-services: starting [12:36:18] INFO: Starting AppDaemon... s6-rc: info: service legacy-services successfully started 2024-03-18 12:36:22.723386 INFO AppDaemon: AppDaemon Version 4.4.2 starting 2024-03-18 12:36:22.723703 INFO AppDaemon: Python version is 3.11.6 2024-03-18 12:36:22.723906 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml 2024-03-18 12:36:22.724099 INFO AppDaemon: Added log: AppDaemon 2024-03-18 12:36:22.724346 INFO AppDaemon: Added log: Error 2024-03-18 12:36:22.724564 INFO AppDaemon: Added log: Access 2024-03-18 12:36:22.724787 INFO AppDaemon: Added log: Diag 2024-03-18 12:36:22.975024 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2024-03-18 12:36:23.236883 INFO HASS: HASS Plugin Initializing 2024-03-18 12:36:23.237115 WARNING HASS: ha_url not found in HASS configuration - module not initialized 2024-03-18 12:36:23.237291 INFO HASS: HASS Plugin initialization complete 2024-03-18 12:36:23.237767 INFO AppDaemon: Initializing HTTP 2024-03-18 12:36:23.238174 INFO AppDaemon: Using 'socketio' for event stream 2024-03-18 12:36:23.245555 INFO AppDaemon: Starting API 2024-03-18 12:36:23.248374 INFO AppDaemon: Starting Admin Interface 2024-03-18 12:36:23.248842 INFO AppDaemon: Starting Dashboards 2024-03-18 12:36:23.266696 INFO HASS: Connected to Home Assistant 2024.3.1 2024-03-18 12:36:23.282943 INFO AppDaemon: App 'get_charge_settings' added 2024-03-18 12:36:23.284451 INFO AppDaemon: Found 1 active apps 2024-03-18 12:36:23.284794 INFO AppDaemon: Found 0 inactive apps 2024-03-18 12:36:23.285055 INFO AppDaemon: Found 0 global libraries 2024-03-18 12:36:23.285371 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2024-03-18 12:36:23.286401 INFO AppDaemon: Running on port 5050 2024-03-18 12:36:23.380891 INFO HASS: Evaluating startup conditions 2024-03-18 12:36:23.396025 INFO HASS: Startup condition met: hass state=RUNNING 2024-03-18 12:36:23.396365 INFO HASS: All startup conditions met 2024-03-18 12:36:23.475588 INFO AppDaemon: Got initial state from namespace default 2024-03-18 12:36:25.292068 INFO AppDaemon: Scheduler running in realtime 2024-03-18 12:36:25.296406 INFO AppDaemon: Adding /config/apps to module import path 2024-03-18 12:36:25.298475 INFO AppDaemon: Loading App Module: /config/apps/growatt_app.py 2024-03-18 12:36:25.368389 WARNING AppDaemon: No app description found for: /config/apps/growattServer.py - ignoring 2024-03-18 12:36:25.370055 WARNING AppDaemon: No app description found for: /config/apps/stateLogger.py - ignoring 2024-03-18 12:36:25.372348 INFO AppDaemon: Loading app get_charge_settings using class AD_Growatt from module growatt_app 2024-03-18 12:36:25.375796 INFO AppDaemon: Calling initialize() for get_charge_settings 2024-03-18 12:36:25.438461 INFO get_charge_settings: Checking session.... 2024-03-18 12:36:25.459225 INFO get_charge_settings: Session refresh time: 2024-03-18 12:16:25.377331 2024-03-18 12:36:25.460682 INFO get_charge_settings: Logging... 2024-03-18 12:36:25.790227 INFO get_charge_settings: Headers: {'User-Agent': 'Dalvik/2.0.0 (Linux; U; Android 13; HA:DNG0A4702R202403181236)'} 2024-03-18 12:36:25.791962 INFO get_charge_settings: Login URL: https://openapi.growatt.com/newTwoLoginAPI.do 2024-03-18 12:36:25.793458 INFO get_charge_settings: Login user: 2024-03-18 12:36:25.794985 INFO get_charge_settings: Login Password: 94f726b2b16c6d045d8c1ded63b 2024-03-18 12:36:25.796492 INFO get_charge_settings: Login Response from Growatt: <Response [200]> 2024-03-18 12:36:25.797959 INFO get_charge_settings: Login Response Code from Growatt: 200 2024-03-18 12:36:25.799441 INFO get_charge_settings: Login Response content from Growatt: b'{"result":1}' 2024-03-18 12:36:25.800912 INFO get_charge_settings: Login Response code passed 2024-03-18 12:36:25.802558 INFO get_charge_settings: Login Response data: 1 2024-03-18 12:36:25.985404 INFO get_charge_settings: Login status: 1 2024-03-18 12:36:25.986979 INFO get_charge_settings: Login success.... 2024-03-18 12:36:26.005422 INFO get_charge_settings: Login time: 2024-03-18 12:36:26.001936 2024-03-18 12:36:26.030992 INFO AppDaemon: App initialization complete 2024-03-18 12:36:26.050150 INFO get_charge_settings: Checking session.... 2024-03-18 12:36:26.072725 INFO get_charge_settings: Session refresh time: 2024-03-18 13:06:26.001936 2024-03-18 12:36:26.129139 INFO get_charge_settings: Response from growat: 2024-03-18 12:36:26.129977 INFO get_charge_settings: None 2024-03-18 12:36:26.131202 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-18 12:36:26.131981 WARNING get_charge_settings: Unexpected error in worker for App get_charge_settings: 2024-03-18 12:36:26.132680 WARNING get_charge_settings: Worker Ags: {'id': 'e776412ef6754effb1dd4e7e55467cc0', 'name': 'get_charge_settings', 'objectid': 'e031c04d3c0943d784422ed7de476ab3', 'type': 'state', 'function': <bound method AD_Growatt.get_charge_settings of <growatt_app.AD_Growatt object at 0xffffb2d479d0>>, 'attribute': 'state', 'entity': 'input_button.adgw_get_charge_settings_button', 'new_state': '2024-03-18T11:36:26.039948+00:00', 'old_state': '2024-03-18T11:22:09.625306+00:00', 'pin_app': True, 'pin_thread': 0, 'kwargs': {'__thread_id': 'thread-0'}} 2024-03-18 12:36:26.133389 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-18 12:36:26.139164 WARNING get_charge_settings: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/threading.py", line 1045, in worker funcref( File "/config/apps/growatt_app.py", line 37, in get_charge_settings if (response['obj']['mixBean']['exportLimit']) == "1":


TypeError: 'NoneType' object is not subscriptable

2024-03-18 12:36:26.139955 WARNING get_charge_settings: ------------------------------------------------------------`
tkupka commented 6 months ago

What inverter type you have?

RienduPre commented 6 months ago

I have a MOD 9000TL-3-S

RienduPre commented 6 months ago

I also have a MIC 2500TL-X

RienduPre commented 6 months ago

Any news on this, do you need more info.

tkupka commented 6 months ago

From the log the login passes but then the request to get details fails. I have a fear that it's working only with hybrid inverters. I'm using it with SPH. Can you use Bruno (https://www.usebruno.com/downloads) to send req and publish response? I give you a collection in the attachement

tkupka commented 6 months ago

Please import it to Bruno and change credentials in the Body of the Growatt Login request. Then I need a response from Growatt get Details request

RienduPre commented 6 months ago

I think I managed it, but this is new for me:

{ "deviceType": 0, "msg": "503", "result": 0, "dtc": 0, "haveMeter": 0, "obj": null, "normalPower": 0, "model": "" }

Both inverter got the same results.

tkupka commented 6 months ago

Thi is the problem. All the data are in

...
"obj": {
    "mixBean": {
      "mix_ac_discharge_frequency": "0",
      "communicationVersion": "ZDAA-0009",
      "singleExport": "0",
      "dischargeTime3": null,
      "bagingTestStep": "0",
      "chargePowerCommand": "90",
      "uwLVRT2EE": "0.0",
      "ccCurrent": "25.0",
      "dischargeTime2": null,
      "dischargeTime1": null,
      "record": null,
      "deviceType": "1",
      "vbatStartforCharge": "1.45",
      "uwHFRTTime2EE": "0",
      "uwReconnectStartSlope": "0.0",
      "outPower": "5.0",
      "powerMaxText": "",
....
tkupka commented 6 months ago

Can you paste what settings are you able to change from web app ?

tkupka commented 6 months ago

That's explains why. Because all the info about timeslots is in the failing request (Battery/Grid first). What do you want to control on your inverter?

RienduPre commented 6 months ago

I have a dynamic energy contract. Sometimes the prices are <50 euro cent per KWh. This means that every solar KWh I return to the grid costs me money.

Is it possible to switch the inverter off or pause during the time this situation is happening? Or lower the power ration?

Thanks for your help

tkupka commented 6 months ago

Can you click on the action you need and send me the payload from the network tab (tcpSet.do)

RienduPre commented 6 months ago

I will delete the screenshots after you seen them

tkupka commented 6 months ago

You can delete them

tkupka commented 6 months ago

You can try it out. UI has been added. In your case probably will not be preloaded. you need to change app.yaml uncomment:

#settings_action: 'maxSet'

image

RienduPre commented 6 months ago

Sorry for the late response, had a busy time.

My apps.yaml looks like this: get_charge_settings: module: growatt_app class: AD_Growatt growatt_username: !secret growatt_username growatt_password: !secret growatt_password growatt_device: !secret growatt_device

optional for non hybrid inverters (maxSet)

settings_action: 'maxSet'

Is that correct?

I got this in the log: `s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to INFO s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-appdaemon: starting s6-rc: info: service init-appdaemon successfully started s6-rc: info: service appdaemon: starting s6-rc: info: service appdaemon successfully started s6-rc: info: service legacy-services: starting [20:18:35] INFO: Starting AppDaemon... s6-rc: info: service legacy-services successfully started 2024-03-21 20:18:39.207243 INFO AppDaemon: AppDaemon Version 4.4.2 starting 2024-03-21 20:18:39.207517 INFO AppDaemon: Python version is 3.11.6 2024-03-21 20:18:39.207723 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml 2024-03-21 20:18:39.207935 INFO AppDaemon: Added log: AppDaemon 2024-03-21 20:18:39.208175 INFO AppDaemon: Added log: Error 2024-03-21 20:18:39.208372 INFO AppDaemon: Added log: Access 2024-03-21 20:18:39.208565 INFO AppDaemon: Added log: Diag 2024-03-21 20:18:39.452557 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2024-03-21 20:18:39.698864 INFO HASS: HASS Plugin Initializing 2024-03-21 20:18:39.699097 WARNING HASS: ha_url not found in HASS configuration - module not initialized 2024-03-21 20:18:39.699274 INFO HASS: HASS Plugin initialization complete 2024-03-21 20:18:39.699709 INFO AppDaemon: Initializing HTTP 2024-03-21 20:18:39.700042 INFO AppDaemon: Using 'socketio' for event stream 2024-03-21 20:18:39.707204 INFO AppDaemon: Starting API 2024-03-21 20:18:39.709865 INFO AppDaemon: Starting Admin Interface 2024-03-21 20:18:39.710302 INFO AppDaemon: Starting Dashboards 2024-03-21 20:18:39.730460 INFO HASS: Connected to Home Assistant 2024.3.1 2024-03-21 20:18:39.744459 INFO AppDaemon: App 'get_charge_settings' added 2024-03-21 20:18:39.746069 INFO AppDaemon: Found 1 active apps 2024-03-21 20:18:39.746403 INFO AppDaemon: Found 0 inactive apps 2024-03-21 20:18:39.746594 INFO AppDaemon: Found 0 global libraries 2024-03-21 20:18:39.746824 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2024-03-21 20:18:39.747659 INFO AppDaemon: Running on port 5050 2024-03-21 20:18:39.828285 INFO HASS: Evaluating startup conditions 2024-03-21 20:18:39.843637 INFO HASS: Startup condition met: hass state=RUNNING 2024-03-21 20:18:39.843970 INFO HASS: All startup conditions met 2024-03-21 20:18:39.926616 INFO AppDaemon: Got initial state from namespace default 2024-03-21 20:18:41.752950 INFO AppDaemon: Scheduler running in realtime 2024-03-21 20:18:41.755645 INFO AppDaemon: Adding /config/apps to module import path 2024-03-21 20:18:41.759065 INFO AppDaemon: Loading App Module: /config/apps/growatt_app.py 2024-03-21 20:18:41.846377 WARNING AppDaemon: No app description found for: /config/apps/growattServer.py - ignoring 2024-03-21 20:18:41.847331 WARNING AppDaemon: No app description found for: /config/apps/stateLogger.py - ignoring 2024-03-21 20:18:41.847924 INFO AppDaemon: Loading app get_charge_settings using class AD_Growatt from module growatt_app 2024-03-21 20:18:41.849415 INFO AppDaemon: Calling initialize() for get_charge_settings 2024-03-21 20:18:41.906512 INFO get_charge_settings: Checking session.... 2024-03-21 20:18:41.925776 INFO get_charge_settings: Session refresh time: 2024-03-21 19:58:41.850424 2024-03-21 20:18:41.927187 INFO get_charge_settings: Logging... 2024-03-21 20:18:42.143442 INFO get_charge_settings: Headers: {'User-Agent': 'Dalvik/2.0.0 (Linux; U; Android 13; HA:DNG0A4702R202403212018)'} 2024-03-21 20:18:42.145007 INFO get_charge_settings: Login user: 2024-03-21 20:18:42.146502 INFO get_charge_settings: Login Password: 599hjgjgjgjh4f726b2b16c6d045c1ded63b 2024-03-21 20:18:42.148079 INFO get_charge_settings: Login Response from Growatt: <Response [200]> 2024-03-21 20:18:42.149902 INFO get_charge_settings: Login Response Code from Growatt: 200 2024-03-21 20:18:42.151584 INFO get_charge_settings: Login Response content from Growatt: b'{"result":1}' 2024-03-21 20:18:42.153136 INFO get_charge_settings: Login Response code passed 2024-03-21 20:18:42.154912 INFO get_charge_settings: Login Response data: 1 2024-03-21 20:18:42.201772 INFO get_charge_settings: Login status: 1 2024-03-21 20:18:42.203170 INFO get_charge_settings: Login success.... 2024-03-21 20:18:42.220422 INFO get_charge_settings: Login time: 2024-03-21 20:18:42.216931 2024-03-21 20:18:42.256953 WARNING get_charge_settings: get_charge_settings: Entity input_button.adgw_set_active_power_rate not found in namespace default 2024-03-21 20:18:42.260167 INFO AppDaemon: App initialization complete 2024-03-21 20:18:42.277992 INFO get_charge_settings: Checking session.... 2024-03-21 20:18:42.297280 INFO get_charge_settings: Session refresh time: 2024-03-21 20:48:42.216931 2024-03-21 20:18:42.354252 INFO get_charge_settings: Response from growat: {'deviceType': 0, 'msg': '503', 'result': 0, 'dtc': 0, 'haveMeter': 0, 'obj': None, 'normalPower': 0, 'model': ''} 2024-03-21 20:18:42.355869 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-21 20:18:42.356713 WARNING get_charge_settings: Unexpected error in worker for App get_charge_settings: 2024-03-21 20:18:42.357476 WARNING get_charge_settings: Worker Ags: {'id': '881a3f5c03fd4d788ef0e48772331f8c', 'name': 'get_charge_settings', 'objectid': 'df80b04ef8ea4581a0d927e94c9d2be7', 'type': 'state', 'function': <bound method AD_Growatt.get_charge_settings of <growatt_app.AD_Growatt object at 0xffffad7b8510>>, 'attribute': 'state', 'entity': 'input_button.adgw_get_charge_settings_button', 'new_state': '2024-03-21T19:18:42.268875+00:00', 'old_state': '2024-03-21T19:18:18.933250+00:00', 'pin_app': True, 'pin_thread': 0, 'kwargs': {'__thread_id': 'thread-0'}} 2024-03-21 20:18:42.358184 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-21 20:18:42.360551 WARNING get_charge_settings: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/threading.py", line 1045, in worker funcref( File "/config/apps/growatt_app.py", line 41, in get_charge_settings if (response['obj']['mixBean']['exportLimit']) == "1":


TypeError: 'NoneType' object is not subscriptable

2024-03-21 20:18:42.361499 WARNING get_charge_settings: ------------------------------------------------------------`
tkupka commented 6 months ago

I made a small fix. Hope the init phase will be with no exception. But even if there is an exception the change state should work

RienduPre commented 6 months ago

This update makes things worse, See log. So I went back to the previous version

`s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting


Add-on: AppDaemon Python Apps and Dashboard using AppDaemon 4.x for Home Assistant

Add-on version: 0.16.4 You are running the latest version of this add-on. System: Home Assistant OS 12.1 (aarch64 / odroid-n2) Home Assistant Core: 2024.3.3 Home Assistant Supervisor: 2024.03.1

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to INFO s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-appdaemon: starting s6-rc: info: service init-appdaemon successfully started s6-rc: info: service appdaemon: starting s6-rc: info: service appdaemon successfully started s6-rc: info: service legacy-services: starting [10:53:12] INFO: Starting AppDaemon... s6-rc: info: service legacy-services successfully started 2024-03-23 10:53:15.990808 INFO AppDaemon: AppDaemon Version 4.4.2 starting 2024-03-23 10:53:15.991065 INFO AppDaemon: Python version is 3.11.6 2024-03-23 10:53:15.991229 INFO AppDaemon: Configuration read from: /config/appdaemon.yaml 2024-03-23 10:53:15.991394 INFO AppDaemon: Added log: AppDaemon 2024-03-23 10:53:15.991580 INFO AppDaemon: Added log: Error 2024-03-23 10:53:15.991729 INFO AppDaemon: Added log: Access 2024-03-23 10:53:15.991901 INFO AppDaemon: Added log: Diag 2024-03-23 10:53:16.233100 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2024-03-23 10:53:16.493249 INFO HASS: HASS Plugin Initializing 2024-03-23 10:53:16.493527 WARNING HASS: ha_url not found in HASS configuration - module not initialized 2024-03-23 10:53:16.493719 INFO HASS: HASS Plugin initialization complete 2024-03-23 10:53:16.494271 INFO AppDaemon: Initializing HTTP 2024-03-23 10:53:16.494744 INFO AppDaemon: Using 'socketio' for event stream 2024-03-23 10:53:16.502594 INFO AppDaemon: Starting API 2024-03-23 10:53:16.505698 INFO AppDaemon: Starting Admin Interface 2024-03-23 10:53:16.506283 INFO AppDaemon: Starting Dashboards 2024-03-23 10:53:16.524807 INFO HASS: Connected to Home Assistant 2024.3.3 2024-03-23 10:53:16.540254 INFO AppDaemon: App 'get_charge_settings' added 2024-03-23 10:53:16.541833 INFO AppDaemon: Found 1 active apps 2024-03-23 10:53:16.542161 INFO AppDaemon: Found 0 inactive apps 2024-03-23 10:53:16.542358 INFO AppDaemon: Found 0 global libraries 2024-03-23 10:53:16.542603 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2024-03-23 10:53:16.543543 INFO AppDaemon: Running on port 5050 2024-03-23 10:53:16.614680 INFO HASS: Evaluating startup conditions 2024-03-23 10:53:16.626949 INFO HASS: Startup condition met: hass state=RUNNING 2024-03-23 10:53:16.627286 INFO HASS: All startup conditions met 2024-03-23 10:53:16.704606 INFO AppDaemon: Got initial state from namespace default 2024-03-23 10:53:18.548283 INFO AppDaemon: Scheduler running in realtime 2024-03-23 10:53:18.550186 INFO AppDaemon: Adding /config/apps to module import path 2024-03-23 10:53:18.552195 INFO AppDaemon: Loading App Module: /config/apps/growatt_app.py 2024-03-23 10:53:18.616877 WARNING AppDaemon: No app description found for: /config/apps/growattServer.py - ignoring 2024-03-23 10:53:18.617699 WARNING AppDaemon: No app description found for: /config/apps/stateLogger.py - ignoring 2024-03-23 10:53:18.618276 INFO AppDaemon: Loading app get_charge_settings using class AD_Growatt from module growatt_app 2024-03-23 10:53:18.619819 INFO AppDaemon: Calling initialize() for get_charge_settings 2024-03-23 10:53:18.620812 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-23 10:53:18.621051 WARNING get_charge_settings: Unexpected error running initialize() for get_charge_settings 2024-03-23 10:53:18.621241 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-23 10:53:18.624055 WARNING get_charge_settings: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/app_management.py", line 162, in initialize_app await utils.run_in_executor(self, init) File "/usr/lib/python3.11/site-packages/appdaemon/utils.py", line 304, in run_in_executor response = future.result() ^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/apps/growatt_app.py", line 18, in initialize self.api = growattServer.GrowattApi(un, pwd, device_sn, self, self.ui_logger, settings_action) #get an instance of the api, using a random string as the ID ^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'growattServer' has no attribute 'GrowattApi'

2024-03-23 10:53:18.624382 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-23 10:53:18.625130 INFO AppDaemon: App initialization complete`

RienduPre commented 6 months ago

With the previous version when I click on the "Save active power rate" the folling error is in the log and the setting is not changed in the inverter.

`2024-03-23 11:16:39.526451 INFO get_charge_settings: Checking session.... 2024-03-23 11:16:39.551736 INFO get_charge_settings: Session refresh time: 2024-03-23 11:44:07.903436 2024-03-23 11:16:39.585148 INFO get_charge_settings: Action: [newTcpsetAPI.do], Setting param: {'op': 'mixSetApiNew', 'action': 'maxSet', 'serialNum': 'DNG0A4702R', 'type': 'pv_active_p_rate', 'param1': 0, 'deviceType': '17'} 2024-03-23 11:16:39.741129 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-23 11:16:39.741528 WARNING get_charge_settings: Unexpected error in worker for App get_charge_settings: 2024-03-23 11:16:39.741789 WARNING get_charge_settings: Worker Ags: {'id': '7f20df0d2a984b2fa20ea872ee232e6d', 'name': 'get_charge_settings', 'objectid': 'eeeb38b6e1ae48f9becf3d6c793b020b', 'type': 'state', 'function': <bound method AD_Growatt.set_active_power_rate_handler of <growatt_app.AD_Growatt object at 0xffffae4e4c90>>, 'attribute': 'state', 'entity': 'input_button.adgw_set_active_power_rate', 'new_state': '2024-03-23T10:16:39.518982+00:00', 'old_state': '2024-03-23T10:14:43.548576+00:00', 'pin_app': True, 'pin_thread': 0, 'kwargs': {'__thread_id': 'thread-0'}} 2024-03-23 11:16:39.741994 WARNING get_charge_settings: ------------------------------------------------------------ 2024-03-23 11:16:39.743498 WARNING get_charge_settings: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/appdaemon/threading.py", line 1045, in worker funcref( File "/config/apps/growatt_app.py", line 171, in set_active_power_rate_handler if self.set_active_power_rate() == True: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/apps/growatt_app.py", line 165, in set_active_power_rate response = self.api.update_mix_inverter_setting('pv_active_p_rate', rate_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/apps/growattServer.py", line 740, in update_mix_inverter_setting data = json.loads(response.content.decode('utf-8')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 7 column 1 (char 13)

2024-03-23 11:16:39.743739 WARNING get_charge_settings: ------------------------------------------------------------`

See also a screenshot of the gui and pay attention on the "API status" the status does not change and stays"Session active, processing action [11:16]" only the time changes when click again Scherm­afbeelding 2024-03-23 om 11 18 49

tkupka commented 6 months ago

I have put more logging.Can you try again ? Growatt Test.json Also can you paste response from request Growatt Set Active Power Rate

RienduPre commented 6 months ago

Responses are the same as before

request Growatt Set Active Power Rate is:

`<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Error500


Note: Dear user, you have not login to the system, skip login page login.. 
Login Page
`
tkupka commented 6 months ago

Have you login before with Growatt Login ? You nedd to add you credentials to the body

RienduPre commented 6 months ago

Yes I did

Scherm­afbeelding 2024-03-23 om 17 41 21 Scherm­afbeelding 2024-03-23 om 17 41 03 Scherm­afbeelding 2024-03-23 om 17 40 36

tkupka commented 6 months ago

With SPH it's working fine. Can you try with Growatt Set Active Power Rate Old request ? Maybe with your type new API is not supported. Growatt Test.json

tkupka commented 6 months ago

image

RienduPre commented 6 months ago

I get this:

{ "msg": "inv_set_lost", "success": false }

tkupka commented 6 months ago

do you have the correct serialNumber ? I had the same problem with wrong SN

RienduPre commented 6 months ago

No my serial number is correct

tkupka commented 6 months ago

ok change action to maxSet this is for your inverter type . You might try with and without deviceType

RienduPre commented 6 months ago

With maxSet I get this:

{ "msg": "inv_set_failure", "success": false }

Devicetype change doesn't have any effect.

tkupka commented 6 months ago

Can you try again from the browser (screenshots are gone) and use the same parameters in bruno ? image

RienduPre commented 6 months ago

Think I found it. I added param2 = 1 and now it works Scherm­afbeelding 2024-03-24 om 10 37 02 Scherm­afbeelding 2024-03-24 om 10 35 13

tkupka commented 6 months ago

Try it out should work now. Also, keep in mind that UI card was simplified in terms of code(functionality remains).

RienduPre commented 6 months ago

Hi,

It works now, and no errors in appdeamon log. Thank you very much for you patients with me in solving this.

What do you mean with the simplified UI card?

tkupka commented 6 months ago

Glad that's working. Some parts of the UI card has bugs so I fix them and made it slightly nicer in terms of headers. Also headers definition is much easier now (uses different card - Mushroom)

RienduPre commented 6 months ago

Ok clear

RienduPre commented 6 months ago

Problem solved. Thanks