I am trying to use the yweather platform introduced with version 0.24.0 on a Raspberry Pi.
My configuration.yaml has the following entries:
sensor:
platform: yweather
woeid: rock-spring-12770998
forecast: 3
monitored_conditions:
- weather
- temp_min
- temp_max
The error in the log file is:
16-07-18 23:23:27 homeassistant.components.sensor: Error while setting up platform yweather
Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py”, line 98, in _setup_platform
discovery_info)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/yweather.py”, line 77, in setup_platform
if forecast >= len(yahoo_api.yahoo.Forecast):
TypeError: object of type ‘NoneType’ has no len()
The yaml has been validated. The OS on the Pi has been updated. I’ve tried several different config settings but no luck.
Any ideas?
Edit: Not sure why the display of my post strips the leading spaces in the yaml file example, but it is an exact copy of the Yahoo Weather example on the Home Assistant components sensor.yweather page, leading spaces and all.
I tried HA using your weather configuration and think I’ve found the issue.
The following error appears in the log at startup:
Invalid config for [sensor.yweather]: expected int for dictionary value @ data[‘forecast’]
The ‘forecast’ syntax looks correct to me, but still throws the error. I commented out that line and the error goes away.
If this is a bug, this is going to take a developer to fix. I looked on GitHub and could not find this as an issue. Not sure how to report one but will research.
The code expect an int for the forecast parameter.
I think the documentation is a bit unclear, and “0 until 5” actually means an int between 0 and 5.
It would be great if one of you could help improve it. At the documentation site you can just press “Edit this page on GitHub” in the upper right corner to propose a change.