After some forum searches and trial and error I have got my card looking like this. At the moment it has a switch at the top so that I can turn the lamp on/off. My goal is to not have the separate switch above the chart…
Using the tap_action I can now turn the lamp on/off by tapping the icon, now I’m trying to figure out how I can change the colour of the icon to indicate the status of the switch???
Even better would be the ability to show the actual switch in the chart like this photoshop mockup… But I don’t think that’s possible
type: custom:stack-in-card
mode: vertical
keep:
background: true
border_radius: true
margin: false
style: |
ha-card {
border-radius: 10px;
background-color: rgba(0, 100, 0, 0.2);
}
cards:
- type: entities
entities:
- switch.xiaomisocket03
- type: custom:mini-graph-card
name: Linita's Lava Lamp
icon: mdi:lava-lamp
align_icon: state
tap_action:
action: call-service
service: switch.toggle
service_data:
entity_id: switch.xiaomisocket03
smoothing: true
hours_to_show: 1
points_per_hour: 60
update_interval: 60
line_width: 2
line_color: orange
animate: true
height: 100
entities:
- sensor.xiaomisocket03_power
show:
graph: line
average: false
extrema: false
labels: false