Weather Platform - IPMA


(José Militão) #161

Viva pessoal!

Há algum tempo que deixei de ter weather do IPMA.

Penso que foi a partir da actualização do HA para o 0.82.

O erro que dá é o que está em baixo.

Mais alguém tem esteve problema? Como o resolveram?

Obrigado.

2019-01-29 08:24:14 ERROR (MainThread) [homeassistant.components.weather] Error while setting up platform ipma
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/weather/ipma.py", line 72, in async_setup_platform
    float(longitude))
  File "/usr/local/lib/python3.6/site-packages/pyipma/station.py", line 42, in get
    stations = await self.api.stations()
  File "/usr/local/lib/python3.6/site-packages/pyipma/api.py", line 59, in stations
    for station in data['data']:
TypeError: 'NoneType' object is not subscriptable
2019-01-29 08:24:14 ERROR (MainThread) [homeassistant.components.weather] Error while setting up platform ipma
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/weather/ipma.py", line 72, in async_setup_platform
    float(longitude))
  File "/usr/local/lib/python3.6/site-packages/pyipma/station.py", line 42, in get
    stations = await self.api.stations()
  File "/usr/local/lib/python3.6/site-packages/pyipma/api.py", line 59, in stations
    for station in data['data']:
TypeError: 'NoneType' object is not subscriptable
2019-01-29 08:24:14 ERROR (MainThread) [homeassistant.components.weather] Error while setting up platform ipma
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/weather/ipma.py", line 72, in async_setup_platform
    float(longitude))
  File "/usr/local/lib/python3.6/site-packages/pyipma/station.py", line 42, in get
    stations = await self.api.stations()
  File "/usr/local/lib/python3.6/site-packages/pyipma/api.py", line 59, in stations
    for station in data['data']:
TypeError: 'NoneType' object is not subscriptable
2019-01-29 08:24:14 ERROR (MainThread) [homeassistant.components.weather] Error while setting up platform ipma
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/weather/ipma.py", line 72, in async_setup_platform
    float(longitude))
  File "/usr/local/lib/python3.6/site-packages/pyipma/station.py", line 42, in get
    stations = await self.api.stations()
  File "/usr/local/lib/python3.6/site-packages/pyipma/api.py", line 59, in stations
    for station in data['data']:
TypeError: 'NoneType' object is not subscriptable

(Diogo Gomes) #162

Espero que não estejas a usar este componente como custom!

Apaga o IPMA da tua pasta custom_component. Certifica-te que tens a ultima versao 0.86.3.


(José Militão) #163

Apesar de não perceber muito disto penso que não estou a usar custom.
Agora a versão é que não consigo ver pois em termos de Hass.io -> sytem a information é:

Hass.io supervisor
Version 142
Latest version 142

Antes da actualização lembro-me de ver um sitio onde dizia que a versão era a 0.72 mas agora já não encontro isso.

O configuration.yaml é:

weather:
  - platform: ipma
    name: Sobreda
    latitude: 38.64637
    longitude: -9.17539

  - platform: ipma
    name: Aljezur
    latitude: 37.31661
    longitude: -8.80372

  - platform: ipma
    name: Faro
    latitude: 37.01936
    longitude: -7.93044

  - platform: ipma
    name: Porto
    latitude: 41.14976
    longitude: -8.59901

A config do lovelace é a seguinte

title: Home
# Include external resources
resources:
  - url: /local/my-webfont.css
    type: css
  - url: /local/gauge-card.js?v=1
    type: js
  - url: /local/vertical-stack-in-card.js?v=0.0.2
    type: js

views:
#------------------------------------------------------------
  - icon: mdi:weather-cloudy
    id: Weather
    title: Weather
    cards:
      - type: vertical-stack
        cards:
         - type: markdown
           title: Meteo
           content: ' '
         - type: weather-forecast
           entity: weather.sobreda
         - type: weather-forecast
           entity: weather.aljezur
         - type: weather-forecast
           entity: weather.faro

(Diogo Gomes) #164

verifica q na pasta do configuration.yaml nao existe nenhuma pasta custom_components/weather


(José Militão) #165

Realmente existia uma pasta custom_components/weather que já apaguei mas o erro continua.

Como posso forçar o update do HA?


(Jorge Assunção) #166

E depois de apagar reinicias-te o HA?


(José Militão) #167

Sim, claro!

Estas coisas só são lidas no arranque!


(Jorge Assunção) #168

E depois do reboot continua tudo igual?