dawnlord
(Christer)
October 15, 2018, 8:30am
1
I have also added motion sensors but they never change color.
- type: state-icon
icon: mdi:google-home
entity: sensor.kitchen_motion_sensor
style:
top: 43%
left: 34%
"--paper-item-icon-color": rgb(89, 89, 89)
"--paper-item-icon-active-color": yellow brightness(130%) saturate(1.5) drop-shadow(0px 0px 10px black)
dawnlord
(Christer)
October 15, 2018, 3:16pm
2
Feels like i have tried everything now…
(probably not :P)
Isablend
(Robin)
October 15, 2018, 3:31pm
3
Try this;
I’ve been playing with a small form of icon colour depending upon state. I use it with icons to show movement and door opening state being returned from my alarm system. Each alarm sensor as you know returns a value ‘T’ for triggered state and ‘-’ when in a non-triggered state.
I have defined binary_sensors, like this;
- platform: template
sensors:
office_movement:
device_class: motion
value_template: "{{ is_state('sensor.visonic_z07', 'T') }}"
front_door:
device_class: door
value_template: "{{ is_state('sensor.visonic_z01', 'T') }}"
which means that I can then place sensors on picture-elements cards to show the entity icon only, using
- type: state-icon
tap_action: more-info
entity: binary_sensor.office_movement
style:
top: 89%
left: 53%
vs
or onto entity cards for the full status
- type: entities
entities:
- entity: binary_sensor.hallway_movement
name: Hallway Movement
secondary_info: last-changed
- entity: binary_sensor.kitchen_movement
name: Kitchen Movement
secondary_info: last-changed
- entity: binary_sensor.office_movement
name: Office Movement
secondary_info: last-changed
vs
1 Like
JTPublic
(JT)
October 15, 2018, 3:51pm
4
I agree with @isablend , the paper-item-icon-active-color seems to only work with binary_sensor, try convert kitchen_motion_sensor into binary_sensor.
1 Like
Isablend
(Robin)
October 15, 2018, 3:58pm
5
It’s worth stating that with a binary_sensor you can set the ‘un-triggered’ state icon colour,
- type: state-icon
tap_action: more-info
entity: binary_sensor.office_movement
style:
top: 89%
left: 53%
"--paper-item-icon-color": green
but that the ‘triggered’ state is ‘yellow’.
1 Like
dawnlord
(Christer)
October 15, 2018, 4:30pm
6
Thank you guys it worked.
- platform: template
sensors:
kitchen_movement:
device_class: motion
value_template: "{{ is_state('sensor.hallway_presence', 'True') }}"
hallway_movement:
device_class: motion
value_template: "{{ is_state('sensor.kitchen_presence', 'True') }}"
- type: state-icon
icon: mdi:google-home
entity: binary_sensor.hallway_movement
style:
top: 30%
left: 55%
"--paper-item-icon-color": rgb(89, 89, 89)
"--paper-item-icon-active-color": yellow brightness(130%) saturate(1.5) drop-shadow(0px 0px 10px black)
- type: state-icon
icon: mdi:google-home
entity: binary_sensor.kitchen_movement
style:
top: 43%
left: 34%
"--paper-item-icon-color": rgb(89, 89, 89)
"--paper-item-icon-active-color": yellow brightness(130%) saturate(1.5) drop-shadow(0px 0px 10px black)