# Weather Platform - IPMA

**URL:** <https://forum.cpha.pt/t/weather-platform-ipma/497>\
**Category:** Partilha de Projectos\
**Created:** [29 Maio , 2018 22:40 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497 "2018-05-29T22:40:39Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![fonteshugo](https://forum.cpha.pt/user_avatar/forum.cpha.pt/fonteshugo/32/14286_2.png) [@fonteshugo](https://forum.cpha.pt/u/fonteshugo)\
**Post date:** [3 Junho , 2018 20:12 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/61 "2018-06-03T20:12:27Z")

</div>

aparece-me isto:  
018-06-03 19:32:52 ERROR (MainThread) [homeassistant.loader] Error loading custom\_components.weather.ipma. Make sure all dependencies are installed  
Traceback (most recent call last):  
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py”, line 142, in get\_component  
module = importlib.import\_module(path)  
File “/usr/local/lib/python3.6/importlib/ **init**.py”, line 126, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
File “”, line 978, in \_gcd\_import  
File “”, line 961, in \_find\_and\_load  
File “”, line 950, in \_find\_and\_load\_unlocked  
File “”, line 655, in \_load\_unlocked  
File “”, line 678, in exec\_module  
File “”, line 205, in \_call\_with\_frames\_removed  
File “/home/homeassistant/.homeassistant/custom\_components/weather/ipma.py”, line 13, in   
from homeassistant.components.weather import (  
ImportError: cannot import name ‘ATTR\_FORECAST\_CONDITION’  
2018-06-03 19:32:52 ERROR (MainThread) [homeassistant.loader] Unable to find component weather.ipma  
2018-06-03 19:32:54 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): CLOSE  
2018-06-03 20:40:14 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.pws\_temp\_low\_1d\_c is taking over 10 seconds  
2018-06-03 20:40:14 ERROR (MainThread) [homeassistant.components.sensor.wunderground] Error fetching WUnderground data: TimeoutError()  
2018-06-03 20:49:02 ERROR (SyncWorker\_12) [homeassistant.loader] Error loading custom\_components.weather.ipma. Make sure all dependencies are installed  
Traceback (most recent call last):  
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py”, line 142, in get\_component  
module = importlib.import\_module(path)  
File “/usr/local/lib/python3.6/importlib/ **init**.py”, line 126, in import\_module  
return \_bootstrap.\_gcd\_import(name[level:], package, level)  
File “”, line 978, in \_gcd\_import  
File “”, line 961, in \_find\_and\_load  
File “”, line 950, in \_find\_and\_load\_unlocked  
File “”, line 655, in \_load\_unlocked  
File “”, line 678, in exec\_module  
File “”, line 205, in \_call\_with\_frames\_removed  
File “/home/homeassistant/.homeassistant/custom\_components/weather/ipma.py”, line 13, in   
from homeassistant.components.weather import (  
ImportError: cannot import name ‘ATTR\_FORECAST\_CONDITION’  
2018-06-03 20:49:02 ERROR (SyncWorker\_12) [homeassistant.loader] Unable to find component weather.ipma

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [3 Junho , 2018 20:13 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/62 "2018-06-03T20:13:10Z")

</div>

Pois, mas infelizmente através da API por eles fornecida ([http://api.ipma.pt](http://api.ipma.pt)) nem metade… ☹

Um aproximação por scrapping podia aumentar esta lista, mas o scrapping sofre do eterno problema de qualquer update ao site quebrar toda a biblioteca de suporte.

Outro aspecto é a previsão… nem todas estas estações teem previsão…

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [3 Junho , 2018 20:15 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/63 "2018-06-03T20:15:04Z")

</div>

Eu acho que não fez o download de forma correcta do ipma.py (use o raw e faça “save as…”)

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [3 Junho , 2018 21:22 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/64 "2018-06-03T21:22:48Z")

</div>

Obrigado a todos!

O componente acabou de ser aceite para inclusão na próxima release 0.72 (por minutos não foi a tempo da 0.71)

---

<div class="post-metadata">

**Author:** ![Encarnacao](https://forum.cpha.pt/user_avatar/forum.cpha.pt/encarnacao/32/2031_2.png) [@Encarnacao](https://forum.cpha.pt/u/Encarnacao)\
**Post date:** [3 Junho , 2018 21:28 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/65 "2018-06-03T21:28:53Z")

</div>

impecavel!!! @dgomes alguma chance de vir a poder fazer um componente hidrografico das mares ?

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [3 Junho , 2018 21:47 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/66 "2018-06-03T21:47:55Z")

</div>

Explica com detalhe, posso estudar o caso…

---

<div class="post-metadata">

**Author:** ![Encarnacao](https://forum.cpha.pt/user_avatar/forum.cpha.pt/encarnacao/32/2031_2.png) [@Encarnacao](https://forum.cpha.pt/u/Encarnacao)\
**Post date:** [3 Junho , 2018 22:03 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/67 "2018-06-03T22:03:00Z")

</div>

.[http://www.hidrografico.pt/previsao-mares.php](http://www.hidrografico.pt/previsao-mares.php)  
ter um componente que mostre a tabela das mares com baixa mar,preia-mar, altura das mares  
nao sei se seria relevante ter um componente para isso, mas certamente seria uma mais valia para aqueles que tem barcos, que vao á pesca, que gostem de ir apanhar marisco, ter este tipo de informaçao

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [3 Junho , 2018 22:06 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/68 "2018-06-03T22:06:41Z")

</div>

OK, pensava que era informação que tb vinha do IPMA e que fizesse sentido integrar no mesmo codigo.

Como me mostras será um componente completamente diferente.

Não digo que não, mas de momento tenho mais coisas na calha 😃

---

<div class="post-metadata">

**Author:** ![j\_assuncao](https://forum.cpha.pt/user_avatar/forum.cpha.pt/j_assuncao/32/3_2.png) [@j\_assuncao](https://forum.cpha.pt/u/j_assuncao)\
**Post date:** [3 Junho , 2018 22:08 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/69 "2018-06-03T22:08:21Z")

</div>

> [@dgomes](#):
>
> Não digo que não, mas de momento tenho mais coisas na calha 😃

E nós cá estaremos para ajudar nos testes!

---

<div class="post-metadata">

**Author:** ![fonteshugo](https://forum.cpha.pt/user_avatar/forum.cpha.pt/fonteshugo/32/14286_2.png) [@fonteshugo](https://forum.cpha.pt/u/fonteshugo)\
**Post date:** [5 Junho , 2018 18:40 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/70 "2018-06-05T18:40:43Z")

</div>

Parece-me que estou com algum problema no ubuntu. vou fazer uma instalação limpa e depois testo.

---

<div class="post-metadata">

**Author:** ![Sergio\_Lopes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/sergio_lopes/32/3675_2.png) [@Sergio\_Lopes](https://forum.cpha.pt/u/Sergio_Lopes)\
**Post date:** [23 Junho , 2018 09:16 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/71 "2018-06-23T09:16:57Z")

</div>

Depois de atualizar para o HA 0.72 o IPMA deixou de funcionar.  
Tenho este erro:

```
ipma: Error on device update!
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
await entity.async_device_update(warning=False)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 318, in async_device_update
yield from self.async_update()
  File "/usr/lib/python3.6/site-packages/homeassistant/components/weather/ipma.py", line 95, in async_update
self._condition = await self._station.observation()
  File "/config/deps/lib/python3.6/site-packages/pyipma/station.py", line 70, in observation
return closest.currentObs
AttributeError: 'NoneType' object has no attribute 'currentObs'

```

Alguém sabe o que pode ser?  
Obrigado.

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [23 Junho , 2018 09:27 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/72 "2018-06-23T09:27:49Z")

</div>

Com o 0.72 vem o suporte oficial

Por favor apaga a versão que esta na pasta custom\_components

---

<div class="post-metadata">

**Author:** ![Sergio\_Lopes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/sergio_lopes/32/3675_2.png) [@Sergio\_Lopes](https://forum.cpha.pt/u/Sergio_Lopes)\
**Post date:** [26 Junho , 2018 20:53 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/73 "2018-06-26T20:53:47Z")

</div>

@dgomes Já tinha apagado, mas continuava a não atualizar.  
Depois de duas ou três reinicializações está tudo a funcionar na perfeição.  
Obrigado.

---

<div class="post-metadata">

**Author:** ![jponte](https://forum.cpha.pt/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@jponte](https://forum.cpha.pt/u/jponte)\
**Post date:** [13 Julho , 2018 10:11 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/74 "2018-07-13T10:11:56Z")

</div>

Boas,  
eu estou a usar o hassio versão 0.72.  
Contudo depois de adicionar o codigo abaixo no ficheiro de configuração continuo sem ter o cartão referente à meteorologia.  
weather:

- platform: ipma

Por isso tentei colocar o ficheiro python no custom\_components:  
-rwxr-xr-x 1 root root 5332 Jul 13 11:01 custom\_components/weather/ipma.py

Mas continuo sem o cartão. Não vejo erros nos logs, já reniciei o hassio meia duzia de vezes. Está me a escapar alguma coisa?

Obrigado!

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [13 Julho , 2018 11:52 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/75 "2018-07-13T11:52:20Z")

</div>

Ve o ficheiro de log… preciso de mais informação.

E apaga o ficheiro do custom\_components.

---

<div class="post-metadata">

**Author:** ![jponte](https://forum.cpha.pt/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@jponte](https://forum.cpha.pt/u/jponte)\
**Post date:** [13 Julho , 2018 13:20 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/76 "2018-07-13T13:20:05Z")

</div>

> [@dgomes](#):
>
> Ve o ficheiro de log… preciso de mais informação.

O log abaixo está filtrado por ipma.

> <https://pastebin.com/QxLK5Ga4>

Pelo que vejo faltam uns ficheiros relativos a traduções … hummm

---

<div class="post-metadata">

**Author:** ![dgomes](https://forum.cpha.pt/user_avatar/forum.cpha.pt/dgomes/32/42_2.png) [@dgomes](https://forum.cpha.pt/u/dgomes)\
**Post date:** [13 Julho , 2018 14:01 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/77 "2018-07-13T14:01:20Z")

</div>

Estranho não vejo nenhum erro… (ignorar as traduções)

Podes aumentar o nivel de logging:

```auto
logging:
  homeassistant.components.weather.ipma: debug
```

---

<div class="post-metadata">

**Author:** ![jponte](https://forum.cpha.pt/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@jponte](https://forum.cpha.pt/u/jponte)\
**Post date:** [13 Julho , 2018 14:28 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/78 "2018-07-13T14:28:03Z")

</div>

Bem… esquece! 🙂  
é o que faz não actualizar o browser. Tinha o Chrome umas 10 versões atrás, fui testar noutro PC e vi logo o cartão. 😄  
Realmente com a versão 0.72 tinha de ser straightforward.

Realmente já tnha sentido falta de outros gráficos 🙂

Obrigado Diogo, e desculpa lá o tempo roubado!

---

<div class="post-metadata">

**Author:** ![ricreis394](https://forum.cpha.pt/user_avatar/forum.cpha.pt/ricreis394/32/7810_2.png) [@ricreis394](https://forum.cpha.pt/u/ricreis394)\
**Post date:** [9 Agosto , 2018 13:14 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/79 "2018-08-09T13:14:50Z")

</div>

Sou novato nisto do HA. Tentei colocar o ipma a funcionar mas está a dar-me este erro:

```
 SyntaxError: EOL while scanning string literal
 Fatal error while loading config: EOL while scanning string literal (ipma.py, line 65)
 Failed config
   General Errors:
     - EOL while scanning string literal (ipma.py, line 65)
 Successful config (partial)

```

Tenho as coordenadas colocadas assim:

```
 homeassistant:
   name: Casa
   latitude: 40.992925
   longitude: -8.722461
 
 weather:
   - platform: ipma
     name: IPMA
     latitude: 40.992925
     longitude: -8.722461

```

No home-assistant.log tem:

```
File "/config/custom_components/weather/ipma.py", line 65
    _LOGGER.error("Latitude or longitude not set in Home Assistant
```

---

<div class="post-metadata">

**Author:** ![Maddoctor](https://forum.cpha.pt/user_avatar/forum.cpha.pt/maddoctor/32/1508_2.png) [@Maddoctor](https://forum.cpha.pt/u/Maddoctor)\
**Post date:** [9 Agosto , 2018 15:11 UTC](https://forum.cpha.pt/t/weather-platform-ipma/497/80 "2018-08-09T15:11:45Z")

</div>

em princípio não é necessário colocar as coordenadas no weather quando são as mesmas …

[Página anterior](https://forum.cpha.pt/t/weather-platform-ipma/497.md?page=3)

[Próxima página](https://forum.cpha.pt/t/weather-platform-ipma/497.md?page=5)
