Hello,
I’m writing my first blueprint. In the “action” part I have one action which is called every the blueprint triggers and one action which will be called only if the variable “device_boolean” is off.
blueprint:
name: Consumption Switcher
description: Switch on an input_boolean when consumption goes up
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
entity:
domain: sensor
consumption_limit:
name: Consumption limit
description: Power threshold above which we assume the appliance has started.
default: 10
selector:
number:
min: 1.0
max: 100.0
unit_of_measurement: W
mode: slider
step: 1.0
starting_hysteresis:
name: Time duration switching on
description: Time duration the power measurement has to stay above the starting
power threshold.
default: 0
selector:
number:
min: 0
max: 180
unit_of_measurement: sec
mode: slider
step: 1
finishing_hysteresis:
name: Time duration switching off
description: Time duration the power measurement has to stay below the finishing
power threshold.
default: 0
selector:
number:
min: 0
max: 180
unit_of_measurement: sec
mode: slider
step: 1
device_boolean:
name: Device Boolean
description: Helper variable
selector:
entity:
actions:
name: Actions
description: Actions (e.g. pushing a notification, TTS announcement, ...)
default:
selector:
action: {}
source_url: https://gist.github.com/xxx
variables:
device_boolean: !input 'device_boolean'
trigger:
- platform: numeric_state
entity_id: !input 'power_sensor'
for:
seconds: !input 'starting_hysteresis'
above: !input 'consumption_limit'
- platform: numeric_state
entity_id: !input 'power_sensor'
for:
seconds: !input 'finishing_hysteresis'
below: !input 'consumption_limit'
condition: []
action:
- service: >
{% if trigger.above %}
input_boolean.turn_on
{% else %}
input_boolean.turn_off
{% endif %}
data: {}
entity_id: !input 'device_boolean'
- choose:
- conditions:
- condition: template
value_template: '{{ device_boolean.state == "off" }}'
sequence: !input 'actions'
default: []
mode: single
max_exceeded: silent
In the logs I find an error:
Logger: homeassistant.config
Source: components/blueprint/models.py:259
First occurred: 1:47:35 AM (9 occurrences)
Last logged: 1:52:50 AM
Invalid config for [automation]: Failed to load blueprint: Unable to find _caspar/consumption-switcher.yaml (See /config/configuration.yaml, line 5).
But unfortunately, I don’t know what is wrong.
Can someone help me?
That would be really great, becaus I’m working on it since hours, without a solution.
Thank you
Cas