Hi, i have changed the view, thank you for your help.
This is the old view:
This is new view:
There is 3 things that i need help with:
- in the old view i have set diffreent action to long press for the PC.
please look at code in lovelace for it that was in the old view:
- type: entity-button
entity: switch.desktop
icon: mdi:desktop-tower
name: PC
show_name: false
hold_action:
action: call-service
service: switch.turn_on
service_data:
entity_id: switch.wake_pc
i tried do the same thing in new view without success, this is current view for the pc in updated version, how can set that a long press will do the same thing. current code:
- type: custom:decluttering-card
template: button
variables:
- name: PC
- entity: switch.desktop
- icon: mdi:desktop-tower
- in the old view, when the fan was on, the fan was spinning , code in old view:
- type: custom:button-card
entity: fan.ceiling_fan
icon: mdi:fan
show_state: false
show_name: false
state:
- value: 'on'
spin: true
now its not, everything that i tried wasn’t working, current code:
- type: custom:decluttering-card
template: button
variables:
- name: Ceilling Fan
- entity: fan.ceiling_fan
- icon: mdi:fan
- is there a way to get the last changed state, please see below picture + config in the old view:
old view code:
- type: vertical-stack
cards:
- type: vertical-stack
cards:
- type: entities
title: Sensors
show_header_toggle: false
entities:
- entity: light.gateway_light_34ce00fa5d87
name: Xiaomi Gateway Bedroom
- entity: light.gateway_light_04cf8c9829a2
name: Xiaomi Gateway Storage Room
- entity: binary_sensor.door_window_sensor_158d0001d68618
secondary_info: last-changed
name: Front Door
- entity: binary_sensor.smoke_sensor_158d0002b223fd
secondary_info: last-changed
name: Fire Alarm
- entity: binary_sensor.motion_sensor_158d00030518db
secondary_info: last-changed
- entity: binary_sensor.motion_sensor_158d0003051953
secondary_info: last-changed
- entity: binary_sensor.motion_sensor_158d000113e40d
secondary_info: last-changed
name: Motion Sensor Living Room
- entity: binary_sensor.motion_sensor_158d0001e50fc6
secondary_info: last-changed
name: Motion Sensor Bedroom
new code :
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:card-modder
style:
border-radius: 10px
card:
type: "custom:button-card"
color_type: label-card
color: rgb(255,250,205)
aspect_ratio: 15/1
name: Sensors
styles:
name:
- font-weight: bold
- font-size: 22px
- type: horizontal-stack
cards:
# - type: custom:decluttering-card
# template: sensor
# variables:
# - name: Front Door
# - entity: binary_sensor.door_window_sensor_158d0001d68618
# - secondary_info: last-changed
# - icon: mdi:door
# - type: custom:decluttering-card
# template: sensor
# variables:
# - entity: binary_sensor.smoke_sensor_158d0002b223fd
# - secondary_info: last-changed
# - name: Fire Alarm
# - icon: mdi:shield-check
- type: custom:decluttering-card
template: sensor
variables:
- entity: binary_sensor.motion_sensor_158d00030518db
secondary_info: last-changed
- name: Master Bedroom
- icon: mdi:motion-sensor
- type: custom:decluttering-card
template: sensor
variables:
- entity: binary_sensor.motion_sensor_158d0003051953
- name: Storage Room
secondary_info: last-changed
- icon: mdi:motion-sensor
- type: custom:decluttering-card
template: sensor
variables:
- entity: binary_sensor.motion_sensor_158d000113e40d
- name: Living Room
secondary_info: last-changed
- icon: mdi:motion-sensor
- type: custom:decluttering-card
template: sensor
variables:
- entity: binary_sensor.motion_sensor_158d0001e50fc6
- name: Bedroom
secondary_info: last-changed
- icon: mdi:motion-sensor
picture:
below the decluttering_templates.yaml
button:
card:
type: 'custom:button-card'
color: auto
size: 30%
icon: '[[icon]]'
entity: '[[entity]]'
secondary_info: last-changed
aspect_ratio: 1/1
show_state: true
name: '[[name]]'
show_label: true
tap_action:
action: toggle
haptic: light
hold_action:
action: more-info
haptic: success
styles:
card:
- padding-left: 10px
- background-color: 'rgba(255,255,240,0.9)'
- border-radius: 15px
name:
- justify-self: start
- font-weight: bold
- font-size: 13px
label:
- font-size: 11px
- font-family: Helvetica
- padding: 0px 10px
- justify-self: start
state:
- font-size: 11px
- font-family: Helvetica
- padding: 1px 10px
- justify-self: start
- text-transform: capitalize
- font-weight: bold
grid:
- grid-template-areas: '"i" "n" "s" "l"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content
img_cell:
- justify-content: start
- align-items: start
state:
- value: 'on'
styles:
card:
- box-shadow: 0px 0px 3px 2px var(--paper-item-icon-active-color)
name:
- color: black
state:
- color: gray
label:
- color: red
id: on-icon
- value: 'off'
styles:
card:
- opacity: 0.3
label:
- color: 'rgba(0, 0, 0, 0.0)'
icon:
- color: black
name:
- color: black
state:
- color: black
id: off-icon
- value: unavailable
styles:
card:
- opacity: 0.2
- color: grey
- '--paper-item-icon-color': grey
label:
- color: 'rgba(0, 0, 0, 0.0)'
sensor:
card:
type: 'custom:button-card'
color: auto
size: 30%
icon: '[[icon]]'
entity: '[[entity]]'
secondary_info: last-changed
aspect_ratio: 1/1
show_state: true
name: '[[name]]'
show_label: true
tap_action:
action: more-info
haptic: success
hold_action:
action: more-info
haptic: success
styles:
card:
- padding-left: 10px
- background-color: 'rgba(255,255,240,0.9)'
- border-radius: 15px
name:
- justify-self: start
- font-weight: bold
- font-size: 13px
label:
- font-size: 11px
- font-family: Helvetica
- padding: 0px 10px
- justify-self: start
state:
- font-size: 11px
- font-family: Helvetica
- padding: 1px 10px
- justify-self: start
- text-transform: capitalize
- font-weight: bold
grid:
- grid-template-areas: '"i" "n" "s" "l"'
- grid-template-columns: 1fr
- grid-template-rows: 1fr min-content min-content
img_cell:
- justify-content: start
- align-items: start
state:
- value: 'on'
styles:
card:
- box-shadow: 0px 0px 3px 2px var(--paper-item-icon-active-color)
name:
- color: black
state:
- color: gray
label:
- color: red
id: on-icon
- value: 'off'
styles:
card:
- opacity: 0.3
label:
- color: 'rgba(0, 0, 0, 0.0)'
icon:
- color: black
name:
- color: black
state:
- color: black
id: off-icon
- value: unavailable
styles:
card:
- opacity: 0.2
- color: grey
- '--paper-item-icon-color': grey
label:
- color: 'rgba(0, 0, 0, 0.0)'
Thank you for your help!