drobtravels / solaredge-local

Information about local API for SolarEdge Inverters
58 stars 12 forks source link

Create Home Assistant component #2

Closed drobtravels closed 5 years ago

drobtravels commented 5 years ago

Will use #1

Create Component

AndyRPH commented 5 years ago

Did you ever get this working in HA enough to release a component for it?

drobtravels commented 5 years ago

I havn't had time to publish all the data all I wanted to, or add tests, but I went ahead and PRed what I have so you can start using it. Hopefully I or someone else will have time to enhance in the near future

AndyRPH commented 5 years ago

Erroring here:

2019-05-20 07:15:42 ERROR (SyncWorker_0) [custom_components.solaredge_local.sensor] Missing details data in solaredge response 2019-05-20 07:15:48 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds. 2019-05-20 07:15:48 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform solaredge_local is taking over 10 seconds.

2019-05-20 07:15:52 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform solaredge_local Traceback (most recent call last): File "/config/custom_components/solaredge_local/sensor.py", line 62, in setup_platform status.energy AttributeError: 'Response' object has no attribute 'energy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/config/custom_components/solaredge_local/sensor.py", line 66, in setup_platform _LOGGER.error("Response is", status) File "/usr/local/lib/python3.7/logging/init.py", line 1412, in error self._log(ERROR, msg, args, kwargs) File "/usr/local/lib/python3.7/logging/init.py", line 1519, in _log self.handle(record) File "/usr/local/lib/python3.7/logging/init.py", line 1529, in handle self.callHandlers(record) File "/usr/local/lib/python3.7/logging/init.py", line 1591, in callHandlers hdlr.handle(record) File "/usr/local/lib/python3.7/logging/init.py", line 905, in handle self.emit(record) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/init.py", line 167, in emit _figure_out_source(record, stack, self.hass)) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/init.py", line 92, in init self.message = record.getMessage() File "/usr/local/lib/python3.7/logging/init.py", line 380, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting

My config yaml is

sensor: platform: solaredge_local ip_address: 10.13.37.11 monitored_conditions:

It was giving a different error before commenting out the three energies.

The curl command line still provides data, so the inverter is talking.

I put your three files from the HA PR into my custom_components/solaredge_local/ folder.

drobtravels commented 5 years ago

If you manually set it up as a custom component, you need to add the python package.

Try:

pip install solaredge-local

This will be included automatically as part of the official home assistant build as part of the manifest file

On Mon, May 20, 2019, 7:37 AM AndyRPH notifications@github.com wrote:

Erroring here:

2019-05-20 07:15:42 ERROR (SyncWorker_0) [custom_components.solaredge_local.sensor] Missing details data in solaredge response 2019-05-20 07:15:48 WARNING (MainThread) [homeassistant.setup] Setup of group is taking over 10 seconds. 2019-05-20 07:15:48 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform solaredge_local is taking over 10 seconds.

2019-05-20 07:15:52 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform solaredge_local Traceback (most recent call last): File "/config/custom_components/solaredge_local/sensor.py", line 62, in setup_platform status.energy AttributeError: 'Response' object has no attribute 'energy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/config/custom_components/solaredge_local/sensor.py", line 66, in setup_platform _LOGGER.error("Response is", status) File "/usr/local/lib/python3.7/logging/init.py", line 1412, in error self._log(ERROR, msg, args, kwargs) File "/usr/local/lib/python3.7/logging/init.py", line 1519, in _log self.handle(record) File "/usr/local/lib/python3.7/logging/init.py", line 1529, in handle self.callHandlers(record) File "/usr/local/lib/python3.7/logging/init.py", line 1591, in callHandlers hdlr.handle(record) File "/usr/local/lib/python3.7/logging/init.py", line 905, in handle self.emit(record) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/ init.py", line 167, in emit _figure_out_source(record, stack, self.hass)) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/ init.py", line 92, in init self.message = record.getMessage() File "/usr/local/lib/python3.7/logging/init.py", line 380, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting

My config yaml is

sensor: platform: solaredge_local ip_address: 10.13.37.11 monitored_conditions:

  • lifetime_energy

  • energy_this_year - energy_this_month - energy_today

  • current_power

It was giving a different error before commenting out the three energies.

The curl command line still provides data, so the inverter is talking.

I put your three files from the HA PR into my custom_components/solaredge_local/ folder.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/drobtravels/solaredge-local/issues/2?email_source=notifications&email_token=ABF3ATT7JYOSULBKI7WXTZTPWKEPDA5CNFSM4G44GVL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVYRH5Y#issuecomment-493949943, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF3ATTCH3Y32XCMB3FO6GTPWKEPDANCNFSM4G44GVLQ .

AndyRPH commented 5 years ago

Installed it as you suggested, still erroring out.

Pip list from the command line does show that version 0.1.5 is installed.

Where inside HA would the message .proto files end up? Or do I need to install those manually too?

Mon May 20 2019 20:45:11 GMT-0400 (EDT)

Error while setting up platform solaredge_local Traceback (most recent call last): File "/config/custom_components/solaredge_local/sensor.py", line 62, in setup_platform status.energy AttributeError: 'Response' object has no attribute 'energy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/config/custom_components/solaredge_local/sensor.py", line 66, in setup_platform _LOGGER.error("Response is", status) File "/usr/local/lib/python3.7/logging/init.py", line 1412, in error self._log(ERROR, msg, args, kwargs) File "/usr/local/lib/python3.7/logging/init.py", line 1519, in _log self.handle(record) File "/usr/local/lib/python3.7/logging/init.py", line 1529, in handle self.callHandlers(record) File "/usr/local/lib/python3.7/logging/init.py", line 1591, in callHandlers hdlr.handle(record) File "/usr/local/lib/python3.7/logging/init.py", line 905, in handle self.emit(record) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/init.py", line 167, in emit _figure_out_source(record, stack, self.hass)) File "/usr/local/lib/python3.7/site-packages/homeassistant/components/system_log/init.py", line 92, in init self.message = record.getMessage() File "/usr/local/lib/python3.7/logging/init.py", line 380, in getMessage msg = msg % self.args TypeError: not all arguments converted during string formatting

drobtravels commented 5 years ago

https://www.home-assistant.io/components/solaredge_local/