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

Error line 246 #57

Open
SebM31 opened this issue Apr 7, 2024 · 1 comment
Open

Error line 246 #57

SebM31 opened this issue Apr 7, 2024 · 1 comment

Comments

@SebM31
Copy link

SebM31 commented Apr 7, 2024

HI, I a newbie in HA so could you excuse me if my question is silly.
I installed and configure your blueprint to optimise my PV panels on my water heater consommation but it doesn't work.
in the log file I found this repeated all the time.
Could you help me to correct my problem ?

2024-04-07 17:25:07.870 ERROR (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Exception in <file.pv_excess_control.on_time> line 246: first_item = next(iter(PvExcessControl.instances.values())) ^ RuntimeError: coroutine raised StopIteration

Thanks

@Maik7
Copy link
Contributor

Maik7 commented May 8, 2024

Hi,
I had the same issue. These messages appear as long as you do not have added any automation. Or all automations you have added are killed.

To fix this bug you need to add

            if not PvExcessControl.instances:  
                return on_time  

before line 246 in pv_excess_control.py
first_item = next(iter(PvExcessControl.instances.values()))

But this means, that the error message does not point to the root cause, why your automation is not running. But maybe after the fix you will see the relevant error message.

Maik7 added a commit to Maik7/ha-advanced-blueprints that referenced this issue May 8, 2024
Fixing Issue InventoCasa#57 
Avoiding error messages if no automation is send
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