I am trying to colour the individual hexagons according to the state of an entity in an SVG file that shows a series of hexagons. ChatGPT told me that it would work but so far I have not been able to colour any of the hexagons.
Each of the individual hexagons is assigned an ID (id=“Home”) in the SVG file:
<path
sodipodi:type="star"
style="display:inline;fill:#aaaaaa;fill-opacity:1;stroke:#ffffff;stroke-width:0.264583;stroke-opacity:1"
id="Home"
inkscape:flatsided="true"
sodipodi:sides="6"
sodipodi:cx="71.322586"
sodipodi:cy="87.290321"
sodipodi:r1="22.886408"
sodipodi:r2="30.867907"
sodipodi:arg1="1.0516502"
sodipodi:arg2="1.575249"
inkscape:rounded="0"
inkscape:randomized="0"
d="M 82.677424,107.16129 59.791243,107.05938 48.436405,87.188417 59.967748,67.419355 82.853929,67.52126 94.208767,87.392226 Z"
transform="matrix(1.2451114,0,0,1.2053189,2.6916242,-18.525053)"
inkscape:transform-center-x="-4.9310381e-06"
inkscape:highlight-color="#728db7"
inkscape:label="Home" />
Here the code of the Picture element card:
type: picture-elements
image: /local/personenstatus/Basis02.svg
title: ''
style: |
ha-card { height: 400px wide: 400px !important; }
elements:
- type: image
entity: input_select.haus
template: |
if (states['input_select.haus'].state === 'Zuhause') {
return `
Home {
fill: #008000;
}
`;
} else {
return `
Home {
fill: #ffffff;
}
`;
}
Can that even work? If so, what am I doing wrong here?