Hello everybody,
i am still trying to get this automation to work.
The automation started but then i got the following error:
Stopped because only a single execution is allowed at 31. Juli 2022 um 01:46:00 (runtime: 0.00 seconds)
The automation starts with the configured time and the light turned on.
I use hue bulbs over deconz/phoscon.
Home Assistant Versions are:
Home Assistant 2022.7.7
Supervisor 2022.07.0
Operating System 8.4
Frontend 20220707.1 - latest
Eventually somebody has an idea for a solution.
Best regards
DiBa
Here is my automation config:
variables:
light_entity: light.wohnzimmer_deckenlicht_1
sensor: none
sunrise_duration: 10
start_brightness: 1
end_brightness: 100
range_brightness: '{{float(end_brightness)-float(start_brightness)}}'
manual_time: '01:55:00'
seconds: '{{float(sunrise_duration) * 60}}'
min_mired: 0
start_mired: '{{state_attr(light_entity, ''max_mireds'')}}'
end_mired: '{{[state_attr(light_entity, ''min_mireds'')|int(0), min_mired|int(0)]|max}}'
tick_time: '{{float(seconds) / float(range_brightness)}}'
check_entity: none
trigger:
- platform: time_pattern
minutes: '*'
condition: []
action:
- wait_template: '{{sensor == ''none'' or as_timestamp(states(sensor), None) != None}}'
- wait_template: >-
{{0 < as_timestamp(states(sensor) if sensor != 'none' else
states('sensor.date') ~ ' ' ~ manual_time) -
as_timestamp(states('sensor.date_time_iso')) <= float(seconds) and
states(check_entity) in ['unknown', 'on', 'home']}}
- choose: []
default: []
- condition: template
value_template: '{{sensor == ''none'' or as_timestamp(states(sensor), None) != None}}'
- condition: template
value_template: >-
{{0 < as_timestamp(states(sensor) if sensor != 'none' else
states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now()) <=
float(seconds) and states(check_entity) in ['unknown', 'on', 'home']}}
- choose:
- conditions:
- '{{state_attr(light_entity, ''min_mireds'') != None}}'
sequence:
- service: light.turn_on
data:
brightness: '{{start_brightness}}'
color_temp: '{{start_mired}}'
entity_id: light.wohnzimmer_deckenlicht_1
default:
- service: light.turn_on
data:
brightness: '{{start_brightness}}'
entity_id: light.wohnzimmer_deckenlicht_1
- repeat:
while:
- '{{sensor == ''none'' or as_timestamp(states(sensor), None) != None}}'
- >-
{{0 < as_timestamp(states(sensor) if sensor != 'none' else
states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now()) <=
float(seconds)}}
sequence:
- delay: '{{tick_time}}'
- choose:
- conditions:
- >-
{{0 < state_attr(light_entity, 'brightness') | int(0) <
end_brightness | int}}
- >-
{{sensor == 'none' or as_timestamp(states(sensor), None) !=
None}}
- >-
{{0 < as_timestamp(states(sensor) if sensor != 'none' else
states('sensor.date') ~ ' ' ~ manual_time) -
as_timestamp(now()) <= float(seconds)}}
sequence:
- choose:
- conditions:
- '{{state_attr(light_entity, ''min_mireds'') != None}}'
sequence:
- service: light.turn_on
data:
brightness: >-
{{(float(end_brightness) -
(float(range_brightness) *
(as_timestamp(states(sensor) if sensor != 'none'
else states('sensor.date') ~ ' ' ~ manual_time) -
as_timestamp(now())) / float(seconds))) | int(0)}}
color_temp: >-
{{(float(end_mired) + (float(start_mired) -
float(end_mired)) * ((as_timestamp(states(sensor)
if sensor != 'none' else states('sensor.date') ~ '
' ~ manual_time) - as_timestamp(now())) /
float(seconds))) | int(0)}}
entity_id: light.wohnzimmer_deckenlicht_1
default:
- service: light.turn_on
data:
brightness: >-
{{(float(end_brightness) - (float(range_brightness) *
(as_timestamp(states(sensor) if sensor != 'none' else
states('sensor.date') ~ ' ' ~ manual_time) -
as_timestamp(now())) / float(seconds))) | int(0)}}
entity_id: light.wohnzimmer_deckenlicht_1
- choose: []
default: []
mode: single
max_exceeded: silent
id: '1659224424147'
alias: Wake-up light alarm with sunrise effect
description: ''
Here is my blueprint config:
id: '1659224424147'
alias: Wake-up light alarm with sunrise effect
description: ''
use_blueprint:
path: sbyx/wake-up-light-alarm-with-sunrise-effect.yaml
input:
light_entity: light.wohnzimmer_deckenlicht_1
manual_time: '01:55:00'
sunrise_duration: 10
end_brightness: 100
Here are the informations from the trace:
{
"trace": {
"last_step": "trigger/0",
"run_id": "e2709011996d21bea3ed236dce43164c",
"state": "stopped",
"script_execution": "failed_single",
"timestamp": {
"start": "2022-07-30T23:46:00.015774+00:00",
"finish": "2022-07-30T23:46:00.018836+00:00"
},
"domain": "automation",
"item_id": "1659224424147",
"trigger": "time pattern",
"trace": {
"trigger/0": [
{
"path": "trigger/0",
"timestamp": "2022-07-30T23:46:00.018682+00:00",
"changed_variables": {
"this": {
"entity_id": "automation.wake_up_light_alarm_with_sunrise_effect",
"state": "on",
"attributes": {
"last_triggered": "2022-07-30T23:45:00.009237+00:00",
"mode": "single",
"current": 1,
"id": "1659224424147",
"friendly_name": "Wake-up light alarm with sunrise effect"
},
"last_changed": "2022-07-30T23:44:18.732511+00:00",
"last_updated": "2022-07-30T23:45:00.009409+00:00",
"context": {
"id": "01G98QZD36HZAYNJAVQCNRPHSB",
"parent_id": null,
"user_id": null
}
},
"trigger": {
"id": "0",
"idx": "0",
"platform": "time_pattern",
"now": "2022-07-31T01:46:00.005615+02:00",
"description": "time pattern"
},
"light_entity": "light.wohnzimmer_deckenlicht_1",
"sensor": "none",
"sunrise_duration": 10,
"start_brightness": 1,
"end_brightness": 100,
"range_brightness": 99,
"manual_time": "01:55:00",
"seconds": 600,
"min_mired": 0,
"start_mired": null,
"end_mired": 0,
"tick_time": 6.0606060606060606,
"check_entity": "none"
}
}
]
},
"config": {
"variables": {
"light_entity": "light.wohnzimmer_deckenlicht_1",
"sensor": "none",
"sunrise_duration": 10,
"start_brightness": 1,
"end_brightness": 100,
"range_brightness": "{{float(end_brightness)-float(start_brightness)}}",
"manual_time": "01:55:00",
"seconds": "{{float(sunrise_duration) * 60}}",
"min_mired": 0,
"start_mired": "{{state_attr(light_entity, 'max_mireds')}}",
"end_mired": "{{[state_attr(light_entity, 'min_mireds')|int(0), min_mired|int(0)]|max}}",
"tick_time": "{{float(seconds) / float(range_brightness)}}",
"check_entity": "none"
},
"trigger": [
{
"platform": "time_pattern",
"minutes": "*"
}
],
"condition": [],
"action": [
{
"wait_template": "{{sensor == 'none' or as_timestamp(states(sensor), None) != None}}"
},
{
"wait_template": "{{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(states('sensor.date_time_iso')) <= float(seconds) and states(check_entity) in ['unknown', 'on', 'home']}}"
},
{
"choose": [],
"default": []
},
{
"condition": "template",
"value_template": "{{sensor == 'none' or as_timestamp(states(sensor), None) != None}}"
},
{
"condition": "template",
"value_template": "{{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now()) <= float(seconds) and states(check_entity) in ['unknown', 'on', 'home']}}"
},
{
"choose": [
{
"conditions": [
"{{state_attr(light_entity, 'min_mireds') != None}}"
],
"sequence": [
{
"service": "light.turn_on",
"data": {
"brightness": "{{start_brightness}}",
"color_temp": "{{start_mired}}"
},
"entity_id": "light.wohnzimmer_deckenlicht_1"
}
]
}
],
"default": [
{
"service": "light.turn_on",
"data": {
"brightness": "{{start_brightness}}"
},
"entity_id": "light.wohnzimmer_deckenlicht_1"
}
]
},
{
"repeat": {
"while": [
"{{sensor == 'none' or as_timestamp(states(sensor), None) != None}}",
"{{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now()) <= float(seconds)}}"
],
"sequence": [
{
"delay": "{{tick_time}}"
},
{
"choose": [
{
"conditions": [
"{{0 < state_attr(light_entity, 'brightness') | int(0) < end_brightness | int}}",
"{{sensor == 'none' or as_timestamp(states(sensor), None) != None}}",
"{{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now()) <= float(seconds)}}"
],
"sequence": [
{
"choose": [
{
"conditions": [
"{{state_attr(light_entity, 'min_mireds') != None}}"
],
"sequence": [
{
"service": "light.turn_on",
"data": {
"brightness": "{{(float(end_brightness) - (float(range_brightness) * (as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now())) / float(seconds))) | int(0)}}",
"color_temp": "{{(float(end_mired) + (float(start_mired) - float(end_mired)) * ((as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now())) / float(seconds))) | int(0)}}"
},
"entity_id": "light.wohnzimmer_deckenlicht_1"
}
]
}
],
"default": [
{
"service": "light.turn_on",
"data": {
"brightness": "{{(float(end_brightness) - (float(range_brightness) * (as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(now())) / float(seconds))) | int(0)}}"
},
"entity_id": "light.wohnzimmer_deckenlicht_1"
}
]
}
]
}
]
}
]
}
},
{
"choose": [],
"default": []
}
],
"mode": "single",
"max_exceeded": "silent",
"id": "1659224424147",
"alias": "Wake-up light alarm with sunrise effect",
"description": ""
},
"blueprint_inputs": {
"id": "1659224424147",
"alias": "Wake-up light alarm with sunrise effect",
"description": "",
"use_blueprint": {
"path": "sbyx/wake-up-light-alarm-with-sunrise-effect.yaml",
"input": {
"light_entity": "light.wohnzimmer_deckenlicht_1",
"manual_time": "01:55:00",
"sunrise_duration": 10,
"end_brightness": 100
}
}
},
"context": {
"id": "01G98R17PFM7Q5XSWSN43MGSMP",
"parent_id": null,
"user_id": null
}
},
"logbookEntries": []
}