krocat / toonha Goto Github PK
View Code? Open in Web Editor NEWHome-Assistant component for Toon by Eneco
License: Apache License 2.0
Home-Assistant component for Toon by Eneco
License: Apache License 2.0
I am getting the following error since yesterday:
Running the latest Hass version (Docker image) and the latest toon custom component.
Log Details (ERROR)
Wed Apr 18 2018 06:58:58 GMT+0200 (W. Europe Daylight Time)
Error during setup of component toon
Traceback (most recent call last):
File "/usr/src/app/homeassistant/setup.py", line 145, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/toon.py", line 70, in setup
config['toon'][CONF_NAME])
File "/config/custom_components/toon.py", line 116, in __init__
self.update()
File "/usr/src/app/homeassistant/util/__init__.py", line 319, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/toon.py", line 123, in update
self.data['power_current'] = self.toon.power.value
File "/config/deps/lib/python3.6/site-packages/toonapilib/toonapilib.py", line 322, in power
power = self.status['powerUsage']
KeyError: 'powerUsage'
When i change the temperature of the thermostat in Home assistant. the temperature doesn't change on the thermostat. if i use the toon app the temperature does change.
Home Assistant 0.63.1
Behavior:
After the latest update my meter_readings sensors are not responding. Smartplugs are working, current consumption is also working so it seems like there is an issue between the library and the custom component. I'm reading through the code of both but haven't found the issue.
Image of HA frontend with problem:
Possible related errors in Home Assistant log:
KeyError: 'powerUsage'
2018-04-03 04:33:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.gas_today fails
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
yield from self.async_device_update()
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
yield from self.hass.async_add_job(self.update)
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/sensor/toon.py", line 129, in update
self.thermos.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']
System:
Rpi with Hassbian Image
Home assistant version: 66.1 (latest)
Possible Solution:
?
If i want to change the operation_mode
to Comfort i'm getting the following error:
WARNING (MainThread) [homeassistant.helpers.state] reproduce_state: Unable to reproduce state <state climate.toon_van_eneco=None; peration_mode=Comfort @ 2017-09-29T21:25:55.860364+02:00> (2)
I stumbled upon this error while i was configuring my amazon echo to communicate with Home Assistant and return the temperature or changing the operation mode. So i thought i was doing something wrong, but this also occurs when you click on the states buttons in the climate panel.
Any clue on how to fix this, and if someone else can reproduce this? Thanks in advance.
installed as described in hass.io 0.52.1 i get the following errors in log:
2017-09-06 09:23:31 ERROR (MainThread) [homeassistant.setup] Error during setup of component toon
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
future.result()
File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/toon.py", line 47, in setup
solar)
File "/config/custom_components/toon.py", line 82, in __init__
self.update()
File "/config/custom_components/toon.py", line 106, in update
float(plug.daily_usage) / 1000, 2),
TypeError: float() argument must be a string or a number, not 'NoneType'
2017-09-06 09:23:33 WARNING (MainThread) [homeassistant.setup] Setup of media_player is taking over 10 seconds.
2017-09-06 09:23:33 WARNING (MainThread) [homeassistant.setup] Setup of light is taking over 10 seconds.
2017-09-06 09:23:35 WARNING (MainThread) [homeassistant.setup] Setup of tts is taking over 10 seconds.
please advise
I am installing Home Assistant with Toon. This simply does not work (yet).
I installed the latest home assistant version on a raspberry pi running raspbian. Home assistant is working.
When setting up toon in the configuration.yaml, it only allowes client_id and client_secret as config values (which are the toon API key/secret). So you can't link a contract.
After some searching, I found this github. I understand that the included toon version in homeassistant is obsolete.
So I tried installing it. This does not work. The unstructions say to copy the files to config/custom_components, however, on a fresh installation THERE IS NO SUCH FOLDER
After looking, I found toon here:
/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/toon
So I placed the files there, overwriting the existing ones. Now I can set all the correct configuration.yaml items (like consumer_key, and so forth).
However, this produces this error on startup:
Unable to prepare setup for platform toon.sensor: Platform not found (No module named 'custom_components.toon').
So I removed the folder
/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/toon
all together, and created a custom_components/toon folder in my config folder, and put the files there.
This works, but now I get:
Unable to prepare setup for platform toon.climate: Platform not found (cannot import name 'STATE_AUTO' from 'homeassistant.components.climate.const'
This was a bug which is supposed to be fixed, but apparently is not.
I do now get some toon data into home assistant, but still errors.
I realy appreciate people making stuff for hassio, but please, make sure they work or there are correct installation instructions. This is getting rediculous.
using the new files.
b'{"fault":{"faultstring":"Invalid Authorization Code","detail":{"errorcode":"keymanagement.service.invalid_request-authorization_code_invalid"}}}'
NoneType: None
configuration.yaml entries:
toon:
username: 'username'
password: 'password'
consumer_key: consumerkey
consumer_secret: consumersecret
Wasn't sure where to ask this, but here we go: at what point will the changes in this repository be merged into the HA repository? Are there rules for that?
I've been running the code in this repository for a while now and it seems to work fine.
Means I won't have to run custom_components anymore
upgrade gives the following warning:
toonlib 1.0.2 has requirement cachetools==2.0.0, but you'll have cachetools 2.0.1 which is incompatible.
toonlib 1.0.2 has requirement requests==2.13.0, but you'll have requests 2.20.0 which is incompatible.
toonapilib 3.0.1 has requirement requests==2.18.4, but you'll have requests 2.20.0 which is incompatible.
HA log after starting:
2018-11-01 09:10:25 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.climate.toon. Make sure all dependencies are installed
running on hassbian.
I all,
I get the following error when i want to use toon in Home Assistent.
Can someone help me out with this?
Error during setup of component toon
Traceback (most recent call last):
File "/config/deps/lib/python3.6/site-packages/toonapilib/toonapilib.py", line 319, in _get_status_value
output = self.status[value]
KeyError: 'powerUsage'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/app/homeassistant/setup.py", line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/toon.py", line 70, in setup
config['toon'][CONF_NAME])
File "/config/custom_components/toon.py", line 116, in init
self.update()
File "/usr/src/app/homeassistant/util/init.py", line 324, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/toon.py", line 123, in update
self.data['power_current'] = self.toon.power.value
File "/config/deps/lib/python3.6/site-packages/toonapilib/toonapilib.py", line 339, in power
power = self._get_status_value('powerUsage')
File "/config/deps/lib/python3.6/site-packages/toonapilib/toonapilib.py", line 321, in _get_status_value
raise IncompleteStatus(self.status)
toonapilib.toonapilibexceptions.IncompleteStatus: {'code': 500, 'message': 'Internal Server Error', 'description': 'Error communicating with Toon'}
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.
I'd love to implement a binary_sensor for the burner status. The underlying toonlib already supports it through the toon.thermostat_info.burner_info
property, as i'm sure you know.
Just asking if that's a good addition, if it's something you don't find useful or out of scope i'll just bodge it together locally.
First of all, great work. all sensors are working as expected except the thermostat. I get the following error with home assistant 0.89:
Error loading custom_components.toon.climate. Make sure all dependencies are installed
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 166, in _load_file
module = importlib.import_module(path)
File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/config/custom_components/toon/climate.py", line 9, in
from homeassistant.components.climate import (ClimateDevice,
ImportError: cannot import name 'STATE_AUTO' from 'homeassistant.components.climate' (/usr/local/lib/python3.7/site-packages/homeassistant/components/climate/init.py)
Hey,
After I installed the update 0.88 of HA, the plug-in of ToonHA (api) did not work anymore.
I received a warning in 0.87.1 but just ran the plugin. Now it is stopped. You may know a solution.
the say in there release:
We have tightened config validation, so expect a couple of new warnings. Platform configuration will no longer allow to contain keys that are not supported. This should help with finding typos in your current and future YAML configs. This will currently fallback to a warning and will become a full error in the future.
Wen Home Assistant cant fetch data from the API home assistant gives an error and shows Invalid config.
Home Assistant can then only discover toon when a new reboot happened and the API is available.
I can fetch data from my toon to Home Assistant. So my configuration is probably alright but if there is a hiccup at boot everything fails.
as you can see that if toon fails to set up properly it conflict with the discovery of a lot of other components.
these are all errors that popup at boot
Could this be the toon API not being strong enough to make a connection with my Home Assistant or it this because my toon cant push al the data to the toon servers?
Or is there something wrong in the code?
Hi,
There seem to be an issue with Toon and the Toon-Hass component. Since updating to 0.57.x the component works for a little and then stops processing data. I cannot control Toon via the buttons within HASS, nor with automation, and the value readings are "stale".
The log is "flooded" with :
2017-11-16 07:36:53 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.gas_today is taking over 10 seconds
2017-11-16 07:37:55 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_current is taking over 10 seconds
2017-11-16 07:38:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_today is taking over 10 seconds
2017-11-16 07:39:59 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.gas_today is taking over 10 seconds
And periodic other errors like (to a much lesser degree though and could be other related to uplink not available or something):
2017-11-15 21:30:49 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.toon_van_eneco fails
Traceback (most recent call last):
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
yield from self.async_device_update()
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 309, in async_device_update
yield from self.hass.async_add_job(self.update)
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/lib/python3.5/site-packages/homeassistant/components/climate/toon.py", line 90, in update
self.thermos.update()
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/util/init.py", line 306, in wrapper
result = method(*args, **kwargs)
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/homeassistant/components/toon.py", line 85, in update
self.data['power_current'] = self.toon.power.value
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/toonlib/toonlib.py", line 281, in power
power = self._state['powerUsage']
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/cachetools/init.py", line 46, in wrapper
v = func(*args, **kwargs)
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/toonlib/toonlib.py", line 175, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/toonlib/toonlib.py", line 191, in _get_data
error_message = response.json().get('reason', '')
File "/home/homeassistant/homeassistant/lib/python3.5/site-packages/requests/models.py", line 892, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Hello,
with the default toon integration i was using google assistant to set temperature
With the custom toonHA when i give a command i always get:
that mode is not available.
how can i get it to work with google assistant (google home)
After installing the BETA of Hass, connecting with toon. I get this issue:
(i removed my personals)
Strange one: i connect to toon with @hotmail.com e-mailadress. And in this log file is my @gmail.com emailadres.. i don't get it..
Error setting up entry eneco-001-xxxx for toon
Traceback (most recent call last):
File "/config/deps/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 175, in _get_agreements
for agreement in agreements]
File "/config/deps/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 175, in
for agreement in agreements]
AttributeError: 'str' object has no attribute 'get'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homeassistant/config_entries.py", line 283, in async_setup
result = await component.async_setup_entry(hass, self)
File "/usr/local/lib/python3.7/site-packages/homeassistant/components/toon/init.py", line 56, in async_setup_entry
display_common_name=entry.data[CONF_DISPLAY]))
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/deps/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 106, in init
self._authenticate()
File "/config/deps/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 153, in _authenticate
self._get_agreements()
File "/config/deps/lib/python3.7/site-packages/toonapilib/toonapilib.py", line 178, in _get_agreements
raise AgreementsRetrievalError(response.text)
toonapilib.toonapilibexceptions.AgreementsRetrievalError: {"fault":{"faultstring":"Rate limit quota violation. Quota limit exceeded. Identifier : [email protected]","detail":{"errorcode":"policies.ratelimit.QuotaViolation"}}}
Hi,
I seems I cannot use this custom_module alongside with the synology camera module, it gives me the following error:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
return fut.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/camera/synology.py", line 55, in async_setup_platform
timeout=timeout
File "/srv/homeassistant/lib/python3.5/site-packages/synology/surveillance_station.py", line 12, in __init__
self._api = Api(url, username, password, timeout, verify_ssl)
File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 59, in __init__
self._initialize_api_info()
File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 70, in _initialize_api_info
payload)
File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 192, in _get_json_with_retry
return self._get_json(url, payload)
File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 198, in _get_json
response = self._get(url, payload)
File "/srv/homeassistant/lib/python3.5/site-packages/synology/api.py", line 185, in _get
verify=self._verify_ssl)
TypeError: _patched_request() takes 2 positional arguments but 3 were given
After investigating where error comes from I see it's inside the toonapilib
https://github.com/costastf/toonapilib/blob/master/toonapilib/toonapilib.py#L247
Is there a way to fix this?
While setting the temperature of Toon through Siri on my Apple Watch, the following error pops up in my hass logs:
2017-11-16 22:08:11 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/tasks.py", line 182, in _step result = coro.throw(exc) File "/opt/hass/lib/python3.6/site-packages/homeassistant/core.py", line 1038, in _event_to_service_call yield from service_handler.func(service_call) File "/opt/hass/lib/python3.6/site-packages/homeassistant/components/climate/__init__.py", line 399, in async_operation_set_service yield from climate.async_set_operation_mode(operation_mode) File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup future.result() File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result raise self._exception File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/home/hass/.homeassistant/custom_components/climate/toon.py", line 91, in set_operation_mode self.thermos.set_state(toonlib_values[operation_mode]) KeyError: 'auto'
(view full log snippet here)
If I comment out the offending line 91, the error obviously doesn't show
up, and Siri/HomeKit seems to react much faster to my command
I'm using the latest version of ToonHA (cloned from GitHub).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.