InventoCasa / ha-advanced-blueprints

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

Only-Run-Once-Appliance don't work #54

Closed ioniks closed 3 weeks ago

ioniks commented 3 months ago

Hi,

When i set Only-Run-Once-Appliance to on, when i set to off the entity, the automatisation set to On a few time after if they have solar.

How i can have only one on for a day ?

Thanks

faebsche91 commented 1 month ago

I have same issue. Is there a solution ?

ioniks commented 1 month ago

I have create a trigger when it's activated and deactivated it after, and re activated it the next morning.

faebsche91 commented 1 month ago

So you don’t use the „only-run-once-appliance“ anymore ?

ioniks commented 1 month ago

Yes i don't use it

Maik7 commented 1 month ago

@ioniks

Hi,

When i set Only-Run-Once-Appliance to on, when i set to off the entity, the automatisation set to On a few time after if they have solar.

you have to turn the automation off, and then switch off the entity:

service: automation.turn_off
target:
  entity_id: automation.nameofautomation
data:  {}

(you can already turn the automation off, as soon as the script had switched your entity on, e. g. by an automation which is triggered if your entity is switched on)

How i can have only one on for a day ?

you can create another automation to activate your automation once a day. In this example at 7 o clock:


mode: single
trigger:
  - platform: time_pattern
    hours: "07"
    minutes: "00"
    seconds: "00"
condition: []
action:
  - service: automation.turn_on
    target:
      entity_id: automation.nameofautomation
    data: {}

(not tested, but should work)

Thanks

welcome :-)

ioniks commented 1 month ago

Hi @Maik7,

Thanks, like I previously say I already do that as a patch.

faebsche91 commented 1 month ago

That's sounds more like a workaround not like a solution. The switch in the blueprint have no Funktion.

ioniks commented 1 month ago

It's not a solution, it's just a temporary fix behavior

Maik7 commented 1 month ago

Oh, I misinterpreted appliance_once_only (mixed it up with appliance_on_only). For testing purposes I have some simulated appliances. I can test this feature with that.

Maik7 commented 1 month ago

Yes, I can confirm that run_once does not work. It can be fixed by adding one "else" in switch_on, but I think it is better, to add a check in the on_time loop. Maybe I can create a pull request next week

faebsche91 commented 1 month ago

thanks i will wait for

Maik7 commented 1 month ago

I have created a pull request for this