Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing Pandas prevents HASS plugin loading due to np.float error #362

Open
stolevegen opened this issue Jan 1, 2025 · 0 comments
Open

Comments

@stolevegen
Copy link

stolevegen commented Jan 1, 2025

Problem/Motivation

Sensors created in AppDaemon was not created in HomeAssistant. plugin.HASS not visible under Plugins tab in AppDaemon.

Expected behavior

Expected to see plugin.HASS listed in AppDaemon Plugins, and expected sensors created in AppDaemon using set_state() to be created in HomeAssistant as well.

Actual behavior

Sensors was visible in AppDaemon, listed under Entities. App was working and sensors updating. Sensors was never created in Home Assistant. Searching through logs I found the following error:

2025-01-01 02:50:36.351836 WARNING AppDaemon: error loading plugin: HASS - ignoring 2025-01-01 02:50:36.351961 WARNING AppDaemon: ------------------------------------------------------------ 2025-01-01 02:50:36.354146 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 400, in __getattr__ raise AttributeError( AttributeError: np.float_was removed in the NumPy 2.0 release. Usenp.float64 instead. 2025-01-01 02:50:36.354238 WARNING AppDaemon: ------------------------------------------------------------

In the code relevant to loading of HASS plugin, np.float_ is used, which was deprecated in NumPy 2.0. The correct would be np.float64. If you add Pandas package to AppDaemon, Pandas will in turn load NumPy version 2.0+.
This raises an error as np.float_ is not valid, and the loading of HASS plugin is broken.

Steps to reproduce

Add Pandas to Python Packages under AppDaemon add-on Configuration tab.

Proposed changes

Workaround: Add "numpy==1.26.4" or other version below 2.0, to Python Packages in AppDaemon add-on Configuration tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant