Hello community ! I need some help to understand the grid stuff and how to position my cards inside the different areas…
Here is the challenge:
I need a button-card for the irrigation of my garden that is using a controller that communicates in Modbus with HA. Each zone has different purposes in the layout:
a control command to select the zone (switch) by clicking on an icon
a status telling if the zone is selected for next irrigation (binary_sensor)
a status telling if irrigation is currently in progress or in idle mode (binary_sensor)
a timer information (sensor) that decrements during the irrigation period (sensor is polled by HA every 15 seconds)
When irrigation is in progress on a particular zone, I expect a red border blinking around the card, together with the remaining time.
not exactly sure where in the button-card configs, maybe in the templates, I didnt take the time yet to find out. Since I am fully reliant on button-card for my dashboard, it took me 1 minute to decide to roll back to 2023.3.6
You mean for decluttering card? Can you tell more? I replaced above in .js file, restarted HA but i still have errors, so i clearly missed a step…
EDIT: it’s not that simple with buton-card either… removing “state” causes card to show correctly, but removes any condition check (it’s always false).
yes there more to it than that. You need to ‘tell’ HA to use the new resource. If you’re in yaml mode that is easy, just change the number in the resources.yaml and reload resources.
if there is a .gz file (HACS thingy) then you need to repack modified .js into it (or delete .gz file completely)
you need to change the url of modules in Resources. I just appended &patch=2023.03.30 to urls.
(HA is using cache storage api, a bit “stronger” then standard browser cache)
Hm…i’m dumb…can’t make it work… i have a second option (HACS):
i found and replaced that in www/community/button-card/button-card.js
i deleted .gz file
here i’m stuck…if i go to resources, “button-card” has url : “/hacsfiles/button-card/button-card.js” . if i change that into : “/hacsfiles/button-card/button-card.js&patch=2023.03.30” HA says button-card not found. I’m not a programmer, but i kinda don’t understand why i should change that entry since i didn’t change button-card.js name… i just altered a piece of program…or ?
you can however add the edited file to another folder I your www, and point to that in the resources dialog?
/config/lovelace/resources and add the new resource
that error doesn’t make sense, that means the ‘state machine’ is loaded (because there’s no error on states) but it can’t find that single state, which in general is not possible… Are you sure you have a correct entity_id in that js template?
that erorr was only a part of it… if i removed “.state” from template definitions it was gone, but then templates stop working…
but, now i restored my test HA with my production image (i never do testing on my live HA!). Then i only replaced above “querySelector” line in existing button-card.js with new content. Lastly i updated to 2023.4b and now it seems that button-card works! So, it was obviously “something” on my test HA… sorry for that, guys!
Only error remains for decluttering card:
(EDIT: was just solved on github…)
FYI: some formatting was lost when coping text.
The first revison was striked out as it would make it compatible with beta
The second one works with stable as well.
Also some cards had already been updated by their own devs to work.
EDIT: beta4 has changed things again. mwc-drawer is dead, long live ha-drawer
The code above has been updated to address that.
do you by any chance also use Kiosk-mode? we can not apply the same fix there, but I did try to replace app-drawer-layout by mwc-drawer I the resource. No such luck though, seems more is required there.
Nah.
But same quick patch won’t work with all the cards (including Swipe Navigation) as there are more changes in frontend. It doesn’t look like a one liner fix and I’ll leave it to dev - since @NemesisREhe is active it will likely be fixed before stable release.
As you can see, additionally i am struggeling to remove the Border of the embedded Card. Because i already used some Card-Mod to remove Text from the Card, the Example Code from the Docs doesn’t work. I will take care of that Problem, after the Placement-Issue with Card-Mod is solved.
Just mentioning, if this is an easy-peasy-Thing, i’d be even happier
But my Main Problem right now is Controlling the Order / Layering of Elements.
Would be awesome if you know the magic Line i couldn’t find!