HI, Since we had a Pm discussion, I take it you are addressing this to me ?
Not really sure what you mean by casting all the code into configuration.yaml, but that is not what you should do…
Also which notifications are you talking about?
just so we are clear on the code (it has been renewed because of the move from Tiles to Button custom card (which you need to have installed as resources for Lovelace)) Ill repost it here:
the Lovelace setup (so this is not intended to go into the configuration.yaml…):
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
template: horizontal-filler
- type: 'custom:button-card'
name: Set Hue scene
template: button_default_title_fixed
- type: custom:button-card
template: horizontal-filler
- type: horizontal-stack
cards:
- type: custom:button-card
template: horizontal-filler
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: 'Arctische dageraad'
- entity_picture: '/local/hue_scenes/arctic.png'
- name: Arctic
- color: '#00d0a0'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Savanne zonsondergang
- entity_picture: '/local/hue_scenes/savanna.png'
- name: Savanna
- color: '#ff7935'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Tropische schemering
- entity_picture: '/local/hue_scenes/tropical.png'
- name: Tropic
- color: '#a03aa3'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Lentebloesem
- entity_picture: '/local/hue_scenes/spring.png'
- name: Spring
- color: '#ba496c'
- type: custom:button-card
template: horizontal-filler
- type: horizontal-stack
cards:
- type: custom:button-card
template: horizontal-filler
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Ontspannen
- entity_picture: '/local/hue_scenes/relax.png'
- name: Relax
- color: '#ffc059'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Lezen
- entity_picture: '/local/hue_scenes/lezen.png'
- name: Read
- color: '#fdfb9f'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Concentreren
- entity_picture: '/local/hue_scenes/concentrate.png'
- name: Concentr
- color: '#a2eaf2'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Energie
- entity_picture: '/local/hue_scenes/energize.png'
- name: Energy
- color: '#a8dfed'
- type: custom:button-card
template: horizontal-filler
- type: horizontal-stack
cards:
- type: custom:button-card
template: horizontal-filler
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Helder
- entity_picture: '/local/hue_scenes/clear.png'
- name: Clear
- color: '#fcdb97'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Gedimd
- entity_picture: '/local/hue_scenes/dimmed.png'
- name: Dimmed
- color: '#8c642b'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: Nachtlampje
- entity_picture: '/local/hue_scenes/nightlight.png'
- name: Night
- color: '#814346'
- type: custom:decluttering-card
template: set_hue_scene
variables:
- option: 'Off'
- entity_picture: '/local/hue_scenes/off.png'
- name: 'Off'
- color: 'lightgrey'
- type: custom:button-card
template: horizontal-filler
# - type: custom:button-card
# template: horizontal-divider-grey
- type: horizontal-stack
cards:
- type: custom:button-card
template: horizontal-filler
- type: entities
show_header_toggle: false
entities:
- input_select.hue_groups
- script.set_hue_scene
- type: custom:button-card
template: horizontal-filler
- type: custom:button-card
template: vertical-filler
and the decluttering template set_hue_scene
:
card:
type: custom:button-card
template: button_picture_script_small
entity_picture: '[[entity_picture]]'
name: '[[name]]'
tap_action:
action: call-service
service: script.tiles_set_hue_scene
service_data:
option: '[[option]]'
state:
- operator: template
value: >
[[[
return states['input_select.hue_scenes'].state == '[[option]]'
]]]
color: '[[color]]'
styles:
name:
- color: '#555B65'
and, the button_picture_script_small button card template:
button_picture_script_small:
size: 70%
show_state: false
show_label: false
show_name: true
show_entity_picture: true
color_type: card
aspect_ratio: 1/1
tap_action:
action: none
haptic: light
hold_action:
action: more-info
haptic: success
color: '#555B65'
styles:
name:
- padding-left: 3px
- font-weight: bold
- font-family: Helvetica
- font-size: 13px
- color: 'lightgrey'
now this of course also expects some Homeassistant backend code I am afraid…
script:
set_hue_scene:
alias: 'Set Hue scene'
sequence:
service: hue.hue_activate_scene
data_template:
group_name: >
{{ states('input_select.hue_groups')}}
scene_name: >
{{ states('input_select.hue_scenes')}}
tiles_set_hue_scene:
alias: 'Tiles set Hue scene'
sequence:
service: input_select.select_option
entity_id: input_select.hue_scenes
data_template:
option: >
{{ option }}
and the input_selects which need the exact names as in the Hue system, in my setting:
input_select:
hue_scenes:
name: Select Hue Scenes
icon: mdi:creation #palette
options:
- Arctische dageraad
- Savanne zonsondergang
- Tropische schemering
- Lentebloesem
- Concentreren
- Gedimd
- Energie
- Helder
- Lezen
- Nachtlampje
- Ontspannen
- 'Off'
initial: Ontspannen
hue_groups:
name: Select Hue Group
icon: mdi:group
options:
- Buffet
- Dining table
- Living
- Living ceiling 1 Cds
- Living ceiling 2 Terrace
- Living ceiling 3 Wall
- Living ceiling 4 Sofa
- Hall
- Corridor
- Master bedroom
- Mobile
for the groups you just select your own named groups like the above.
Also, you’ll need the pictures, let me know if you have these.