krocat / ToonHA

Home-Assistant component for Toon by Eneco

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solar

kvandt opened this issue · comments

Hi,
I think there is a naming problem with
SolarSensor(hass, 'Solar_meter_reading_low_produced', 'kWh'),
SolarSensor(hass, 'Solar_meter_reading_produced', 'kWh'),
The numbers you get are not Solar, but the meter readings for Feed-In into the grid. Off course this is a result of Local production, but not the same as amount produced. I would suggest a name like 'Power_meter_reading_Feed_in' and 'Power_meter_reading_low_Feed_in'.

Both these meter readings are in Wh, so need to be divided by 1000 like the Power_meter_reading.

Hi @kvandt , I do not actually have solar so you might as well be right. Would you mind making an MR with the proposed changes in toonapilib and this component since you obviously have solar and we could use your help?

Hi @costastf, I tried to change the names, but for some reason I can't get the Toon plugin working anymore. Even if I reinstall toonapilib and toonha from scratch.
I get an error:
2018-04-05 20:16:45 ERROR (MainThread) [homeassistant.setup] Error during setup of component toon Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 145, in _async_setup_component component.setup, hass, processed_config) File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/toon.py", line 70, in setup config['toon'][CONF_NAME]) File "/home/homeassistant/.homeassistant/custom_components/toon.py", line 116, in __init__ self.update() File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 319, in wrapper result = method(*args, **kwargs) File "/home/homeassistant/.homeassistant/custom_components/toon.py", line 123, in update self.data['power_current'] = self.toon.power.value File "/srv/homeassistant/lib/python3.5/site-packages/toonapilib/toonapilib.py", line 322, in power power = self.status['powerUsage'] KeyError: 'powerUsage'

I can't find the reason why it fails. Any thoughts?

This seems to be a problem with toonapilib. The powerUsage field is not retrieved on the status of the response which means that the api did no respond with all the expected data. Could you try out the library by itself and open an issue it if it still does not work? I would guess that this is something transient with the api response.

Merge request created.

Merged