I have an issue where I’ve created a blueprint from a working automation. I then create a new automation from the blueprint. The newly created automation works perfectly on immediate testing. No issues, errors, nothing. However, as soon as I restart HA for any reason, HA won’t load automations.yaml and all automations cease to function. I have to remove the offending automation manually and reload HA before the automation UI will return to normal. I’ve gone round and round and round trying to figure out what is causing this in the blueprint, but I can’t find it. I use hubitat for zwave/zigbee devices and have lifx bulbs throughout the house. The goal is to get a working blueprint so I can quickly associate inovelli red series switches (in smart bulb mode) from hubitat with corresponding lifx bulbs.
Working automation:
alias: KitchenTableSwitchLifxBulbsSync
description: ""
trigger:
- device_id: c097e26e4b55e34a1a662d33bd3f7b2d
domain: hubitat
platform: device
type: pushed
subtype: "1"
id: up_pressed
- device_id: c097e26e4b55e34a1a662d33bd3f7b2d
domain: hubitat
platform: device
type: pushed
subtype: "8"
id: up_held
- device_id: c097e26e4b55e34a1a662d33bd3f7b2d
domain: hubitat
platform: device
type: pushed
subtype: "6"
id: up_released
- device_id: c097e26e4b55e34a1a662d33bd3f7b2d
domain: hubitat
platform: device
type: held
subtype: "8"
id: down_held
- device_id: c097e26e4b55e34a1a662d33bd3f7b2d
domain: hubitat
platform: device
type: held
subtype: "6"
id: down_released
- device_id: c097e26e4b55e34a1a662d33bd3f7b2d
domain: hubitat
platform: device
type: held
subtype: "1"
id: down_pressed
- platform: device
type: turned_on
device_id: c097e26e4b55e34a1a662d33bd3f7b2d
entity_id: light.kitchen_table_light
domain: light
id: switch_on
- platform: device
type: turned_off
device_id: c097e26e4b55e34a1a662d33bd3f7b2d
entity_id: light.kitchen_table_light
domain: light
id: switch_off
- platform: state
entity_id:
- light.kitchen_table_lifx_bulbs
from: "off"
to: "on"
id: bulbs_on
- platform: state
entity_id:
- light.kitchen_table_lifx_bulbs
from: "on"
to: "off"
id: bulbs_off
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: up_pressed
sequence:
- service: light.turn_on
data:
transition: 1
brightness_pct: 100
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: up_held
sequence:
- repeat:
until:
- condition: state
entity_id: light.kitchen_table_lifx_bulbs
attribute: brightness
state: "100"
sequence:
- service: light.turn_on
data:
brightness_step_pct: "6"
transition: "{{ 100 / 1000 }}"
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: up_released
sequence:
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- conditions:
- condition: trigger
id: down_held
sequence:
- repeat:
until:
- condition: numeric_state
entity_id: light.kitchen_table_lifx_bulbs
attribute: brightness
below: 1
sequence:
- service: light.turn_on
data:
brightness_step: "-12"
transition: "{{ 100 / 1000 }}"
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: down_released
sequence:
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 100
- conditions:
- condition: trigger
id: down_pressed
sequence:
- service: light.turn_off
data:
transition: 1
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: switch_on
sequence:
- service: light.turn_on
data: {}
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: switch_off
sequence:
- service: light.turn_off
data: {}
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: bulbs_on
sequence:
- type: turn_on
device_id: c097e26e4b55e34a1a662d33bd3f7b2d
entity_id: light.kitchen_table_light
domain: light
- conditions:
- condition: trigger
id: bulbs_off
sequence:
- type: turn_off
device_id: c097e26e4b55e34a1a662d33bd3f7b2d
entity_id: light.kitchen_table_light
domain: light
mode: restart
Blueprint:
blueprint:
name: RedSeriesDimmerSyncWithLifxBulbs
description: Allows a red series dimmer to be synced with a lifx bulb or bulb group to enable on/off, hold to dim, and mirror state between lights and switch.
domain: automation
input:
red_dimmer:
name: Red Series Dimmer
description: Red Series Dimmer to associate.
selector:
device:
model: Inovelli Dimmer Red Series LZW31-SN
multiple: false
light_entity:
name: Light Entity
description: Light entity to control.
selector:
entity:
domain: light
multiple: false
transition_on:
name: On Transition
description: The duration in seconds for the light entity to transiton on.
default: 1
selector:
number:
min: 0.0
max: 15.0
unit_of_measurement: seconds
step: 1.0
mode: slider
transition_off:
name: Off Transition
description: The duration in seconds for the light entity to transiton off.
default: 1
selector:
number:
min: 0.0
max: 15.0
unit_of_measurement: seconds
step: 1.0
mode: slider
step:
name: Brightness Step Percentage
description: The percentage of brightness to which the light is changed when
the RAISE/LOWER button is pressed and held.
default: 10
selector:
number:
min: 1.0
max: 25.0
unit_of_measurement: percentage
step: 1.0
mode: slider
speed:
name: Brightness Transition Speed
description: The rate in milliseconds at which the brightness of the light entity
will be changed.
default: 250
selector:
number:
min: 100.0
max: 2000.0
unit_of_measurement: milliseconds
step: 1.0
mode: slider
variables:
step: !input step
speed: !input speed
trigger:
- device_id: !input red_dimmer
domain: hubitat
platform: device
type: pushed
subtype: "1"
id: up_pressed
- device_id: !input red_dimmer
domain: hubitat
platform: device
type: pushed
subtype: "8"
id: up_held
- device_id: !input red_dimmer
domain: hubitat
platform: device
type: pushed
subtype: "6"
id: up_released
- device_id: !input red_dimmer
domain: hubitat
platform: device
type: held
subtype: "8"
id: down_held
- device_id: !input red_dimmer
domain: hubitat
platform: device
type: held
subtype: "6"
id: down_released
- device_id: !input red_dimmer
domain: hubitat
platform: device
type: held
subtype: "1"
id: down_pressed
- platform: device
type: turned_on
device_id: !input red_dimmer
entity_id: !input light_entity
domain: light
id: switch_on
- platform: device
type: turned_off
device_id: !input red_dimmer
entity_id: !input light_entity
domain: light
id: switch_off
- platform: state
entity_id:
- light.kitchen_table_lifx_bulbs
from: "off"
to: "on"
id: bulbs_on
- platform: state
entity_id:
- light.kitchen_table_lifx_bulbs
from: "on"
to: "off"
id: bulbs_off
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: up_pressed
sequence:
- service: light.turn_on
data:
transition: !input transition_on
brightness_pct: 100
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: up_held
sequence:
- repeat:
until:
- condition: state
entity_id: light.kitchen_table_lifx_bulbs
attribute: brightness
state: "100"
sequence:
- service: light.turn_on
data:
brightness_step_pct: !input step
transition: "{{ speed / 1000 }}"
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: up_released
sequence:
- delay:
milliseconds: 100
- conditions:
- condition: trigger
id: down_held
sequence:
- repeat:
until:
- condition: numeric_state
entity_id: light.kitchen_table_lifx_bulbs
attribute: brightness
below: 1
sequence:
- service: light.turn_on
data:
brightness_step: '{{ step * -2 }}'
transition: "{{ speed / 1000 }}"
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: down_released
sequence:
- delay:
milliseconds: 100
- conditions:
- condition: trigger
id: down_pressed
sequence:
- service: light.turn_off
data:
transition: !input transition_off
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: switch_on
sequence:
- service: light.turn_on
data: {}
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: switch_off
sequence:
- service: light.turn_off
data: {}
target:
entity_id: light.kitchen_table_lifx_bulbs
- conditions:
- condition: trigger
id: bulbs_on
sequence:
- type: turn_on
device_id: !input red_dimmer
entity_id: !input light_entity
domain: light
- conditions:
- condition: trigger
id: bulbs_off
sequence:
- type: turn_off
device_id: !input red_dimmer
entity_id: !input light_entity
domain: light
mode: restart
Logs:
This error originated from a custom integration.
Logger: homeassistant.setup
Source: custom_components/hubitat/hub.py:471
Integration: Hubitat (documentation, issues)
First occurred: 8:59:20 PM (1 occurrences)
Last logged: 8:59:20 PM
Error during setup of component automation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
result = await task
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 238, in async_setup
if not await _async_process_config(hass, config, component):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 671, in _async_process_config
await async_validate_config_item(hass, raw_config),
File "/usr/src/homeassistant/homeassistant/components/automation/config.py", line 74, in async_validate_config_item
config[CONF_TRIGGER] = await async_validate_trigger_config(
File "/usr/src/homeassistant/homeassistant/helpers/trigger.py", line 94, in async_validate_trigger_config
conf = await platform.async_validate_trigger_config(hass, conf)
File "/usr/src/homeassistant/homeassistant/components/device_automation/trigger.py", line 66, in async_validate_trigger_config
return await platform.async_validate_trigger_config(hass, config)
File "/config/custom_components/hubitat/device_trigger.py", line 90, in async_validate_trigger_config
hubitat_device, _ = get_hubitat_device(hass, device.id)
File "/config/custom_components/hubitat/device_trigger.py", line 213, in get_hubitat_device
hub = get_hub(hass, entry_id)
File "/config/custom_components/hubitat/hub.py", line 471, in get_hub
return hass.data[DOMAIN][config_entry_id]
KeyError: '1750592be759a02405c6157b9c2c6bd1'