Does anyone have any ideas. It was working, but after a restart I get this.
Error while setting up platform flume
Traceback (most recent call last):
File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, 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/flume/sensor.py", line 44, in setup_platform
sensor_list = list(flume.get_usage().keys())
File "/config/custom_components/flume/flume_homeassistant.py", line 121, in get_usage
return {k: v[0]['value'] for k, v in values.items()}
File "/config/custom_components/flume/flume_homeassistant.py", line 121, in <dictcomp>
return {k: v[0]['value'] for k, v in values.items()}
IndexError: list index out of range
@michaeldavie, yes. I reboot HA regularly as I am working on some configs. The flume plugin will throw this error and not get results after 80-90% of the HA restarts. Eventually, if I restart enough, it will eventually work, but then error again on next reboot. Iām just using it stock. No changes. Deleting flume tokens doesnāt have any effect. It seems to be getting data in that list it doesnāt expect.
@ender7 I think Iāve fixed this. It had to do with the API limit, which I think Iāve accounted for correctly in the latest version. Please give the latest files a try and let me know if itās working correctly for you or not.
For those interested in a running water binary sensor, I think this should do the trick:
Thanks. Will do. In the process of porting my vmās and docker containers to a new server, but will give this a try and report back as soon as they are back up and running.
I also have problems with the latest release.
Here is portion of my log file.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 249, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_device_update
await self.hass.async_add_executor_job(self.update)
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/flume/sensor.py", line 91, in update
self.flume.update_usage()
File "/config/custom_components/flume/flume_homeassistant.py", line 16, in res
return fun(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/ratelimit/decorators.py", line 80, in wrapper
return func(*args, **kargs)
File "/config/custom_components/flume/flume_homeassistant.py", line 139, in update_usage
values = response.json()['data'][0]
IndexError: list index out of range
2019-08-18 10:26:02 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.last_24_hrs fails
This is great work. I am getting the Flume and looking forward to using it. I was wondering if anyone in this thread also has Smartthings? I noticed there was a way to connect Smartthings to Home Assistant, so I figured I would ask in here. So far, I am not aware of any integration between Flume and Smartthings, but it would be great to be able to see the data and create actions based on water flow (e.g., shutting off an automatic water valve after certain parameters are met).
I donāt have Home Assistant, at least not yet. There might also be things that can be learned in the integration here that might help users on other platforms, such as Smartthings and Hubitat. I do know some people have multiple platforms.
just installed flume and set this up on 0.99.3 and got the following error:
flume: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 441, in async_device_update
await self.hass.async_add_executor_job(self.update)
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/flume/sensor.py", line 92, in update
gallons = round(self.flume.usage.get(self.sensor_type), 2)
TypeError: type NoneType doesn't define __round__ method
Pretty sure at this point most everyone is getting this same error - I donāt think the custom component works at all anymore (at least it hasnāt for me). Iām hoping that at some point the custom component dev or someone else with sufficient expertise can create a reliable update for this!
Iām receiving the same errors too. Hopefully @michaeldavie will be able to fix it when he can. With Hacktoberfest in full swing, there is another effort to get Flume integrated into HA.