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

Automation stops #36

Open
rinowit opened this issue Nov 13, 2023 · 3 comments
Open

Automation stops #36

rinowit opened this issue Nov 13, 2023 · 3 comments

Comments

@rinowit
Copy link

rinowit commented Nov 13, 2023

Bilde 12 11 2023, 16 14 44
Hello
I have two different HA running on two different places. They are running the lates HA version 11.1 and PA 1.4. I have a problem that the Price analyzer instance is stopping after a few days and don't update the 5 lowest and 10 lowest prices. For me a reboot on both the HA devices helps a while. The automation has worked flawlessly on earlier HA and PA versions.

I have also noticed that there is a error that is related to the Price Analyzer in the log file. Do you think this has something to do with it? I have tried to delete the database. But even with a small and fresh database the problem continues.

I am running my Price Analyzer based on the 5 and 10 lowest prices. I am using this template in configuration.yaml to base my automation on true or false from this attribute:

  - platform: template
    sensors:
      five_cheapest:
        friendly_name: Price is 5 cheapest
        value_template: "{{ state_attr('sensor.Priceanalyzer_Oslo', 'current_hour') ['is_five_cheapest'] }}"

Thanks for a really great plugin. (You can write in Norwegian if you want)

@rinowit
Copy link
Author

rinowit commented Nov 14, 2023

Here is a screenshot from the same moment on two different HA instances. As you can se the time has topped on the right on and it thinks its yesterday. Why isn't it updating
difference

@erlendsellie
Copy link
Owner

Hei!
Er det noe annet i loggen på den HA'en hvor det ser ut til å stoppe opp?

Jeg ser at en av mine test-installasjoner har dennne feilmeldingen i loggen, det kan tenkes at det er grunnen.

2023-11-14 09:00:00.080 ERROR (MainThread) [homeassistant.util.logging] Exception in new_hr when dispatching 'priceanalyzer_new_hour': ()
Traceback (most recent call last):
  File "/config/custom_components/priceanalyzer/data.py", line 964, in new_hr
    await self.check_stuff()
  File "/config/custom_components/priceanalyzer/data.py", line 1025, in check_stuff
    self._update(self._data_today)
  File "/config/custom_components/priceanalyzer/data.py", line 639, in _update
    self._add_raw_calculated(False)
  File "/config/custom_components/priceanalyzer/data.py", line 739, in _add_raw_calculated
    difference = ((self._min / self._max) - 1)
ZeroDivisionError: division by zero

Det burde fungerer å trykke på 'Reload integration'. Om jeg ikke får fikset dette på kort tid, kan du også teste med en automasjon som reloader integrasjonen automatisk en gang om dagen, selv om det er en 'dårlig fiks', og man burde finne grunnproblemet.
Sjekk gjerne om du finner feilmeldingen over, eller noen annen i loggen også før du eventuelt tester denne automasjonen.

Feilmeldingen du sendte skjermbilde av er noe annet, og i grunnen ikke noe å bry seg om. Den begynte å komme etter HA ikke lengre godttok å lagre ned sensorer med veldig mange attributter. Og Priceanalyzer har veeeldig mange attributter, siden den tar var på data om hver eneste time for i dag og i morgen.

automation:
  - id: reloadPriceanalyzer
    alias: reloadPriceanalyzer
    trigger:
       - platform: time
         at: "14:00:00"
    action:
      - service: homeassistant.reload_config_entry
        entity_id: sensor.priceanalyzer

@rinowit
Copy link
Author

rinowit commented Nov 14, 2023

Tusen takk, jeg så faktisk i ettertid at den første feilen ikke var relevant. Jeg har satt på logging. Jeg skal se hva jeg får ut av den. Du hører fra meg. Tusen takk

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

2 participants