I’m using a blueprint, which is a slightly modified version of this blueprint
It’s generating the following error in my HASS log:
> 2021-03-04 16:56:01 ERROR (MainThread) [homeassistant.components.automation] Blueprint Z2M - Aqara Wireless Mini Switch generated invalid automation with inputs OrderedDict([('switch', 'sensor.bedroom_button1_action'), ('press_single', [OrderedDict([('service', 'light.toggle'), ('data', OrderedDict([('entity_id', 'light.nightlights')]))])]), ('press_double', [OrderedDict([('scene', 'scene.all_lights_off')]), OrderedDict([('service', 'media_player.media_stop'), ('data', 'media_player.bedroom')])])]): expected dict for dictionary value @ data['action'][1]['choose'][1]['sequence'][1]['data']. Got None
I can’t see any issues with it specifically. Here’s the blueprint code:
blueprint:
name: Z2M - Aqara Wireless Mini Switch
description: Automate your Xiaomi Aqara Wireless Mini Switch using ZHA events.
domain: automation
input:
switch:
name: Aqara Wireless Mini Switch
description: Aqara Wireless Mini Switch to use
selector:
entity:
domain: sensor
integration: mqtt
press_single:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
press_double:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
press_long:
name: Long Press
description: Action to run when button is long pressed (held down)
default: []
selector:
action: {}
press_release:
name: Released
description: Action to run when button is released after a long press
default: []
selector:
action: {}
press_shake:
name: Shake
description: Action to run when shaken
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input switch
attribute: click
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'single' }}"
sequence: !input press_single
- conditions:
- "{{ command == 'double' }}"
sequence: !input press_double
- conditions:
- "{{ command == 'hold' }}"
sequence: !input press_long
- conditions:
- "{{ command == 'release' }}"
sequence: !input press_release
- conditions:
- "{{ command == 'shake' }}"
sequence: !input press_shake
And here’s the generated automation from my automations.yaml file:
- id: '1612272860047'
alias: Dereks Button
description: ''
use_blueprint:
path: mine/z2m_xiaomi_button.yaml
input:
switch: sensor.bedroom_button1_action
press_single:
- service: light.turn_off
target:
entity_id: light.house_lights
- service: media_player.play_media
data:
media_content_id: stop
media_content_type: custom
target:
entity_id: media_player.bedroom
press_double:
- service: light.toggle
data: {}
target:
entity_id: light.nightlights
press_long:
- service: light.turn_on
data: {}
target:
entity_id: light.nightlights
press_release: []
press_shake: []
Can anyone help me debug what’s wrong?
Thanks