It’ basically the same as the nice sensor card without the graph, but with a larger font for the value and 2 lines of info.
i get the more-info popup when i tap on the value, but i’d like to get it when tapping anywhee on the card, just as in the sensor card.
is that possible?
here’s the yaml code:
empty.png is an 100% background image, 704x396 pixels, and so bigger than the card.
i testedt it, and corrected the typo (double .png), but it doesn’t work anyway.
tap_action seems to work only with the value and the icon, not with the text or the image.
If you’re going to go with hellis81s method, you’d need to put the image at the bottom of the list so that it’s the top most object. You’ll also have to style it so that it fills the entire frame. You can also set the z order using css as well.
i wanna give the hellis81s method another try, because it’s less work to just add it to the otherwise working picture elements card.
now i moved the -type: image block to the end, but still not working.
but i don’t know how too style it so that it fits the whole frame.
can you give me advice?
do i still need css z-order when i put the image in yaml last?
It works fine on my floorplan.
The only difference here is that I use a condition to set the floor level to render.
But if you look at the comment below you see that I use the exact same set up and it has to be the first to not be placed above the other icons and such (unless the image is transparent)
image: local/Groundfloor_crop.png
panel: true
type: picture-elements
elements:
- conditions:
- entity: input_boolean.floor
state: 'on'
elements:
# Here is another image that is overlayed the original image with tap action none and it works fine.
- entity: input_boolean.floor
image: /local/living_room.png
state_image:
'off': /local/1Floor-crop.png
'on': /local/Groundfloor_crop.png
style:
left: 0%
top: 0%
transform: scale(1,1)
tap_action:
action: none
type: image
- entity: input_boolean.floor
style:
left: 89%
top: 2%
transform: scale(2,2)
tap_action:
action: toggle
type: state-icon
# and many more lines below here...
thank you petro, for the nice example, i already started to port to custom button card, comes in handy!
btw, the picture elements cards now works.
what i found out: the order of elements doesn’t matter. important is the z-index, and the scaling.
See my working code:
So, here is the working version based on a custom button card.
petro, from your exmaple i used the fomatting of the state display in one line.
pls note that i don’t use the normal state display, the state is shown as a custom field. this enables consistent positioning values.