InventoCasa / ha-advanced-blueprints

Advanced Blueprints combined with pyscript for extra useful automations
139 stars 33 forks source link

Error message after initialy start #53

Closed kfussmann closed 3 months ago

kfussmann commented 3 months ago

After configuring and then initialy starting the buikd automation I get the folling error massage in Home Assistant:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.pyscript.file.pv_excess_control.on_time Quelle: custom_components/pyscript/trigger.py:1268 Integration: Pyscript Python scripting (Dokumentation, Probleme) Erstmals aufgetreten: 11:19:12 (2358 Vorkommnisse) Zuletzt protokolliert: 14:35:32

Exception in line 246: first_item = next(iter(PvExcessControl.instances.values())) ^ RuntimeError: coroutine raised StopIteration

Hope you can identify the problem.

InventoCasa commented 3 months ago

@stefan73 seems to also originate from setting a wrong Automation ID which is not equal to the automation entity ID.

kfussmann commented 3 months ago

Thanks @stefan73 for the really quick reply on this. Unfortunatelly I am having more errors regarding your Blueprint. After the initialy start the above error accures and is followed by this error message:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.pyscript.file.pv_excess_control.on_time Quelle: custom_components/pyscript/eval.py:1941 Integration: Pyscript Python scripting (Dokumentation, Probleme) Erstmals aufgetreten: 14:53:40 (2 Vorkommnisse) Zuletzt protokolliert: 14:53:40

Could not get state from entity automation.pool_pump_pv_excess_controled: name 'automation.pool_pump_pv_excess_controled' is not defined Could not get state from entity automation.pool_heatpump_pv_excess_controled: name 'automation.pool_heatpump_pv_excess_controled' is not defined

Just to show what my configuration for the mentioned pool pump is:

id: '1710164107198'
alias: Pool Pumpe - PV Excess Optimizer
description: ''
use_blueprint:
  path: PV_Excess_Control/pv_excess_control.yaml
  input:
    automation_id: pool_pump_pv_excess_controled
    appliance_priority: 10
    pv_power: sensor.solar_produktion_gesamt
    export_power: sensor.stp10_0_3av_40_947_metering_power_supplied
    load_power: sensor.erzeugung_verbrauch_diff
    home_battery_level: sensor.sbs3_7_10_661_battery_soc_total
    min_home_battery_level: 60
    home_battery_capacity: 10.2
    solar_production_forecast: sensor.gesamt_pv_ertrag_resttag
    appliance_switch: switch.fritz_dect_200_poolpumpe
    appliance_switch_interval: 15
    min_current: 0.1
    max_current: 8.7
    defined_current: 0.8
    actual_power: sensor.fritz_dect_200_poolpumpe_leistung

A similar configuration is done for the pool heatpump which also not works.

InventoCasa commented 3 months ago

@kfussmann the Input field automation_id must be the same ID you gave to the automation (=entity ID of the automation)

kfussmann commented 3 months ago

@kfussmann the Input field automation_id must be the same ID you gave to the automation (=entity ID of the automation)

@InventoCasa Thanks for clearing my misunderstanding of the field. After setting it to the right value the automations works as it should. Keep the good work going.