Thank you! I updated my local blueprint and reloaded automations… Everything works as expected.
I have updated the blueprint in the OP to include your efficiency improvements
Thank you! I updated my local blueprint and reloaded automations… Everything works as expected.
I have updated the blueprint in the OP to include your efficiency improvements
I just updated the blueprint again.
There was a format error (my fault) when I copied the file.
@123 - I also made some minor changes. I had initially thought the everything was working after simply reloading the automations, however after a complete restart of Home Assistant, my automations built on this blueprint no longer worked.
For some reason, it does not like the condition: template
inside of the action. There are no errors, it just does not make it to the sequence. I was able to still follow your lead and remove the repetitive code. Just with a slightly different approach.
Basically, I added the scene_value_id
to the event_data
trigger and moved the remaining condition to match the node_id, to before the action.
trigger:
- platform: event
event_type: ozw.scene_activated
event_data:
scene_value_id: 1
condition: "{{ trigger.event.data.node_id == (ozw_node_id | int) }}"
action:
- variables:
scene_id: "{{ trigger.event.data.scene_id }}"
- choose:
- conditions: "{{ scene_id == 1 }}" ## Pressed Button 1
sequence: !input button_1
- conditions: "{{ scene_id == 2 }}" ## Pressed Button 2
sequence: !input button_2
- conditions: "{{ scene_id == 3 }}" ## Pressed Button 3
sequence: !input button_3
- conditions: "{{ scene_id == 4 }}" ## Pressed Button 4
sequence: !input button_4
That’s my mistake.
I did this:
- condition:
condition: template
value_template: >
but it should be like this:
- condition: template
value_template: >
I’ve updated my post above.
It should work equally well the way you changed it (moved the condition completely out of the action).
If you modify a blueprint, you minimally have to execute Reload Automations to make Home Assistant use the revised version (restarting Home Assistant will, of course, do the same).
I just wanted to again say thank you for this. With these suggestions, I was able to remove 39 lines from my inovelli blueprint!
@troy In case you’re wanting it, here’s a variant that works with the new zwave_js
:
---
blueprint:
name: Aeotec ZWA003 NanoMote Quad
description: Create automations for the Aeotec ZWA003 NanoMote Quad using the
OZW integration.
domain: automation
input:
aeotec_nanomote:
name: Aeotec NanoMote Quad
description: The NanoMote Quad to interact with.
selector:
device:
integration: zwave_js
manufacturer: Aeotec Ltd.
model: Aeotec NanoMote Quad
button_1:
name: Press Button One
description: Action to run on button press.
default: []
selector:
action: {}
button_2:
name: Press Button Two
description: Action to run on button press.
default: []
selector:
action: {}
button_3:
name: Press Button Three
description: Action to run on button press.
default: []
selector:
action: {}
button_4:
name: Press Button Four
description: Action to run on button press.
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
platform: event
event_type: zwave_js_event
event_data:
command_class_name: Central Scene
device_id: !input aeotec_nanomote
action:
- variables:
scene_id: "{{ trigger.event.data.property_key_name }}"
- choose:
- conditions: "{{ scene_id == '001' }}"
sequence: !input button_1
- conditions: "{{ scene_id == '002' }}"
sequence: !input button_2
- conditions: "{{ scene_id == '003' }}"
sequence: !input button_3
- conditions: "{{ scene_id == '004' }}"
sequence: !input button_4
EDIT: Thanks for the streamlining, @freshcoast!
You don’t need the node id, just trigger off the device_id you already have.
trigger:
platform: event
event_type: zwave_js_event
event_data:
device_id: !input aeotec_nanomote
command_class_name: Central Scene
Awesome thank you! I’m looking forward for my own switch over to Z-Wave JS – All these exciting things happening, and of course I’m busy with other things this week.
Thanks to everyone who has worked on this so far! I am trying to port this code over to use the older Minimotes with zwave_js, but haven’t been able to get it working yet.
The Minimotes send out an event_type: zwave_js_event, but of the data type: “value_notification” and scene_id values of 1, 3, 5, or 7 corresponding to the four buttons. (Odd 1, 3, 5, 7 for short press, even 2, 4, 6, 8 for long press.)
I can get everything working if I explicitly list the node_id, type: value_notification, and value, but not in the blueprints format.
Working test manually using Scene 1:
Button press info from Event Logs:
Any ideas on what I need to tweak? Thanks!
The blueprint is triggering on Central Scene. The minimote uses Scene Activation.
Hello,
I hope you could help me. i have just included this nanomote quad and i only get these entities…
Maybe you could assist me? i am using z-wave js using z-wave js to mqtt as bridge.~
i am so lost…
thank you
i did the event listening option and got this
Event 1 fired 5:53 PM:
{
"event_type": "zwave_js_event",
"data": {
"type": "value_notification",
"domain": "zwave_js",
"node_id": 58,
"home_id": 3889200754,
"endpoint": null,
"device_id": "b078e1d6a79f6ee6ba98789f0138ff1d",
"command_class": 91,
"command_class_name": "Central Scene",
"label": "Scene 002",
"property_name": "scene",
"property_key_name": "002",
"value": "KeyPressed"
},
"origin": "LOCAL",
"time_fired": "2021-02-25T17:53:10.381458+00:00",
"context": {
"id": "6716c1c14579e2ff29ab9d8528800dec",
"parent_id": null,
"user_id": null
}
}
nvm me… I realized how to do it! and on the way I understood how to create a blueprint! Thank you!
Has anyone been able to create a zwavejs blueprint for the nanomote quad? If so would they be willing to share it on the forum. I wish I had the ability to create one but its just a bit outside my ability. Thanks!
Has anyone been able to create a zwavejs blueprint for the nanomote quad?
If i add the url for this blueprint to my setup will it automatically pull the js version from post 12 or will it pull the original from the top that works with ozw? If it doesnt pull from post 12 how is that accomplished to import it to my ha?
Can some kind soul see what I messed up with? It finds the nanomote but it wont trigger the device
blueprint:
name: Aeotec ZWA003 NanoMote Quad
description: Create automations for the Aeotec ZWA003 NanoMote Quad using the
OZW integration.
domain: automation
input:
aeotec_nanomote:
name: Aeotec NanoMote Quad
description: The NanoMote Quad to interact with.
selector:
device:
integration: zwave_js
manufacturer: Aeotec Ltd.
model: Aeotec NanoMote Quad
button_1:
name: Press Button One
description: Action to run on button press.
default: []
selector:
action: {}
button_2:
name: Press Button Two
description: Action to run on button press.
default: []
selector:
action: {}
button_3:
name: Press Button Three
description: Action to run on button press.
default: []
selector:
action: {}
button_4:
name: Press Button Four
description: Action to run on button press.
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
platform: event
event_type: zwave_js_event
event_data:
command_class_name: Central Scene
device_id: 881-3-2
action:
- variables:
scene_id: "{{ trigger.event.data.property_key_name }}"
- choose:
- conditions: "{{ scene_id == '001' }}"
sequence: 34-91-0-scene-001
- conditions: "{{ scene_id == '002' }}"
sequence: 34-91-0-scene-002
- conditions: "{{ scene_id == '003' }}"
sequence: 34-91-0-scene-003
- conditions: "{{ scene_id == '004' }}"
sequence: 34-91-0-scene-004
the event type is diferent now
change zwave_js_event FOR zwave_js_value_notification
I moved from openzwave to zwave-js and my nanomote quad automations failed to work.
They were in the following format:
I tried switching the “ozw.scence_activated” against “zwave_js_value_notification” however this didn’t solve it, my automations would not get triggered.
So I got the blueprint from post #12 and I can add automations that work. However the blueprint only sets up single quick press for each button. I was using automations for holding down and releasing as well (thus 8 automations in total).
If I run listen on this press I get two entries:
"value": "KeyHeldDown",
"value_raw": 2
“value”: “KeyReleased”,
“value_raw”: 1
I will answer my own question as I got it to work. Don’t know how I add my blueprint here but the following works for allowing to create automations for both the quick press and the long hold for 2 seconds for each button. So all in all 8 automations from the NanoMote Quad.
Note the Input needs to be matched to your NanoMote Quad.
And it’s changed to have zwave_js_value_notification instead of js_event.
blueprint:
name: Aeotec ZWA003 NanoMote Quad
description: Create automations for the Aeotec ZWA003 NanoMote Quad using the
Zwave-JS integration.
domain: automation
input:
NanoMote:
name: Aeotec NanoMote Quad
description: The NanoMote Quad to interact with.
selector:
device:
integration: zwave_js
manufacturer: Aeotec Ltd.
model: Aeotec NanoMote Quad
button_1_single:
name: Press Button One Single
description: Action to run on single button press.
default: []
selector:
action: {}
button_1_hold:
name: Press Button One Hold
description: Action to run on long button press.
default: []
selector:
action: {}
button_2_single:
name: Press Button Two Single
description: Action to run on single button press.
default: []
selector:
action: {}
button_2_hold:
name: Press Button Two Hold
description: Action to run on long button press.
default: []
selector:
action: {}
button_3_single:
name: Press Button Three Single
description: Action to run on single button press.
default: []
selector:
action: {}
button_3_hold:
name: Press Button Three Hold
description: Action to run on long button press.
default: []
selector:
action: {}
button_4_single:
name: Press Button Four Single
description: Action to run on single button press.
default: []
selector:
action: {}
button_4_hold:
name: Press Button Four Hold
description: Action to run on long button press.
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
platform: event
event_type: zwave_js_value_notification
event_data:
command_class_name: Central Scene
device_id: !input NanoMote
action:
- variables:
scene_id: "{{ trigger.event.data.property_key_name }}"
scene_value_id: "{{ trigger.event.data.value }}"
- choose:
- conditions: "{{ scene_id == '001' and scene_value_id == 'KeyPressed' }}"
sequence: !input button_1_single
- conditions: "{{ scene_id == '001' and scene_value_id == 'KeyReleased' }}"
sequence: !input button_1_hold
- conditions: "{{ scene_id == '002' and scene_value_id == 'KeyPressed' }}"
sequence: !input button_2_single
- conditions: "{{ scene_id == '002' and scene_value_id == 'KeyReleased' }}"
sequence: !input button_2_hold
- conditions: "{{ scene_id == '003' and scene_value_id == 'KeyPressed' }}"
sequence: !input button_3_single
- conditions: "{{ scene_id == '003' and scene_value_id == 'KeyReleased' }}"
sequence: !input button_3_hold
- conditions: "{{ scene_id == '004' and scene_value_id == 'KeyPressed' }}"
sequence: !input button_4_single
- conditions: "{{ scene_id == '004' and scene_value_id == 'KeyReleased' }}"
sequence: !input button_4_hold