Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with HomeAssistant 2021-05 #17

Closed
roumano opened this issue May 5, 2021 · 19 comments
Closed

Not working with HomeAssistant 2021-05 #17

roumano opened this issue May 5, 2021 · 19 comments

Comments

@roumano
Copy link

roumano commented May 5, 2021

Version of the custom_component

After updating the home assistant ( to HomeAssistant 2021-05 )
the ha-pool_pump (i'm using the dev branch) is not working anymore

Configuration

pool_pump:
  switch_entity_id: switch.pool_pump_switch
  pool_pump_mode_entity_id: input_select.pool_pump_mode
  pool_temperature_entity_id: input_number.pool_water_temperature
#  # optional:
#  water_level_critical_entity_id: binary_sensor.pool_water_level_critical
  schedule_break_in_hours: 3.0

Describe the bug

AttributeError: 'Location' object has no attribute 'solar_noon'

Debug log


mai 05 22:15:00 rasp hass[12629]: 2021-05-05 22:15:00 ERROR (MainThread) [homeassistant.components.automation.check_pool_pump_periodically] While executing automation automation.check_pool_pump_periodically
mai 05 22:15:00 rasp hass[12629]: Traceback (most recent call last):
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/automation/__init__.py", line 504, in async_trigger
mai 05 22:15:00 rasp hass[12629]:     await self.action_script.async_run(
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/script.py", line 1209, in async_run
mai 05 22:15:00 rasp hass[12629]:     await asyncio.shield(run.async_run())
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/script.py", line 345, in async_run
mai 05 22:15:00 rasp hass[12629]:     await self._async_step(log_exceptions=False)
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/script.py", line 363, in _async_step
mai 05 22:15:00 rasp hass[12629]:     await getattr(self, handler)()
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/script.py", line 563, in _async_call_service_step
mai 05 22:15:00 rasp hass[12629]:     await service_task
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/core.py", line 1481, in async_call
mai 05 22:15:00 rasp hass[12629]:     task.result()
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/core.py", line 1516, in _execute_service
mai 05 22:15:00 rasp hass[12629]:     await handler.job.target(service_call)
mai 05 22:15:00 rasp hass[12629]:   File "/data/homeassistant/.homeassistant/custom_components/pool_pump/__init__.py", line 99, in check
mai 05 22:15:00 rasp hass[12629]:     manager = PoolPumpManager(hass, now)
mai 05 22:15:00 rasp hass[12629]:   File "/data/homeassistant/.homeassistant/custom_components/pool_pump/__init__.py", line 150, in __init__
mai 05 22:15:00 rasp hass[12629]:     get_astral_event_date(self._hass, "solar_noon", self._now.date())
mai 05 22:15:00 rasp hass[12629]:   File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/sun.py", line 119, in get_astral_event_date
mai 05 22:15:00 rasp hass[12629]:     return getattr(location, event)(date, **kwargs)  # type: ignore
mai 05 22:15:00 rasp hass[12629]: AttributeError: 'Location' object has no attribute 'solar_noon'
@remycrochon
Copy link

Bonjour
Je suis dans la même configuration et je rencontre le même problème
Slts

@roumano
Copy link
Author

roumano commented May 7, 2021

next_noon of sun.sun variable seem to be a good candidact to replace the solar_non, isn't it ?

@foXaCe
Copy link

foXaCe commented May 7, 2021

@roumano did you manage to make it work?

@roumano
Copy link
Author

roumano commented May 7, 2021 via email

@remycrochon
Copy link

La cause vient de la mise à niveau de Astral vers 2.2 dans HA 2021.5. home-assistant/core#48573
C'est dans l'appel de la fonction "get_astral_event_date" ligne 150 de init .py qu'il y a un problème de mais je ne sais pas le résoudre, je ne suis pas développeur.

@roumano
Copy link
Author

roumano commented May 7, 2021

Merci @remycrochon d'avoir trouver le souci !

Donc, si je comprend bien (trouver via https://github.com/home-assistant/core/pull/48573/files ) :
l'ancienne version : 

self.next_noon = self._check_event(utc_point_in_time, "solar_noon", None)

nouvelle version :

self.next_noon = self._check_event(utc_point_in_time, "noon", None)

il suffit donc de remplacer la ligne 150 du fichier init.py de

get_astral_event_date(self._hass, "solar_noon", self._now.date())

par

get_astral_event_date(self._hass, "noon", self._now.date())
  • Je vient de tester et ça ne génère plus d'erreur !
    je fait un PR dans la foulé
    mais après le merge :
    si HA >=2021-05 , besoin de la nouvelle version de pool_pump
    si HA < 2021-05 , besoin de l'ancienne version de pool_pump
    pas terrible pour les users mais bon si ils ont des soucis ils penseront sûrement a mettre a jour pool_pump ou a venir par ici ...

@remycrochon
Copy link

Merci @roumano pour ton analyse.
J'ai fait la modification de mon coté mais j'ai toujours des erreurs!

2021-05-07 23:53:36 ERROR (MainThread) [homeassistant.components.automation.check_pool_pump_on_event] Piscine Check Pool Pump On event: Error executing script. Unexpected error for call_service at pos 1: 'Location' object has no attribute 'solar_noon'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 563, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
await handler.job.target(service_call)
File "/config/custom_components/pool_pump/init.py", line 99, in check
manager = PoolPumpManager(hass, now)
File "/config/custom_components/pool_pump/init.py", line 150, in init
get_astral_event_date(self._hass, "noon", self._now.date())
File "/usr/src/homeassistant/homeassistant/helpers/sun.py", line 119, in get_astral_event_date
return getattr(location, event)(date, **kwargs) # type: ignore
AttributeError: 'Location' object has no attribute 'solar_noon'

2021-05-07 23:53:36 ERROR (MainThread) [homeassistant.components.automation.check_pool_pump_on_event] While executing automation automation.check_pool_pump_on_event
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 504, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1209, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 345, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 563, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
await handler.job.target(service_call)
File "/config/custom_components/pool_pump/init.py", line 99, in check
manager = PoolPumpManager(hass, now)
File "/config/custom_components/pool_pump/init.py", line 150, in init
get_astral_event_date(self._hass, "noon", self._now.date())
File "/usr/src/homeassistant/homeassistant/helpers/sun.py", line 119, in get_astral_event_date
return getattr(location, event)(date, **kwargs) # type: ignore
AttributeError: 'Location' object has no attribute 'solar_noon'

@roumano
Copy link
Author

roumano commented May 7, 2021 via email

@remycrochon
Copy link

@roumano , Merci, après avoir supprimé le cache python et redémarré HA, cela a fonctionné, Pool_pump est de nouveau opérationnel.
J'ai appris quelque chose avec la suppression du cache c'est top.
Bonne journée

@xav-aaa
Copy link

xav-aaa commented May 27, 2021

Bonjour, je débute sur HA et après avoir installé ha-pool_pump (la version corrigée) je bute sur le problème suivant:

Error while executing automation automation.check_pool_pump_on_event: Unable to find service pool_pump.check

Je ne vois pas pourquoi HA ne trouve pas le service pool_pump.check . Des suggestions? Merci.

@roumano
Copy link
Author

roumano commented May 27, 2021

@xav-aaa , Tu peut regarder là pour t'aider : https://domo.rem81.com/home-assistant-gestion-piscine-filtration/
Sinon regarde les variables et ... dans "Outils de développement" de HA.
Mais ton souci n'a rien a voir avec cette issue donc stp évite de pollué les issue si c'est pas lié.

@g4seb
Copy link

g4seb commented Jun 4, 2021

Bonjour,
J'ai atterri ici car j'ai aussi l'erreur solar_noon.
J'ai fait la modification mais mon fichier init.py s'appelle init.py.
Est ce normal ?
Au redémarrage toujours les erreurs, mais je vois pas le cache python ??

@roumano
Copy link
Author

roumano commented Jun 4, 2021

@g4seb, init.py == init.py , non ?

@g4seb
Copy link

g4seb commented Jun 4, 2021

@g4seb, init.py == init.py , non ?

Oups pardon init.py . Je me suis trompé.

Avant la modification j'avais ça comme erreur :
Logger: homeassistant.components.automation.piscine_check_pool_pump
Source: helpers/sun.py:119
Integration: Automatisation (documentation, issues)
First occurred: 11:40:00 (138 occurrences)
Last logged: 17:25:00

Piscine Check pool Pump: Error executing script. Unexpected error for call_service at pos 1: 'Location' object has no attribute 'solar_noon'
While executing automation automation.piscine_check_pool_pump
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 366, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 566, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
await handler.job.target(service_call)
File "/config/custom_components/pool_pump/init.py", line 99, in check
manager = PoolPumpManager(hass, now)
File "/config/custom_components/pool_pump/init.py", line 150, in init
get_astral_event_date(self._hass, "solar_noon", self._now.date())
File "/usr/src/homeassistant/homeassistant/helpers/sun.py", line 119, in get_astral_event_date
return getattr(location, event)(date, **kwargs) # type: ignore
AttributeError: 'Location' object has no attribute 'solar_noon'

Après la modification, plus d'erreur sur Boon, mais encore une là :
Logger: homeassistant.components.automation.piscine_check_pool_pump
Source: custom_components/pool_pump/init.py:168
Integration: Automatisation (documentation, issues)
First occurred: 18:00:00 (70 occurrences)
Last logged: 20:50:00

Piscine Check pool Pump: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'state'
While executing automation automation.piscine_check_pool_pump
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 366, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 566, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
await handler.job.target(service_call)
File "/config/custom_components/pool_pump/init.py", line 99, in check
manager = PoolPumpManager(hass, now)
File "/config/custom_components/pool_pump/init.py", line 154, in init
self._total_duration_in_hours = self._build_parameters()
File "/config/custom_components/pool_pump/init.py", line 168, in _build_parameters
self._hass.states.get(
AttributeError: 'NoneType' object has no attribute 'state'

Je comprends pas....

@g4seb
Copy link

g4seb commented Jun 8, 2021

Bonjour,
bon j'ai réglé mes problèmes ça fonctionne !!

Par contre re belotte, je vien s de passer en 2021.6.3 et de nouveau des erreurs. Il me trouve pas le service pool_pump.check.

Avez vous aussi cette erreur ??

Logger: homeassistant.components.automation.piscine_check_pool_pump
Source: helpers/script.py:1341
Integration: Automatisation (documentation, issues)
First occurred: 15:25:00 (1 occurrences)
Last logged: 15:25:00

Piscine Check pool Pump: Error executing script. Service not found for call_service at pos 1: Unable to find service pool_pump.check

@roumano
Copy link
Author

roumano commented Jun 8, 2021 via email

@g4seb
Copy link

g4seb commented Jun 8, 2021

Moi non mais je sais d'où vient le souci.... Le service est désactivé car il y a pas la version dans le fichier manifest , cf l'autre bug que j'ai ouvert et j'ai aussi proposer un correctif (sans réponse)... Le mar. 8 juin 2021 à 15:41, g4seb @.***> a écrit :

Bonjour, bon j'ai réglé mes problèmes ça fonctionne !! Par contre re belotte, je vien s de passer en 2021.6.3 et de nouveau des erreurs. Il me trouve pas le service pool_pump.check. Avez vous aussi cette erreur ?? Logger: homeassistant.components.automation.piscine_check_pool_pump Source: helpers/script.py:1341 Integration: Automatisation (documentation, issues) First occurred: 15:25:00 (1 occurrences) Last logged: 15:25:00 Piscine Check pool Pump: Error executing script. Service not found for call_service at pos 1: Unable to find service pool_pump.check — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#17 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQ3GTUT2QYIPBWBRZX7AVTTRYMYZANCNFSM44FWBP3A .

Je viens de répondre sur ton autre post

@nicx
Copy link

nicx commented Jun 18, 2021

please please can you write in English here in GitHub? I have the same problem but cannot read anything here :(

@roumano
Copy link
Author

roumano commented Jun 18, 2021

please please can you write in English here in GitHub? I have the same problem but cannot read anything here :(

Hi, Please see the related merge request for the fix ! , it's only one line fix

I don't known why it's not yet merged but i'm not the owner or this repository so i can't handle this ...

oncleben31 added a commit that referenced this issue Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants