fboundy / pv_opt

Home Assistant PV Optimisation for Solis Inverters
MIT License
20 stars 4 forks source link

AppDaemon HASS plugin incompatible with `numpy 2.0.0` #243

Open swests opened 3 weeks ago

swests commented 3 weeks ago

Describe the bug Trying to start the integration after upgrades and get the following, stopping the app from running: ERROR: id_consumption_today : Neither the entities listed in the YAML sensor.solmod_house_load_today nor the system default of sensor.solmod_house_load_today exist in HA.

Expected behavior App to start

Versions HA: 2024.06.3 PV_OPT: v3.15.1 Solcast: 4.0.31 (new version) Solis SolAX Modbus integration

Error in AppDaemon Log: WARNING pv_opt: 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 "/usr/lib/python3.11/site-packages/appdaemon/adbase.py", line 35, in f_app_lock return f(args, **kw) ^^^^^^^^^^^^^^ File "/homeassistant/appdaemon/apps/pv_opt/pv_opt.py", line 521, in initialize self._load_args() File "/homeassistant/appdaemon/apps/pv_opt/pv_opt.py", line 1205, in _load_args raise ValueError(e) ValueError: id_consumption_today : Neither the entities listed in the YAML sensor.solmod_house_load_today nor the system default of sensor.solmod_house_load_today exist in HA.

I've checked again in HA: image

dolce08 commented 3 weeks ago

Same issue, started today. Tried rolling back to HA 2024.6.2 but still getting the same error.

swests commented 3 weeks ago

Rolled back to 2024.05.5 but still the same. App won’t start.

Bart39 commented 3 weeks ago

Same here also for solax house load today

swests commented 3 weeks ago

Also see this when I restart AppDaemon WARNING: pv_opt: Entity sensor.pvopt_status not found in namespace default

fboundy commented 3 weeks ago

Could someone please upload error.log and Pvopt.log?

Are you all using the HA Core ModBus integration? Does that appear to be working? For example are you getting the inverter dc power (solar) in HA or are all the entities offline? On 18 Jun 2024 at 07:21 +0100, SimonW @.***>, wrote:

Also see this when I restart AppDaemon WARNING: pv_opt: Entity sensor.pvopt_status not found in namespace default — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Bart39 commented 3 weeks ago

---- email fail ----

Will figure out how to upload properly from GitHub app

Bart39 commented 3 weeks ago

pv_opt (1).log error (1).log

Using ha solax modbus - yes it appears to be working

swests commented 3 weeks ago

Using the Solax solis modus integration and its reporting all entities. Will upload logs shortly

swests commented 3 weeks ago

I stopped AppDaemon, cleared the logs and restarted AppDaemon. Logs below.

error.log main.log pv_opt.log

swests commented 3 weeks ago

New set of logs. I uninstalled PV_OPT, restarted and then installed the latest, with the default config. Made minor edits to config.yaml to pick up my entities (device_name: solmod). Still get the same issue. Attached config, and logs

error.log pv_opt.log main.log config.yaml.txt

fboundy commented 3 weeks ago

Thanks

Will do the update later and see if I can diagnose what’s going on On 18 Jun 2024 at 09:21 +0100, SimonW @.***>, wrote:

New set of logs. I uninstalled PV_OPT, restarted and then installed the latest, with the default config. Made minor edits to config.yaml to pick up my entities (device_name: solmod). Still get the same issue. Attached config, and logs error.log pv_opt.log main.log config.yaml.txt — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

swests commented 3 weeks ago

Detailed version info: HA: 2024.5.5 AppDaemon: 0.16.6 PV_OPT: 3.15.1 OE: 11.0.2 SolaX Inverter Modbus: 2024.05.7 Solcast: 4.0.31 (new repo by BJReplay) MQTT: 6.4.1

fboundy commented 3 weeks ago

Thanks for the logs. The issue appears to be with the HASS plugin for AppDaemon as shown in the AppDaemon log here:

09:13:01 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
09:13:01 WARNING AppDaemon: error loading plugin: HASS - ignoring
09:13:01 WARNING AppDaemon: ------------------------------------------------------------
09:13:01 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/plugin_management.py", line 140, in __init__
    mod = __import__(full_module_name, globals(), locals(), [module_name], 0)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 14, in <module>
    from deepdiff import DeepDiff
  File "/usr/lib/python3.11/site-packages/deepdiff/__init__.py", line 10, in <module>
    from .diff import DeepDiff
  File "/usr/lib/python3.11/site-packages/deepdiff/diff.py", line 18, in <module>
    from deepdiff.helper import (strings, bytes_type, numbers, uuids, times, ListItemRemovedOrAdded, notpresent,
  File "/usr/lib/python3.11/site-packages/deepdiff/helper.py", line 63, in <module>
    np_float_ = np.float_
                ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.

09:13:01 WARNING AppDaemon: ------------------------------------------------------------

I may need to raise an issue on the AppDaemon or AppDaemon add-on repos as this isn't a PV_OPT issue.

fboundy commented 3 weeks ago

This is an incompatibility between the version of deepdiff installed with HA and the 2.0.0 release of numpy.

As a fix please add numpy==1.26.4 to the AppDaemon config page. In due couse I expect versions will be bumped to fix this.

image

dolce08 commented 3 weeks ago

The fix worked. As always thanks for your work and the great integration.

fboundy commented 3 weeks ago

This is the root cause issue with deepdiff: https://github.com/seperman/deepdiff/issues/464

fboundy commented 3 weeks ago

Also raised as an issue on the AppDaemon addon: https://github.com/hassio-addons/addon-appdaemon/issues/345

swests commented 3 weeks ago

Perfect! Thank-you for jumping right in. Working again...

Did you want to keep it open to track the downstream issue?

stjohncanning commented 3 weeks ago

Had same issue, now fixed. Thanks for quick response for a great program

fboundy commented 3 weeks ago

Yes - leave it open for now On 18 Jun 2024 at 16:33 +0100, SimonW @.***>, wrote:

Perfect! Thank-you for jumping right in. Working again... Did you want to keep it open to track the downstream issue? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>