so i have custom card colors 3 colors
on off and unavailable
im using TPlink switchs and plugs
im finding it will change Blue for Else as long as the device is on or off but not unavailable…
now if i have a device thats unavaliable its supposed to turn Blue… but it doesnt it defaults to green.
but it will work if i change off to offf and then it turns blue… if its detectable…
is there something else i need to configure… or is it a bug or a glitch or something
nope wasnt typo i did that on purpose like i said
guess my dyslexia didnt explain it right
i stated Available AKA ON/OFF items work fine for Color reason u think its a typo it shows it as Unavailable so turns blue
i stated the the glich a bug etc or i need extra code
when an Actual Device is Actually Unavailable… as you can see Outdoor Plug 1 2 and Sauna Pump
are physically Unavailable… not Faked… you can see They are GREEN… not BLUE like they are supposed to be
so i wanted to know how do i fix it so it actually works… is there another Code to add in there.
as it Only works IF you fake a “unavailable” state it Should be
yellow = On
green = off
Blue = unavailable
but you can see it doesnt work… it only works when the Device is actually connected and you just fake the “other” or “unavailable” by changing “off” to “offf”
but when you actually unplug a Wifi Plug and let it goto “unavailable” state then it goes to green … and it goes green not by “off” i cant change it… so green over write s the Blue color
is there another card color statement i need to add to force it to stay blue since {% else %} does nothing it gets over written
you can see i also tried to do “unavailable” as red and it still forces it as green
i dont know anything about this stuff… you guys are smarter then me…
i just try and get stuck and try to get help on here i still new at this stuff been using it since christmas and i still cant wrap my head around this stuff… so you know more then me… i cant even figure how to fix my remote_rpi_gpio or figure out this node red people talk about how is greater…
so i dont even understand templates 100% i still learning
sorry about that… i just noticed i couldnt get the blue state to work
i know i can get blue on a button-card? this works blue if it goes off line but the other one doesnt
i struggle trying to figure this stuff out… i havent got a hang on it yet… i still working
and my dislexia doesnt help. and learning disability… as the docs dont help me with my issues or i dont see it in there what i looking for so i get confused…
one day ill be smart like you guys
but ya i dunno i figure the code i got help from a different user needed extra code if it actually goes offline
i been trying to trouble shoot and go through HA docs and see what i did wrong …
Go to the card-mod github page and look at the templating examples in the documentation. From a quick search here on the forum it does appear to use JavaScript instead of jinja.
ok i think i doing something wrong? and i dont know what jinja is nore how to tell between it and js…
so trying to follow the examples i do those before but didnt work… maybe you can tell me what i doing wrong
i tried this way but didnt work
what i doing wrong?
from there website it says
" NOTE: card-mod only works on cards that contain a ha-card element. This includes almost every card which can be seen , but not e.g. conditional , entity_filter , vertical-stack , horizontal-stack , grid ."
does that mean it cant do conditional? like on off unavailable is that why its it cant detect unavailiable? or how should the code be written…
i just trial and error copying in different places in the if statements
as i dont 100% understand it… so i just guessing
@tom_l i couldnt find info from the page
i posted a bug but i really cant tell if its a bug or not nore if they help me since apparently that home assistant card mod page isnt a help page for card mod for home assistant.
so i not sure how to fix this… as i stuck in middle…
between is it a bug who can help me and if this is a javascript then how do i convert this code to javascript from jinja
i no better and more frustrated i tell ya lol take a break from it
It is not a bug. You are using jinja templates in card-mod and it only accepts JavaScript templates.
I can’t teach you javascript, as I barely scrape by using the available documentation, which I do not currently have access to. All I can suggest is that you search the forum and Google for help with JavaScript. Or wait patently and someone else may be able to help.