Hi all,
I recently switched from Philips Hue to Zigbee2MQTT to have some more freedom in my device choices. I still have my old Hue DImmer that I would like to use for all sorts of things.
I came across the blueprint from hugalafutro, but it seems that whenever it triggers it will than go and check the state again. However it almost always happens to have changed already, so I tried to re-use the trigger that actually triggered the automation.
However, I can’t seem to import the blueprint. I’ve made the following blueprint:
blueprint:
name: Zigbee2Mqtt Hue Dimmer Switch control
description: 'Based on https://gist.github.com/hugalafutro/c34ec70b688c9065ed0054b33d3f32a6'
domain: automation
input:
dimmer_action:
name: Dimmer Switch Action sensor
description: 'Select your "sensor.dimmer_action" entity that will control this automation.'
selector:
entity:
domain: sensor
integration: mqtt
action_on_press:
name: on-press
description: select action to run when you press I
selector:
action:
action_off_press:
name: off-press
description: select action to run when you press O
selector:
action:
action_up_press:
name: up-press
description: select action to run when you press UP
selector:
action:
action_down_press:
name: down-press
description: select action to run when you press DOWN
selector:
action:
action_on_hold:
name: on-hold
description: select action to run when you hold I
selector:
action:
action_off_hold:
name: off-hold
description: select action to run when you hold O
selector:
action:
action_up_hold:
name: up-hold
description: select action to run when you hold UP
selector:
action:
action_down_hold:
name: down-hold
description: select action to run when you hold DOWN
selector:
action:
trigger:
- platform: state
entity_id: !input dimmer_action
id: "on-press"
attribute: action
to: on-press
- platform: state
entity_id: !input dimmer_action
id: "off-press"
attribute: action
to: off-press
- platform: state
entity_id: !input dimmer_action
id: "up-press"
attribute: action
to: up-press
- platform: state
entity_id: !input dimmer_action
attribute: action
id: "down-press"
attribute: action
to: down-press
- platform: state
entity_id: !input dimmer_action
id: "up-hold"
attribute: action
to: up-hold
attribute: action
- platform: state
entity_id: !input dimmer_action
id: "down-hold"
attribute: action
to: down-hold
attribute: action
- platform: state
entity_id: !input dimmer_action
id: "on-hold"
attribute: action
to: on-hold
attribute: action
- platform: state
entity_id: !input dimmer_action
id: "off-hold"
attribute: action
to: off-hold
action:
- choose:
- conditions:
- condition: trigger
id: "on-press"
sequence:
!input action_on_press
- conditions:
- condition: trigger
id: "off-press"
sequence:
!input action_off_press
- conditions:
- condition: trigger
id: "up-press"
sequence:
!input action_up_press
- conditions:
- condition: trigger
id: "down-press"
sequence:
!input action_down_press
- conditions:
- condition: trigger
id: "on-hold"
sequence:
!input action_on_hold
- conditions:
- condition: trigger
id: "off-hold"
sequence:
!input action_off_hold
- conditions:
- condition: trigger
id: "up-hold"
sequence:
!input action_up_hold
- conditions:
- condition: trigger
id: "down-hold"
sequence:
!input action_down_hold
default: []
When trying to import it, it gives me the following error:
Logger: homeassistant.components.websocket_api.http.connection
Source: util/yaml/loader.py:145
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 19:58:21 (2 occurrences)
Last logged: 22:40:44
[547964285040] Error handling message: Unknown error (unknown_error)
[547955426544] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/lib/python3.10/site-packages/homeassistant/components/blueprint/websocket_api.py", line 68, in ws_import_blueprint
imported_blueprint = await importer.fetch_blueprint_from_url(hass, msg["url"])
File "/usr/lib/python3.10/site-packages/homeassistant/components/blueprint/importer.py", line 228, in fetch_blueprint_from_url
imported_bp = await func(hass, url)
File "/usr/lib/python3.10/site-packages/homeassistant/components/blueprint/importer.py", line 201, in fetch_blueprint_from_github_gist_url
data = yaml.parse_yaml(content)
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 166, in parse_yaml
return _parse_yaml_pure_python(content, secrets)
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 183, in _parse_yaml_pure_python
return _parse_yaml(SafeLineLoader, content, secrets)
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 198, in _parse_yaml
yaml.load(content, Loader=lambda stream: loader(stream, secrets))
File "/usr/lib/python3.10/site-packages/yaml/__init__.py", line 81, in load
return loader.get_single_data()
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 51, in get_single_data
return self.construct_document(node)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 55, in construct_document
data = self.construct_object(node)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 100, in construct_object
data = constructor(self, node)
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 325, in _ordered_dict
nodes = loader.construct_pairs(node)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 155, in construct_pairs
value = self.construct_object(value_node, deep=deep)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 100, in construct_object
data = constructor(self, node)
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 356, in _construct_seq
(obj,) = loader.construct_yaml_seq(node)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 408, in construct_yaml_seq
data.extend(self.construct_sequence(node))
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 129, in construct_sequence
return [self.construct_object(child, deep=deep)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 129, in <listcomp>
return [self.construct_object(child, deep=deep)
File "/usr/lib/python3.10/site-packages/yaml/constructor.py", line 100, in construct_object
data = constructor(self, node)
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 341, in _ordered_dict
fname = loader.get_stream_name()
File "/usr/lib/python3.10/site-packages/homeassistant/util/yaml/loader.py", line 145, in get_stream_name
return self.stream.name or ""
AttributeError: 'NoneType' object has no attribute 'name'
What am I missing here?