Hey everyone,
I do have an understanding issue and how to debug this.
I can save a new automation based on my blueprint only if I add an optional meant device entity (presence_sensor). Otherwise I get the following error when trying to safe the new automation:
Message malformed: Entity [] is neither a valid entity ID nor a valid UUID for dictionary value @ data['entity_id']
The optional input for the presence sensor:
presence_sensor:
name: 🛌 Select presence (binary) sensor
description: |-
Enables the automation to open the cover in the morning after the last one has left the room. Helpful on bedrooms, especially at weekend.
Require _Enable presence detection_ option. Optional.
default: []
selector:
entity:
filter:
- domain: binary_sensor
device_class: presence
I don’t understand where the error message comes from and where to search. The complete blueprint can be found here.
Sorry for not providing more code snippets, as I don’t know which parts to show…
You have that as required all over that BP. You have to have a valid entity in there.
No, it can’t be a default unless the default is a valid entity.
I don’t get it. I’ve created a test BP with an input defining an empty default, which behaves like I expect it (I can leave window empty then the cover is controlled via time):
blueprint:
name: Test with empty default
author: https://github.com/carslen
description: "Just for testing empty defaults"
domain: automation
input:
cover:
name: Select your Cover
selector:
entity:
filter:
- domain: cover
window:
name: select your window contact if available
description: This input has an empty default
default: []
selector:
entity:
filter:
- domain: binary_sensor
device_class: [window, door]
cover_close:
name: Time to close cover
default: "18:00:00"
selector:
time:
cover_open:
name: Time to open cover
default: "08:00:00"
selector:
time:
trigger_variables:
cover: !input cover
window: !input window
cover_close: !input cover_close
cover_open: !input cover_open
trigger:
- platform: template
alias: Contact open
value_template: "{{ window != [] and is_state(window, ['true', 'on']) }}"
id: open_contact
- platform: template
alias: contact close
value_template: "{{ window != [] and is_state(window, ['false','off']) }}"
id: close_contact
- platform: time
alias: open cover
at: !input cover_open
id: open
- platform: time
alias: close cover
at: !input cover_close
id: close
condition: []
action:
- choose:
- alias: Cover Open
conditions:
- condition: trigger
id:
- open
- open_contact
sequence:
- service: cover.open_cover
metadata: {}
data: {}
target:
entity_id: !input cover
- alias: Cover close
conditions:
- condition: trigger
id:
- close
- close_contact
sequence:
- service: cover.close_cover
metadata: {}
data: {}
target:
entity_id: !input cover