Help with Yahoo Weather Configuration on Pi

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.

Hi,

Your problem coming from the definition of Woeid

sensor:
platform: yweather
woeid: 12770998
forecast: 3
monitored_conditions:
- weather
- temp_min
- temp_max

woeid need only digits :wink:

1 Like

Thank you so much hokagegano! Everything working fine now!

I too have problems with Yahoo. I’ve checked my woeid but noting shows up on the dashboard. Anyone care to try my code?

sensor:
  platform: yweather
  woeid: 28644755
  forecast: 0 until 5
  monitored_conditions:
   - weather
   - weather_current
   - temp_min
   - temp_max
   - wind_speed
   - pressure
   - visibility
   - humidity
   - temperature

What kind of errors are you seeing in the log?

None at all that I can see. Will post full yaml and log tomorrow.

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.

1 Like

Danielhiveren, thank you for the clarification, I’ve proposed a change on the GitHub documentation page.

1 Like

I do not think you made a pull request for your modification.
How to help improve the documentation is explained here:

I just put in a PR to explain this better in the docs.

1 Like