#Run in parallel question.
1 messages · Page 1 of 1 (latest)
you mean like wait for each parallel branch to complete before executing the final action?
Wait for only the second branch to complete.
It seems like you just need to put the last action in the first branch outside of the parallel: block
When will it execute?
after the parallel block is complete
I don't want that.
The left part of the parallel block takes an hour to complete.
The right part takes 20 minutes.
I want the action to execute after the right part has finished.
then just put it after the last action in the right part?
seems like you don't care what's happening on teh left side for this
It will execute like 1000 times then, since the right part is a "repeat until" block, and.. repeats.
it's just a sequence
?
it's really easier if you just share the code
To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
description: ""
triggers:
- trigger: time
at: "20:00:00"
conditions: []
actions:
- parallel:
- alias: Lower brightness until 10%
repeat:
until:
- condition: numeric_state
entity_id: light.wiz_rgbw_tunable_11bb5e
attribute: brightness
below: 27
above: 0
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: -1
target:
device_id:
- 8c3326364aa17256951fe2b018459761
- d442ec4aa9c1a9d959032abcea183c78
- delay:
hours: 0
minutes: 0
seconds: 40
milliseconds: 0
- alias: Lower temperature until 2200K
repeat:
until:
- condition: numeric_state
entity_id: light.wiz_rgbw_tunable_11bb5e
attribute: color_temp_kelvin
below: 2201
sequence:
- action: light.turn_on
metadata: {}
data:
color_temp_kelvin: "{{ state_attr('light.wiz_north', 'color_temp_kelvin') - 1 }}"
target:
device_id:
- 8c3326364aa17256951fe2b018459761
- d442ec4aa9c1a9d959032abcea183c78
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 750
- action: light.turn_on
metadata: {}
data:
rgbw_color:
- 114
- 10
- 0
- 255
target:
device_id:
- d442ec4aa9c1a9d959032abcea183c78
- 8c3326364aa17256951fe2b018459761
mode: single
but if you've chosen to use a loop on the right side that eventually completes after 20 mins and you want to do something at that point, just put it after the loop
see the example here:
https://www.home-assistant.io/docs/scripts/#parallelizing-actions
If I put it after the loop it will be inside the parallel block and execute instantly.
It is also possible to run a group of actions sequentially inside the parallel actions. The example below demonstrates that:
no, it will execute after the loop
make it part of a sequence as shown in that example
loop, then action
you can do more than one thing in series in a parallel branch
Where else would I put it?
Outside the loop?
So... inside the parallel block.
and it would execute instantly..
which I already said is not what I want.
see the sequence: block in the example
I get that you seem perturbed
the sequence: block groups things together that will execute sequentially
use that, first thing is the loop, second thing is the action you want to happen after the loop
🤦♀️
here is the example:
- parallel:
- sequence:
- wait_for_trigger:
- trigger: state
entity_id: binary_sensor.motion
to: "on"
- action: notify.person1
data:
message: "This message awaited the motion trigger"
- action: notify.person2
data:
message: "I am sent immediately and do not await the above action!"