I’m aware this product is fairly new, has any attempted to create a blueprint for it. Really want all actions in one automation per button, even better all actions for all buttons under one automation would greatly help configuration as I have like 10 of these to setup replacing Zigbee buttons that keep falling off the network
Home Assistant Blueprint for Shelly Plus i4
-
ashp8i -
27. Februar 2022 um 11:16 -
Unerledigt
-
-
Not really a blueprint in the way you thought of it yet, but a start maybe also for others to join in and advice me, how to do it better:
my automation (for just one of the i4 buttons) now:
Code
Alles anzeigen- id: '6349322622791' alias: WZ-I4-Controller description: '' trigger: - platform: device device_id: bc9344f2b62a6df210789a5a6645c2e3 domain: shelly type: single_push subtype: button1 - platform: device device_id: bc9344f2b62a6df210789a5a6645c2e3 domain: shelly type: long_push subtype: button1 - platform: device device_id: bc9344f2b62a6df210789a5a6645c2e3 domain: shelly type: double_push subtype: button1 condition: [] action: - service: script.wzi4_{{ trigger.event.data.channel }}_{{ trigger.event.data.click_type }} mode: single
and then I am declaring scripts like:
Code
Alles anzeigenwzi4_1_single_push: alias: wzi4_1_single_push sequence: - service: notify.mobile_app_phone data: message: WZ I4 single mode: single wzi4_1_long_push: alias: wzi4_1_long_push sequence: - service: notify.mobile_app_phone data: message: WZ I4 long mode: single
As I say... just a beginning.
-
-
Autor
Hi sjds65,
many thanks for your reply that really does help I have a post in the home assistant forum which I will repost: -
Shelly PLUS i4 Wall Switch Example Automation
Code
Alles anzeigen- id: '1647025690449' alias: Shelly Wall Button 1 description: 'Automation for Shelly PLUS i4 Wall Actions' trigger: - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: single_push subtype: button1 id: shelly-example-button-a-1-single-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: single_push subtype: button2 id: shelly-example-button-a-2-single-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: single_push subtype: button3 id: shelly-example-button-a-3-single-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: single_push subtype: button4 id: shelly-example-button-a-4-single-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: double_push subtype: button1 id: shelly-example-button-a-1-double-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: double_push subtype: button2 id: shelly-example-button-a-2-double-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: double_push subtype: button3 id: shelly-example-button-a-3-double-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: double_push subtype: button4 id: shelly-example-button-a-4-double-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: long_push subtype: button1 id: shelly-example-button-a-1-long-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: long_push subtype: button2 id: shelly-example-button-a-2-long-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: long_push subtype: button3 id: shelly-example-button-a-3-long-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: long_push subtype: button4 id: shelly-example-button-a-4-long-push - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_down subtype: button1 id: shelly-example-button-a-1-btn-down - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_down subtype: button2 id: shelly-example-button-a-2-btn-down - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_down subtype: button3 id: shelly-example-button-a-3-btn-down - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_down subtype: button4 id: shelly-example-button-a-4-btn-down - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_up subtype: button1 id: shelly-example-button-a-1-btn-up - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_up subtype: button2 id: shelly-example-button-a-2-btn-up - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_up subtype: button3 id: shelly-example-button-a-3-btn-up - platform: device device_id: 6e9c4105160ef89fc6300d9fea855a1b domain: shelly type: btn_up subtype: button4 id: shelly-example-button-a-4-btn-up condition: [] action: - choose: - conditions: - condition: trigger id: shelly-example-button-a-1-single-push sequence: - service: light.toggle data: {} target: entity_id: light.example_light_tunable_white default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-1-double-push sequence: - service: light.turn_on data: color_temp: '{{ state_attr(''light.example_light_tunable_white'', ''color_temp'')|int + 50}}' target: entity_id: light.example_light_tunable_white default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-1-long-push sequence: - service: light.turn_on data: brightness_step_pct: 5 target: entity_id: light.example_light_tunable_white default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-2-single-push sequence: - service: light.toggle data: {} target: entity_id: light.example_light_tunable_white default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-2-double-push sequence: - service: light.turn_on data: color_temp: '{{ state_attr(''light.example_light_tunable_white'', ''color_temp'')|int - 50}}' target: entity_id: light.example_light_tunable_white default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-2-long-push sequence: - service: light.turn_on data: brightness_step_pct: -5 target: entity_id: light.example_light_tunable_white default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-3-single-push sequence: - service: light.toggle data: {} target: entity_id: light.example_light_rgb default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-3-double-push sequence: - service: light.turn_on data: hs_color: - '{{ (30 + (state_attr(''light.example_light_rgb'', ''hs_color'')[0] or 0)) % 360 }}' - 100 target: entity_id: light.example_light_rgb default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-3-long-push sequence: - service: light.turn_on data: brightness_step_pct: 5 target: entity_id: light.example_light_rgb default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-4-single-push sequence: - service: light.toggle data: {} target: entity_id: light.example_light_rgb default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-4-double-push sequence: - service: light.turn_on data: hs_color: - '{{ (30 - (state_attr(''light.example_light_rgb'', ''hs_color'')[0] or 0)) % 360 }}' - 100 target: entity_id: light.example_light_rgb default: [] - choose: - conditions: - condition: trigger id: shelly-example-button-a-4-long-push sequence: - service: light.turn_on data: brightness_step_pct: -5 target: entity_id: light.example_light_rgb default: [] mode: parallel
This should give you a single automation covering all the buttons and possible actions, that can be mapped by yaml or gui, however would love to turn this into a blueprint
Thanks,
Ash