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
- 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
Alles anzeigen
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