#frontend-archived
1 messages · Page 18 of 1
But it looks like the card_mod might be wrong for the switch entity you shows. You have two ha-cards defined.
Is anybody aware of a card that shows sensor data history in a table? I'd just like to see a raw (ish) list of values.
I haven't seen one which makes me think I'm missing something important.
Is it possible to fade between Icons on state change with a custom button card
Hello, I'm new to Home Assistant. Does anyone know what I need to do to get a battery status in the top corner of a mushroom card?
It would be nice to see the latest state directly in the entities list. Any option to this?
Could you elaborate a bit? What is the "entities list"?
I've removed the 2nd 'ha-cards' and I tried the code you mentioned however that didn't work.
Really strange but I've tried so many things and I can't get it to change. Usually icon color changes are so simple
Looking for help to clean this up
You may not be getting optimal performance out of card-mod. See https://github.com/thomasloven/lovelace-card-mod#performance-improvements
I have this in my config however it still give the error. I got the path from when installin with HACS that is what pops up
frontend: themes: !include_dir_merge_named themes extra_module_url: - /config/www/community/lovelace-card-mod/card-mod.js
What am I missing
I've just upgraded and my dashboards all look like this in firefox - perfectly fine in chrome. I've cleared cache etc.. no errors in console
For the switch chip, try changing the type from light to template. ```yaml
type: custom:mushroom-chips-card
chips:
- type: template
entity: input_boolean.guest_mode
content: Guest Mode
icon: mdi:home
icon_color: |
{{ (states(entity)=="on") | iif("green", "red") }}
press_action:
action: toggle```
For the rotation animation, try this yaml card_mod: style: mushroom-shape-icon$: | ha-icon { --icon-animation: rotation 2s linear infinite } @keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
Holy lovelace rage... trying to get my cards arranged/lined up and the word wrap type behavior is driving me nuts
is there a way to drag/drop tiles or a nice clean replacement
not looking to rebuild all of my dashboards
Hi All, need help installing button-card or any other custom cards
Can't find a guide that isn't obsolete
Is it still a thing, or deprecated?
IMO, layout is one of the harder things to get to work properly with custom dashboards, particularily with tablet dashboard design. I use a combination of horizontal-stack, vertical-stack, grid, and custom:layout-card cards. I sometimes use custom:gap-card for spacing. I also use card_mod with position, top, left, and z-index settings for placement.
Install HACS. Way easier than trying to install custom cards manually. https://hacs.xyz/docs/setup/download/
Ok. Did that. button-card not found in hacs
That was the issue! Thanks! When making a group of preset buttons (stations, brightness, volume, etc.) Is there an easier way than making a seprate button manually for each preset level? Right now, I have several buttons in a horizontal group, but re-using the group with anothe rentity requires manually editing each button, rather than copying the group & somehow saying "this is for light #2"
Wanting to make a volume control for each room with presets for soft/med/loud/off
Or do I need to do it as a single custom button & start writing code?
I guess I mean a custom card
Custom Button Card templating. Basically, make a button the way you want. Take that code and drop it in the Raw Editor. And subsequent buttons can refer to the template. Settings applied to the individual button will override the template. https://github.com/custom-cards/button-card#templates-support
- type: custom:button-card
template: generic_custom_button
entity: light.living_room1
icon: mdi:lamp
- type: custom:button-card
template: generic_custom_button
entity: light.living_room2
icon: mdi:lamp
- type: custom:button-card
template: generic_custom_button
entity: light.kitchen
icon: mdi:ceiling-light-outline
hold_action:
action: navigate
navigation_path: /fire-main/kitchen```
My generic_custom_button template is 32 lines long.
I'll give it a look. I just downloaded HA a few days ago. Learning curve is steep, even for a 40-year programmer.
When you start getting "fancier" with the templates, you can incorporate variables to cut down on the repeated code.
What are these custom cards written in? Looks like VMicrosoft isual Studio projects and typescript? I though HA was python.
I'm 43 with no real programming experience. Dabbled in BASIC, Pascal, and VisualBasic for Applications in high school. Been working with HA for about two years now. Have a very basic but working knowledge of Python and JavaScript now (because of the dashbboards and automating in Node-RED).
Cards are commonly written in JavaScript, TypeScript and, I think, Python/Jinja.
Thanks for the help! I'll be back after playing with the custom button cards!
Between custom:button-cards and Mushroom cards, you can do just about anything you want to design for your dashboard. It is just a matter of getting it to work. My dashboard's YAML if you want to browse: https://pastebin.com/gaFmay1B
Making my first card. This apparently breaks the card. Guessing there is no error log to get hints from.
styles:
card:
- background-color: |
[[[ if (media_player.living_room.volume_level == 0.4) return "red" ;
else return "green"; ]]]
The comparison part apparently breaks the whole card
Is there such thing as a debugger or language reference, or is it just learn by example with this stuff?
That doesn't look like it follows any proper format
You have to review the docs for the card you're using. They either use JavaScript, both of which have ample documentation
Can I update the css for cards in the yaml? If not, where?
Look into card_mod
hey RobC - do you know if the "manage resources" resources has been removed intentionally from the lovelace raw config editor????
It was never there
errrr......three dots
-> Dashboards
Never been there
2023.5.4 is under 3 dots
also under dashboards in settings previously
now not in either
Hmm, I've never seen it there. It's there in 6.0
youre seeing it in 6.0???
Yes
mine is missing
In
in both places
That too
sorry for being a dumbass
I never saw it in the dashboard itself. It I do it all in YAML
am tracking down my ongoing database issue and have installed on bare metal rather than in a VM and am re-instigating line by line everything to see what seems to be breaking the database
so a brand new installation this morn, have gotten all the template entities installed (about 300 of them) and am now doing the dashboards, and I use css for the font styling but couldnt find the three dots to specify the stylesheet stuff
May I ask where do you store the template? I need to start using template because i have a card that's using like 30 lines of codes for like 10 times
This worked! Changing it to template done it! Thank you so much!
Why do you suggest using this? Is there anything wrong with the code already in place for the rotation animation?
Any one can help how I can add text divider on my dashboard?
Has anyone noticed with 2023.6 browser mod popups title size has shrunk dramatically? I can't seem to find what to use for the style to fix that
Hi, does anyone know where I can find animated parts to create a widget to view power consumption? Loading from solar, etc., I need to find individual elements such as solar, workshop, animated arrows, etc
I plan to create my widget using picture elements
And I plan to do something such that when I click on, for example, solar, the tile changes and I see its graph, maybe in this picture elements I can add a solar charging graph as a photo?
Update the custom cards in HACS
I can't
Minimalist updated to version 1.3.5?
I think there is an issue with HACS with the new HA update, I can't click on the update button
well that blows I can't restore to the previous verison
It looks like you kept your stuff significantly out of date..
What language docs apply to the custom button card? I see lots of bracket characters in the usage examples. Is yaml the markup language used? If so, when can I find a reference or grammar?
Everything is documented on the respective github page
I don’t think that helped at all. I downloaded ha a week ago. How do I find this page?
In general Home Assistant uses yaml to set all manual configurations, custom button card can use additional JavaScript within [[[]]]
Ok. Where is there a reference for yaml? It seems that indents follow rules, where can I read about the rules?
Oh, it really is YAML. The parser definition language from 30 years ago. Thought it was something the authors made up.
🤦♂️
So, the many brackets are escape characters and everything inside is JavaScript? Is some variation of JavaScript?
Just plain JavaScript with some additional helpers to access HA items, those are explained in the JavaScript templates section of the documentation
The custom:button-card templates go in the Raw Configuration Editor. Click the 3 dots
in the top right corner > Edit Dashboard > 3 dots again > Raw Configuration Editor
Put your templates (generally) towards the top, before views:. You'll start the section like so: yaml button_card_templates: name_of_the_template: ...all your template data here... ...just like you used in your dashboard... ...you can even include entities, names, whatever ...even if it is going to be customized with each button....You can look at my dashboard's YAML at https://pastebin.com/gaFmay1B
The above code can be found starting at Line 62.
Here's an example for usage```yaml
- type: custom:button-card
template: generic_custom_button
entity: light.living_room1
icon: mdi:lamp```Even though the template has an entity and icon defined, because they're added here, these will override the template's data for those items. (Line 1487)
Tip: A template can even reference another template. (Line 127)
When I put your code into my example, it causes the entire card to spin rather than just the icon (because you have it in the ha-card section. (It is kind of trippy though...)
I have a type: entities card with several switches and things with secondary_info: last-changed. Right after that is clicked, it will often show a value like "In 13 seconds", for a few seconds. Is there any way to get the front-end and back-end synched better?
You really, really need to read the documentation for whatever you're using. If it's a built-in card, none use JavaScript and one or two support Jinja. Custom cards gave their own documentation.
HA likes to pass numbers as strings. You need to parseInt or parseFloat before a comparison. (Other cards may need the value piped into int or float ( | int or | float)
type: custom:button-card
entity: sensor.bedroom_temperature
name: '[[[ return parseFloat(entity.state).toFixed(1) + "°F" ]]]'```(In this case, I could have just left it as a string because I'm only using the value as the name but I also wanted it fixed to one decimal.)
- type: custom:mushroom-template-card
entity: sensor.s22_ultra_battery_level
primary: S22
secondary: '{{ states(entity) }} {{ state_attr(entity, "unit_of_measurement") }}'
icon: |
{% set state = (states(entity) | int) %}
{% if state >= 75 %} mdi:battery-90
{% elif state >= 33 %} mdi:battery-40
{% else %} mdi:battery-10
{% endif %}```
Ok. No argument. Just can’t figure out what docs to read, as it looks like my yaml must contain some combination of yaml, JavaScript, python, something called jinja, html, css, and various functions. I’m trying to avoid learn-by-example. I found a solution to my earlier question by looking at other examples. Apparently, you have to wrap a function around some things and not others to reference them. For example: The docs for custom button card have an example that says to use entity.attributes.volume_level in an IF statement. I learned yesterday that it’s flat-out incorrect. In reality, you have to use states[‘media_player.xyz’].attributes.volume_level. So, I guess my questions are as follows: What language is the stuff in brackets? Is it jinja? Where is a list of these functions like states, rgb, is_state, etc? That seems to be my main struggle as a noob. Being frustrated that the examples in the docs don’t work & not knowing what reference I need to go to. I guess “sensor” in the docs is just a placeholder & not used literally, you are expected to know to put a function there.
Again, read the docs first the thing you're using. Are you actually trying to configure a card?
Your questions are far too general to be answered
He's learning to work with the custom:button-card.
You're just going to get incomplete answers that will beget more questions and confusion
Alright. There are many, many examples of the JavaScript that it uses in the docs for the card
And the fact that it's JavaScript
It's the 'I don't know what docs to look at' part that I'm confused about. The docs for the card
Ok. So, the docs for the card show an example using an if-then for a style. The example shows using entity.xyz, which obviously doesn’t work. Are the docs just out of date?
Honestly, he's trying to learn everything all at once and in a short period of time. Frontend and HA, in general. Jumping straight into one of the most configurable cards, but still a bunch to grasp.
@inland token Check out this post. Lots of good information. 5 years worth of information. 6774 posts and still active. I learned a lot from here. https://community.home-assistant.io/t/lovelace-button-card/65981
I just kind of breezed through looking at pictures until something caught my eye and then looking to see if there was discussion/code on how it was accomplished. Plus, just looking at random code gave me a better understanding.
Okay, perfect example. These docs tell me that I can set the style of the button with the style attribute. Easy to understand. How do I get from there to the code in whatever language it is in triple-brackets? What do a do I go to for that part? Looks like a variant of JavaScript with some added functions.
I’m just looking for the character-escaping rules, language docs, and ha-specific function docs
That part seems to be learn by example so far
Are you asking how do you actually enter the code into the card?
No, asking what docs/references to read to learn the syntax of the code, escaping rules, and ha-specific build-in functions
Honestly, never looked that hard into it. Majority of my information has come for the card's Github and the examples provided there and the examples and discussion in the forum link posted above. But, there's always the Developers area that might be more for what you're looking for. https://developers.home-assistant.io/docs/frontend
But, I don't think that information is really needed for 95% of the people that participate in this room.
Additionally, as you start dealing with more custom cards, you'll learn that most cards handle things differently. What works in one card may not necessarily work in another card. But, the concepts can, generally, be adapted.
You’re probably right. When I see these functions in the code, I wonder what other functions exist that might be useful.
Really just understanding how the card gets the state and/or attributes for an entity is the most important thing. Such as, ```yaml
- type: custom:button-card
entity: light.living_room1
name: '[[[ return entity.attributes.brightness]]]'
show_icon: false``````yaml - type: custom:button-card
entity: light.living_room1
name: >-
[[[ if (entity.state === "on") return "Yup"; if (entity.state === "off") return "Nope"; else return "Dunno"]]]
show_icon: false```
i just added my ft3 water sensor to the energy dashboard and its charted in gal. is that expected?
only place I see it mentioned is a comment on discord but didn't see any response to it
Thank you for this. I will look into it tonight after work
Very strange haha! Mine doesn't do that so I guess I'll leave it as is
After updating to the latest HA version, has anyone else seen their media control bar on the bottom of the HA media page go invisible... and then just spin circles when operating? It's still playing music, but no way to control anything other than just playing or stopping the play button on the playlist?
I've tried restoring to an earlier backup before this went away, which brought it back visible, but then something might have auto-updated and it happened again. What's strange is that it DOES show up on an older iMac running Chrome in an earlier version of MacOS but not on this M2 MacBook Pro in Chrome or Safari. I just refreshed the browser page on that iMac and the whole media bar went away as well.
Ok guys I messed up bad, I accidentally overwrote my raw config editor on my dashboard. There seems like there's no way to undo it.
Is my only option to restore from backup?
Might not need to do a full restore, I imagine the yaml is just stored inside the backup. You could just unpack it and copy your old yaml back.
I'll try this right now!
@vast crane Would that version of yaml be in a partial backup?
Or only full backup?
don't know, I'm not really a backups expert
I'd just unpack it and sniff around for what you can find.
Ok I've managed to do this however the yaml doesn't seem to reflect on the actual dashboard. Maybe I should try reboot my HA instance.
Reboot did the trick! Many thanks!
thanks again for the instructions and examples. I got template to work. 🙂
Is there a way to remove the background of mushroom chips card?
card_mod:
style: |
mushroom-chips-card {
--ha-card-background: none;}
that works within a custom:mod-card
I was refered to this channel because i have a problem with traefik + HASS reverse DNS. Is this the right channel to ask my question? 🙂
@light nimbus I converted your message into a file since it's above 15 lines :+1:
Use --chip-background: none;. Here's one of my experiments with an entity chip.yaml type: entity entity: person.derek use_entity_picture: true card_mod: style: | ha-card { border: unset; --chip-box-shadow: none; --chip-background: none; --chip-font-size: 24px; --chip-padding: 0 0.3em; --text-color: red; --chip-height: 75px; --chip-border-radius: 45px; }
Looking for help to clean this up
See https://github.com/thomasloven/lovelace-card-mod#performance-improvements ```
I have this in my config however it still give the error. I got the path from when installin with HACS that is what pops up
```frontend:
themes: !include_dir_merge_named themes
extra_module_url:
- /config/www/community/lovelace-card-mod/card-mod.js ```
What am I missing
how can i make a theme be defaultly enabled
Thx, ive made it with the custom:mod-card that you showed me some weeks ago, worked great!
Hi, is there an add-on that adds the ability to add text? Eg title, unfortunately the mushroom title card does not have the option to change the font color...
Evening, finally giving up on the motion sensor myself, so seeking some advice 😄
i just want a list of all my sensors that have binary.motion or wat ever it is and get the sensors dynmiacally. Saves me time adding each sensor individualy,
count them, and display the number within a card..
i have NEARLY figured out , fancied doing it in node red so i can see the nodes and do a bit of coding within the node too.
i also want a timer too . so if "motion" is detected , start a 10 second timer and if motion is detected within 10 seconds the timer resets, after the 10 seconds of no motion then the state would be clear and then the count drops
Is anyone else having this issue?
Hi, I have the Home Assistant 2023.6.1 version and it works well...
That last item is just going to depend on the Detection Interval of your sensor device(s).
if the motion is detected and the state of the sensor is " detected" then the card updates with 1/5 for example but the sensor might change back to "clear" but the card wouldnt update until the 10 second timer expires, if the motion goes back to detected then the timer would reset. this means that it would never go bac kto clear unless the timer hits 0
icon:
- animation: |
[[[ if (states['fan.levoit_131s_air_purifier'].state == 'on')
return 'rotating 1s linear infinite';
]]]
- color: >
[[[ if (states['fan.levoit_131s_air_purifier'].state == 'on') return
'rgb(198,236,122)';
else return 'rgb(211,211,211)';
]]]
Gents, I know how to use custom_fields to merge these two codes together to make things more streamlined, but is there a way to merge them without using custom_fields? Thanks
Right but most motion sensors aren't constantly looking for motion, they have a detection interval, that's like a cooldown. Sensor detects motion, then it waits for a period of time before it checks for motion again. That can be anything from 30 seconds to minutes.
this probably works
- animation: >
[[[ let icon = this.shadowRoot.querySelector("#icon")
?.shadowRoot.querySelector("ha-svg-icon");
if (states['fan.levoit_131s_air_purifier']?.state == 'off' ) {
icon ? icon.style.color = 'rgb(198,236,122)' : ''
return 'rotating 1s linear infinite'
}
else icon ? icon.style.color = 'rgb(211,211,211)' : '' ]]]
Thanks. I will try and report back later.
is there a way to only show the label if state is on
Hi, I can't manage to get an answer to my question : https://community.home-assistant.io/t/ha-sidebar-reverse-proxy-and-authelia-how-to-keep-services-secure-and-still-be-able-to-access-them-from-ha/576941
In short, I am using container HA (I have to for my setup), and I'm trying to reproduce what addons do. But I can't see how to get it done with reverse proxying
I have to reverse proxy them with https BUT I also have to secure access if not done by HA
Hi, do the recently added feature from 2023.6.0 (Added to the entity dialog: last changed) working with all devices/entities ?
for me I cant toggle to switch to relative time format (only see the absolute time). even with browser cache cleared...
Consider using the Markdown card. It is quite customizable, provided you're willing to dabble in a little bit of card_mod. Screenshot shows two examples of the Markdown card. The first one is only two lines. The second one... well, that one is about 45 lines long.
The Musroom Template Card is also usable but again, card_mod is useful. yaml type: custom:mushroom-template-card primary: Hello, {{ user }} ! secondary: '{{ states("sensor.time") }}' card_mod: style: | :host { --primary-text-color: red; --secondary-text-color: red; --ha-card-background: transparent; --ha-card-border-width: 0; text-align: center; --card-primary-font-size: 26px !important; --card-secondary-font-size: 18px !important; }
yes, it does work. Thanks 絶望
Could someone explain to me how to use the navigate card with UI minimalist? I'm trying add a navigate card on my bedroom page, bedroom.yaml, to a separate page that controls the TV, bedroom_remote.yaml. Setting the navigate path to the bedroom remote page takes me right back to the home.yaml page I have setup. Any suggestions
tap_action:
action: navigate
navigation_path: /lovelace-your-page-name
Oh wait nevermind ui minimalist uses different options for that card
https://ui-lovelace-minimalist.github.io/UI/usage/cards/card_navigate/
similar usage though, it just takes out the need for tap_action and puts all that under variables:
Lovelance banner 🙂 How do I change the text color in the heading
'''type: custom:banner-card
row_size: 3
background: '#B0C2ED'
heading:
- 🚿
- Bathroom
link: /lovelace/living_room
entities: - entity: sensor.wavin_temp_badevaerelse_sovevaerelse
name: Temp - entity: binary_sensor.badevaerelse_sovevaerelse_microphone
name: Temp - entity: light.badevaerelse
name: Light
I'll keep trying. Thanks!
It should just be a matter of getting the syntax right
Use color: red, for example, as mentioned in the docs. ```yaml
type: custom:banner-card
row_size: 3
background: '#B0C2ED'
heading: Bathroom
color: red
link: /lovelace/living_room
entities:
- entity: sensor.living_room_door_temperature
name: Temp```
Im still new to HA. I cant figure out why my cards are just vertically centered in the middle of the page. Can someone please shed some light?
any way to make sensor card display a certain number of decimal places?
Do you have your view type set to vertical? I use Panel (1 card) with lots of horizontal, vertical, layout and grid cards.
I've been using HA for a years, and just put up with not understanding layouts, until this week, now I'm learning it finally.
this is the default
oh ok
i figured out
thanks a lot for pointing me to the right direction
i changed to view type to Horizontal
i started about a month ago... i have no I.T. / programming background. very steep learning curve
Lots of people here can help you, if you have the right attitude.
I have 30+ years of computers/IT, but was never a frontend guy
You may still have an issue where, as you add more cards, they'll scroll to the side. May not be what you're looking for. Consider Panel layout if that happens.
thanks for the heads up.. but I only see "Panel (1 card)" option
I find it easiest to use either panel or sidebar, and put in vertical or horizontal "blocks" into it, and the cards in there...
for example
Yeah. That's the one. Needs a bit more "help" with layout configuration but, IMO, worth it.
ok, i think it's still early on that front since i'm still trying to learn how to setup the cards i want
maybe once I have all the cards I want setup, then I will revert back to fix the dashboard. Especially, I use HA on my cellphone a lot, so I'm not too sure how one dashboard resolution can coexist between desktop and a small cellphone screen
this is very nice
You can go into code-edit mode to get the yaml, then cut/paste it between dashboards/views.
That way you can play in an experimental dashboard, not not f**k up your real one
i see i see. thanks for the suggestion and I will keep that in mind. HA is gonna be a long project for me
Good luck, and have fun!
thank you
The sensor card may not have the flexibility to display the numbers how you want to see them. You might consider making a template sensor to show the value how you want. For example, ```yaml
sensor:
- platform: template
sensors:
entry_temperature:
friendly_name: "Entry temperature"
unit_of_measurement: '°C'
value_template: "{{ states('sensor.entry_motion_sensor_temperature')|int }}"
will create a sensor but show only whole numbers. This one rounds to 5 decimal places.yaml
template: - sensor:
- name: Daily Miles Utility
state: "{{ states('input_number.daily_miles_utility') | float(0) | round(5) }}"```
- name: Daily Miles Utility
Using a different card might allow you to simply format the value within the card. One that I use: yaml - type: custom:button-card entity: sensor.bedroom_temperature name: '[[[ return parseFloat(entity.state).toFixed(1) + "°F" ]]]'
👀
If I addd cards (that are working fine on the energy dashboard) to a different dashboard, is it normal for them to be broken? do they need to wait for new stats run?
eg https://www.home-assistant.io/dashboards/energy/
type: energy-devices-graph
that one worked, but the type: energy-usage-graph didn't
I'm not sure. I don't use Energy. I don't image that would be an issue.
gents, is it just me or ..? Whenever I'm on edit mode of my dashboard on Chrome, the browser consumes like 1.5GB of ram and edit mode gets extremely slow. I oftentimes have to close and reopen the browser.
Struggling a little bit with conditional icon colors and mushroom cards. Any ideas? Thanks!
type: custom:mushroom-entity-card entity: sensor.alice_office_window_battery fill_container: false primary_info: name secondary_info: state layout: vertical icon_color: |- {% if state == "Good" %} green {% else %} red {% endif %}
I think you have to use the custom:mushroom-template-card in order to get some of that customization. yaml type: custom:mushroom-template-card entity: person.derek fill_container: false primary: '{{ entity }}' secondary: '{{ states(entity) }}' layout: vertical icon: mdi:check icon_color: |- {% if states(entity) == "home" %} green {% else %} red {% endif %}Tip: You can also define a different entity by placing it in quotes. For example, {% if states("sensor.some_other_entity") == "on" %}
You can probably get it to work with card mod. I was starting to figure out some of it but ran out of time; gotta get to work. (Had to remove primary, secondary, layout, and icon for this code paste, but they're the same as above.) yaml type: custom:mushroom-entity-card entity: person.derek card_mod: style: | :host { --mush-icon-size: 60px; --card-primary-font-size: 30px !important; --card-secondary-font-size: 10px !important; } mushroom-shape-icon { --shape-color: red !important; --shape-color-disabled: none !important;} }
i just did a big update from 2022.12.8 to 2023.6.1...the new dialog for switches is kinda awful. i've already got a toggle in the entity group i'm clicking on, why would i want a larger toggle to be the only thing i can see when i click to open it up? is there a way to make the history tab be the default?
Thanks @tribal galleon that got me moving in the right direction! I'm just struggling getting the entity name in the Primary position. I've tried entity.name and entity.friendly_name and a whole bunch of other iterations.
Those are going to be attributes of the entity. I forget off the top of my head how to call them but I can check when I get home from work.
@jagged dew yaml secondary: '{{ state_attr(entity, "friendly_name") }}'
Hi Everyone, I have an issue---> when I modify /src/html/index.html.template, it doesn't update and I notice the watcher doesn't detect any change, how could I update this file? (do I need to rebuild) -> when I change a component it detects changes but it takes like 17 minutes to compile, any idea how to change the /src/html/index.html.template and it gets updated or how to improve build time when I change a component file?
I've got an AC I control via an IR remote connected to HA. No native integration at all - just scripts to activate certain IR codes to change temp. I want to be able to set some sort of slider card that triggers the corresponding temperature IR code depending on the slider position. So basically I just need to set min/max values for the slider and have it report current state. From there I can rig up automations depending on current state value. Anyone able to point me in the correct direction?
@tribal turtle I converted your message into a file since it's above 15 lines :+1:
Brilliant, thank you!
Hello everyone, is it possible to get a card or something that acts like a remote for kodi? What I am looking to do is have a page that displays my movies so I can just tap on it to play on my tv. I know I can browse from the media player but the idea is to just have it ready without having to do like 4 taps to get there.
Looking for help to clean this up
See https://github.com/thomasloven/lovelace-card-mod#performance-improvements ```
I have this in my config however it still give the error. I got the path from when installin with HACS that is what pops up
```frontend:
themes: !include_dir_merge_named themes
extra_module_url:
- /config/www/community/lovelace-card-mod/card-mod.js ```
What am I missing
When browsing pictures in the Media Browser, is there really no Next and Previous button or is something buggy on my end?
I think it always says that
thanks for the input however having it configured like it is, doesn't work
I removed it from the reference and tryed just from the frontend settings and I get
I must not have the path correct... I used the mod to but some boxes around the buttons and there are no boxes now
Right
How do I know what the path should be?
can anyone help me get the animated background thing working? I cannot for the life of me figure it out.
'/local/community/...,' or '/hacsfiles/....' if you installed via HACS
Just like any other resource
It tells you what to use in the docs
At that link
You will still need the old resource. The extra_module is an extra addition to configuration. Without the original resource it will not work
That is not true
While card-mod can be installed as a lovelace resource, some functionality will benefit greatly from it being installed as a frontend module instead.
Note the 'instead'
I don't have it as a resource and it works fine
Oh wow never noticed that haha😅
yeah that's what I was going by the 'instead'. I installed via HACS and I have tried
/www/community/lovelace-card-mod/card-mod.js
/local/community/lovelace-card-mod/card-mod.js
/config/www/community/lovelace-card-mod/card-mod.js
/hacsfiles/lovelace-card-mod/card-mod.js```
and none of these work. I obvoiusly don't understand how that path works
and it is installed in the location above in the screen shot
It was clearly being loaded based on your very first log message
No need to try random things. Whatever you did there was correct
Hey,
how can i set a off state icon color in a mushroom light card?
the first one had it as a resource
WTF, I've done that more than once, I am sure. It works now. Thank you for your help.
it was probably your browser cache
which you should always clear whenever you chagne something in the frontend or see weird behavior
Thanks again for your help.
https://community.home-assistant.io/t/ha-sidebar-reverse-proxy-and-authelia-how-to-keep-services-secure-and-still-be-able-to-access-them-from-ha/576941 Hi, I'm struggling for weeks now to find a solution for my problem, but I really can't find how to do this. If you have a bit of time and know about reverse proxying HA, could you read it please ? Thanks in advance and have a great day
state:
- value: 'on'
entity_picture: /local/images/servers/proxmox_yellow.png
state_display: Connected
- value: 'on'
operator: '!='
entity_picture: /local/images/servers/proxmox_blue.png
state_display: Disconnected
styles:
state:
- color: yellow```I set the second option to "not equal to on" so that should catch other states such as unavailable or unknown.
You can also apply `styles:` to each state.
Also, consider templating your card so you don't have to repeat lines for each card such as your entire style section. https://github.com/custom-cards/button-card#configuration-templates You can even use variables to be referenced and cut down on duplicate code even more. (Template `state:` but use variables for the entity_pictures so you only have to define those in each card. Two lines compared to eleven lines, as shown above.)
Hi all, after (hopefully successful) upgrade to 2023.6.1 I’ve noticed that Sun panel is missing in default dashboard (“Overview”). I’ve tried re-adding, nothing… Does anyone has a same issue? Thanks!
Hey there,
the upper card is a tile card and the lower one a mushroom light card. Id really like the mushroom light card to look like the tile card (icon color).
How can i change the off state icon color of the mushroom light card?
Thank you! Looks like the state_display was what I was missing. I'll also look into the templates.
@tribal turtle I converted your message into a file since it's above 15 lines :+1:
Template
button_card_templates:
web_url_status:
variables:
friendly_name: ''
name: ''
url: ''
tap_action:
action: url
url_path: '[[[ return variables.url ]]]'
name: '[[[ return variables.friendly_name ]]]'
entity: binary_sensor.port_{{ variables.name }}
icon: mdi:server
show_state: true
show_entity_picture: true
state:
- value: 'on'
entity_picture: /local/images/servers/{{ variables.name }}_yellow.png
state_display: Connected
- value: 'on'
operator: '!='
entity_picture: /local/images/servers/{{ variables.name }}_blue.png
state_display: Disconnected
styles:
card:
- border-radius: 14px
- padding-top: 20px
- padding-bottom: 10px
name:
- font-size: 18px
- color: white
- align-self: middle
- padding-bottom: 0px
- padding-top: 10px
state:
- font-size: 13px
- color: gray
- padding-bottom: 15px
Not sure what I'm doing wrong with the template, but it's not working as I would expect. Does the template not support jinja?
Showing new and old grid cards for reference.
type: grid
cards:
- type: custom:button-card
template: web_url_status
variables:
name: proxmox
friendly_name: Proxmox
url: https://192.168.1.9:8006
- type: custom:button-card
tap_action:
action: url
url_path: https://192.168.1.9:8006
name: Proxmox
entity: binary_sensor.port_proxmox
icon: mdi:server
entity_picture: /local/images/servers/proxmox_blue.png
show_state: true
show_entity_picture: true
state:
- value: 'on'
entity_picture: /local/images/servers/proxmox_yellow.png
state_display: Connected
- value: 'on'
operator: '!='
entity_picture: /local/images/servers/proxmox_blue.png
state_display: Disconnected
styles:
card:
- border-radius: 14px
- padding-top: 20px
- padding-bottom: 10px
name:
- font-size: 18px
- color: white
- align-self: middle
- padding-bottom: 0px
- padding-top: 10px
state:
- font-size: 13px
- color: gray
- padding-bottom: 15px
I think your indentation is wrong starting a line 3. Just looking I think it should be ```yaml
type: grid
cards:
- type: custom:button-card
template: web_url_status```
It was a bad copy/paste, but it is correct
You are using jinja within button-card, that is not supposed to work, all templating should be done in JavaScript
So, I would start with copying the working Promox. No variables just yet. And ensure that the template works at that point.
entity: binary_sensor.port_{{ variables.name }}
In JS
entity: '[[[ return "binary_sensor.port_${variables.name}"; ]]]'
Same holds for the entity_pictures
awesome... thank you!
I was thinking that may have been an issue but I wasn't sure yet.
I would have figured it out eventually. One of my lines has yaml name: '[[[ return variables.var_value + "%"]]]'and now this works yaml name: '[[[ return `${variables.var_value}%` ]]]'
Still not working...
type: custom:button-card
template: web_url_status
variables:
name: Proxmox
name_lower: proxmox
url: https://192.168.1.9:8006
button_card_templates:
web_url_status:
variables:
name: ''
name_lower: ''
url: ''
tap_action:
action: url
url_path: '[[[ return variables.url ]]]'
name: '[[[ return variables.name ]]]'
entity: '[[[ return `binary_sensor.port_${variables.name_lower}` ]]]'
icon: mdi:server
show_state: true
show_entity_picture: true
state:
- value: 'on'
entity_picture: >-
[[[ return `/local/images/servers/${variables.name_lower}_yellow.png`
]]]
state_display: Connected
- value: 'on'
operator: '!='
entity_picture: >-
[[[ return `/local/images/servers/${variables.name_lower}_blue.png`
]]]
state_display: Disconnected
styles:
card:
- border-radius: 14px
- padding-top: 20px
- padding-bottom: 10px
name:
- font-size: 18px
- color: white
- align-self: middle
- padding-bottom: 0px
- padding-top: 10px
state:
- font-size: 13px
- color: gray
- padding-bottom: 15px
HA keeps reformatting the entity_picture keys to be multiline... but still it looks equivalent to me.
Try hard-coding each entry that has a variable to pinpoint which is causing problems. yaml type: custom:button-card template: web_url_status variables: name: Proxmox name_lower: proxmox url: https://192.168.1.9:8006 name: Proxmox Test entity: binary_sensor.port_proxmoxand so on all the way through state:. (Styles: should be okay to leave out.)
Any entries added will override the template.
The template works if I take out any of the javascript that has string formatting. The javascript without string formatting work fine.
So it's just these 3 lines with issues.
entity: '[[[ return `binary_sensor.port_${variables.name_lower}` ]]]'
entity_picture: '[[[ return `/local/images/servers/${variables.name_lower}_yellow.png` ]]]'
entity_picture: '[[[ return `/local/images/servers/${variables.name_lower}_blue.png` ]]]'
The js seems correct to me.
Hardcoding entity in the card (not template) seems to work.
you're missing the trailing semicolon in each case
and you have two entity_picture 🤷
oh, for different states
They're for separate states. Thought the trailing semicolon is only for multiline.
there's only one line of javascript... "shouldn't" need a trailing semicolon
Seems to be working though... maybe there's a limitation with using javascript to define the entity
what about something like yaml "/local/images/servers/" + variables.name_lower + "_yellow.png"
it works for the pictures, just not the main entity
maybe because the card uses the entity for some of its own coding purposes.
I've become enamored with Python syntax, unfortunately forgotten some of the nuances of C, and never have been a JS fan
The entity key does not support templating according to the docs
But you can always leave it out and only use it in your ui-lovelace.yaml
type: 'custom:button-card'
entity: <your_entity>
template: web_url_status
variables:
....
Python also supports a semi-colon for multiline syntax. It's not used that often though. In both languages they're optional if you break don't put multiple commands on a single line.
yes, it's the "statement separator" vs. "statement terminator" part that threw me
Thanks for all the help everyone... I really appreciate it! I'm glad to learn something new and I think the templating will save me soo much copy/pasting.
Anyone know of a good graphing card, that can plot sensors, both stacked, and a bunch or horizontal bar graphs?
Like the pv power, and the individual devices, on the energy dashboard?
Hi Everyone, I have an issue---> when I modify /src/html/index.html.template, it doesn't update and I notice the watcher doesn't detect any change, how could I update this file? (do I need to rebuild) -> when I change a component it detects changes but it takes like 17 minutes to compile, any idea how to change the /src/html/index.html.template and it gets updated or how to improve build time when I change a component file?
#devs_frontend-archived is probably more appropriate channel
Anyone know if possible to cycle through several dash board subviews on a timer when streaming to chromecast?
Is there a way to build a custom dashboard, be it with the HomePanel add-on or something, where you can limit a users access of what they can see & control, using a different username/password and/or IP address? When we have guests stay with us, they have their own bedroom, so I want them to access control of the lights, fans, TV, etc. in their room and the “shared” spaces like the kitchen, dining room, living room, etc., but not be able to access the other bedrooms, security cameras, etc. I know I can easily build a dashboard only showing the stuff I want, but don’t know how to limit them to only SEEING said dashboard(s).
How can I get the text value of a sensor state to display as a name on a card? I'm trying this with no luck: name: {{ state('sensor.fire_rating_text') }}
Try with double quotes around it? But it's probably not supported.
doesnt work. With double quotes it displays that state code
makes sense. Thk you
Is there a way to browse through images in "My media" without clicking one picture, closing it and opening the next? Like a keyboard shortcut to next image or something.
Hi. I'm new to HA and this is doing my head in.. I have a RM4pro and have managed to learn all the IR/RF commands for my devices. There's one snag though.
I have a ceiling fan that has separate buttons for light_on/light_off. How on this great green earth can i make a card switch to toggle the light?! I can't figure it out. Nothing i try works in the code editor.
@marsh gull I converted your message into a file since it's above 15 lines :+1:
@marsh gull I converted your message into a file since it's above 15 lines :+1:
or is this something i should be creating a script/automation for and 'calling' it differently
I think what you'll end up having to do is creating an input_boolean/toggle helper to "act" as your fan being on or off. I think you'll need an automation to check the status of the helper, sending the appropriate code, and then toggling the helper.
Then, you can work it into your dashboard. Tap_action to call the automation and getting the state of the helper for your state styling (like colors or animations). (Consider, a hold_action just to toggle the helper in order to keep the fan and helper in sync.)
Technically, you could incorporate the "automation" portion into the card, but that could be a more advanced approach.
I've got a strange issue with browser_mod not displaying cards. I've got a button card set to fire-dom-event on tap and call browser_mod.popup with the below contents. Weird thing is, when the button is pressed, the popup shows but is blank except for the input select. I've tried removing the vertical stack so it's just the input select and the grid but it still just shows the input select and nothing else.
And if I remove the button that calls browser mod the card shows fine with the grid and the input select.
Is it in any way possible to get the yaml code for a specific popup card? Basically what I want to try is to replicate the popup card or the "more info" popup of a light entity, the new kind. Either have some way to extract the lovelace code or an easy way how I can recreate this?
Is there some 'typical' thing people do on a dashboard to indicate that a frigate event occurred? Some flag to prompt you to go check the events.
That's all javascript, not yaml. I would say no there's not an easy way. If you're an experienced web dev you can probably find some way to do it.
It's driving me crazy, anyone competent with Minimialist Lovelace UI?
I can't seem to add any custom cards
I always get this message
the file is in config/ui-lovelace-minimalist/custom_cards/custom_card_vertical_cover/custom_card_vertical_cover.yaml
yes, still doesn't work
I have a feeling that those files are not getting included at all
You will also need to renew the dashboard with the 3 dots and select renew page
hmm, i was doing some other stuff and it started working
but I reloaded configs + dashboard multiple times before
fun stuff :(
i figured it out, apparently it was really the yaml config reload, just not lovelace one, I click all YAMLs and it works
Does anyone know if there are any ways to adjust the schedule helper intervals? Right now it is 30 minute minimum time intervals. That is a bit too large for my needs. 10 minutes would be perfect but 15 minutes will do. Is that 30 minute a hard limit or is there a way to configure the interval for the schedule helper?
@feral rivet I converted your message into a file since it's above 15 lines :+1:
it would be displayed properly if you didn't include a message with the code btw
my bad, I was trying to share what I had asked as well as the information that I got.
lol yeah it's common tbf but code: works_like_this_too
just back tick the code, not the message.
you can just edit what you have and move the tics
morning , I am looking for any help I can get concerning this template. I have a button card that displays the state of the door and the lock via a sensor template. because I am using sensor templates the standard tap action will not function. I found this tap_action template that Petro had helped someone else with
action: call-service
service: |
[[[
return (entity.state === 'locked') ? 'lock.unlock' : 'lock.lock';
]]]
service_data:
entity_id: lock.garage_laundry_door_lock_door_lock```
the problem I think I am having is that in Petro example the entity_id referenced back to the original entity, which is a sensor. Here is the full card http://pastie.org/p/7uWEehpPIHNAcLYHpAO4W4
Petro shared this with me: if that's for custom button card then i believe you'd replace entity.state with entities['lock.garage_laundry_door_lock_door_lock'].state
it's either that or states['lock.garage_laundry_door_lock_door_lock'].state
most likely the second one
tap_action:
action: call-service
service: |
[[[
return states['lock.garage_laundry_door_lock_door_lock'].state == 'locked' ? 'lock.unlock' : 'lock.lock';
]]]
service_data:
entity_id: lock.garage_laundry_door_lock_door_lock
entity.state refers indeed to the global set entity of the card
Also add
triggers_update:
- lock.garage_laundry_door_lock_door_lock`
to the card. This will rerun the template on each state change of your lock
Wow man thanks . the update part is that not an automatic thing?
No need to when it's the main entity
Man thanks again. The card now works beautifully
The air quality sensor from ikea is nifty look at these pretty graphs
ooo, what zigbee integration are you using?
Zigbee2mqtt
I was afraid you'd say that 😉 I was hoping for confirmation someone had got it working in the others. (for VOC. I think the pm2.5 works)
thanks 🙂
what I meant in #templates-archived is that you could also use this:```
tap_action:
action: call-service
service: input_boolean.toggle
service_data:
entity_id: input_boolean.motion_detection
what I didnt check was that you used a lock, and that doesnt have a lock.toggle service unfortunately. So you do have to use that template.....
just know that light, input_boolean, switch have that toggle service to make life easier 😉
Hey thanks for that.
Does anyone know if there is a way to have a custom bar card, to give it your own image, to say, have a beer mug fill up or empty based on data provided to the card?
Should be able with a picture elements card.
You can just show different pictures with the different states
hi 🙂 does anyone know if there is a way to update the polling rate at which a photo is loaded in lovelace via its path? i have a static image path that is being overwritten by other scripts but lovelace doesnt seem to update for several minutes to re-check the file
Hi team. Need some assistance with my configuration.yaml. It throws an error and im having a hard time to understand whats wrong (absolute yaml beginner). Can someone help me?
omg. Thank you. works.
But the states are fluid. Someone could pull a pint, someone a half pint. I'd need a ton of pictures. I was thinking a transparent image of the mug, and the gauge moves up or down behind it, appearing to fill or lower the contents of the glass as oz are poured.
picture-elements and card-mod
I have a switch that I want to convert to a light so it can have a different color icon depending on state on/off but I also want a different icon. Is this doable? 'Switch as X' only changes the entity to type light afaik.
You can change icons from the card themselves
How? Can it work with auto-entities?
Probably not easy to customize a single entity to show up a certain way with the auto-entities card. Generally, customization like you asked about is when the entity has its own card. You might consider changing the Switch to Show as Light.
HA will hide the switch entity and create a new light entity to replace it.
Yes, Thanks. That's what I referred to 'Switch as X' but will not allow changing of icon. I am thinking of using template light switch. What do you think, is that too much?
With templating, almost anything is possible. My only thoughts are controlling the switch but showing the light template through an auto-entity card. IMO, the auto-entity type cards are good for showing general information but they are designed to be customized to show specific items, not to show specific items in a certain way. (If that makes sense.)
It does. Thats how I use it. I want the icon etc to be setup in the entity itself. The auto-entities is for showing e.g. all lights that are on., all lights in specific areas, etc...
I get that. But what you're trying to do is that last part of what I said not to show specific items in a certain way by way of changing the icon within the card. Looking at the doc, there's not much in terms of styling that you can do with the card. Have you tried creating the light entity like suggested above?
yes, but it won't be able to change the actual icon depending on state. Also, I like yaml better than ui.
I use auto-entities cards to quickly toggle automations and another for input selects. But nothing in there allows me to change the icons within the card. yaml filter: include: - entity_id: input_boolean.automation* domain: input_booleanI also use custom:battery-state-cards for monitoring battery levels and availablility.```yaml
filter:
include:
- name: entity_id
value: sensor._power
- name: entity_id
value: sensor._battery_level
exclude:
- name: state
operator: '>='
value: 50```
@glacial ledge Start a thread and post some screenshots of what you're working with. Maybe something can be figured out. (I even have an auto entities card that shows custom:button-cards that are customizable... But this may not even have the level of customization that you're looking for as with will create the buttons with the same styling.)
is it possible to make a "grid" with two columns where for example 1 item takes 1/3 of width and second one 2/3
I don't think the grid card is customizable for that. You might consider the custom:layout-card. Check out this thread: https://community.home-assistant.io/t/custom-layout-card-grid-layout-please-help/334526
thanks this is what I needed
hey i just set up a Kodi media library and now in the media player tab i no longer have any media_player entity source controls... ive restarted HA and didnt fix it. any idea?
i thought might had been the extra /browser in the URL but removing it gives me an error message - also i can call media_player as a service to play media on automations / direct from the entities list. just no longer shows source select + controls on the 'Media' tab
yeah! This has happeened to me too and depending on what browser/computer/osx app I open depends on which media_Player I get.
it disappeared with 2023.6, I upgraded to 2023.6.2 and still no dice
this is in my osx media player app, just stuck on the youtubemusic player integration I have installed.. but then in my chrome browser:
glad its not just me now. 🙂
so mine is not showing on:
linux - firefox / chrome
macOS - firefox / chrome
windows - chrome
android - app / web browser
works on:
macOS - safari
windows - firefox and opera.
🤷♂️
thought i might had screwed some of the browser_mod integration settings up but went and wiped those clean and no avail.
I am seeing if I Can replicate
yeah, nah..... it just doesn't work for me.
I can only terst OSX, but chrome/firefox/safari, no media player list.
I tested locally and externally (externally I have cloudflare CDN)
Could it be some FE card breaking it? Do you have HACS FE modules installed?
inspector on broken browsers shows code to be non-existent to what is shown on one of my working ones. (this is linux firefox). so idk 🤷♂️
i only have just a small handful. wouldnt think these would have broken it with a integration of the kodi service
idk, i even removed the kodi integration and still broke, gonna do a restore from 2 days ago and hope it doesnt happen again lol
yeah, I didn't add or remove any integration
it just disappeared with 2023.6
@vernal river https://github.com/home-assistant/frontend/issues/16818 binggo!
How do I resize the image in a picture-elements card?
The image is 131x255 which is the size I want it, but it loads GIANT. More like 600x1000
Is there any documentation on the media player states? Looks like it’s an enumeration
Playing/paused/etc
Struggling to make a custom button card respond to changes in state. I tried JavaScript, but not nowhere. Trying this now with no luck:
state:
-value: “paused”
operator: ‘=‘
icon: mid:play-pause
I was thinking the value was a number, but it appears to be a string
Should I be using state in yaml or referring to state in JavaScript?
Whatever you want
Your little unformatted snippet isn't enough to say anything about your attempt
Both should work? How do I refer to state in JavaScript?
@inland token I converted your message into a file since it's above 15 lines :+1:
Here's my full attempt
I get lost and just guess because there seems to be no documentation. For example: none, single or double quotes around the strings? is the equality operator = or == ?
there's extensive documentation: https://github.com/custom-cards/button-card#available-operators
How did you get to it? Where do you start
I seearched for "home assistant custom button card" in Google
first link
where did you look?
Home assistant documentation - media player
it's a custom card
it won't be anywhere in teh official docs, and definitely not under "media player"
that's an integration
you had to have installed it from somewhere, and the docs were there
Ok, so each button is completely different in syntax and rules?
I fugured there was a standard
each card can do whatever it wants
again, you're using a custom card, which some random dude wrote and made available
Gotcha. No wonder it's so confusing. 50 different sets of rules fo r 50 different buttons
you keep saying "buttons"
I think you mean "cards"
but if you look through them, you will find consistency
the real point is - follow the documentation for what you're using
@inland token I converted your message into a file since it's above 15 lines :+1:
This gives me teh word "playing" for the name, but fails to set any icon
I suspect it's because you have this:
icon: null
what's that for?
it probably overrides the other part
Took out the whole line. No change
It appears to ignore anything I set for either state. Maybe it only works for certain object types like lights?
Thanks for your help. It looks like this functionality of the card is broken.
@inland token yaml icon: | [[[ if (entity.state == "playing") return 'mdi:play'; if (entity.state == "paused") return 'mdi:play-pause'; else return 'mdi:stop'; ]]]
I just got it going. That's what I resorted to. It looks like the state: functionality is broken
Thanks!
I see people give examples like this. I assume you mean: states['media_player.living_room'].state == 'playing', since your example will not work
It's not that it is broken. Think it has issues with the media_player entity.
Maybe a different version of the card works with your syntax?
It does work. The custom:button-card can use the entity as a variable.
How is that different from entity_id ? That's what I have been using
Not all cards can refer back to the entity: like this card can. The syntax you used also works, but, more importantly, it can be useful when you want to find a start of a different entity. yaml type: custom:button-card entity: light.bedroom1 name: Bedroom1 color: auto icon: | [[[ if (states['input_boolean.tester'].state == "on") return 'phu:ikea-blind-closed'; if (states['input_boolean.tester'].state == "off") return 'phu:ikea-blind-open'; ]]]
it does work! I tried for days to get other examples to work, and just gave up & found the other way from experimentation.
I just assumed that syntax only worked for teh pre-lovelace cards, whatever they were called
The preloaded cards have the minimal customizations available to them (without using card-mod). They're good for basic stuff but not much more, IMO.
I thought lovelace wasn't a thing anymore
Not sure. I though that all the current cards were called lovelace. & there was some legacy thing before that. Just started with HA a few weeks ago.
It seems like it's a bunch of stuff cobbled together. There's YAML, javascript, some weird variant of JavaScript nobody's every heard of, and at least 2 other languages
Today's lesson for me is taht every card can have a different language, rules, and syntax.
Again, like RobC mentioned, those are custom cards.
From github, it looks like you write cards in Microsoft Visual Studio using typescript, yet another language.
The custom:button-card:
Is there any way to show the value of an input-number helper in an entities card without it being editable?
- type: entities
entities:
- entity: sensor.electricity_tariff
icon: mdi:calendar-alert-outline
- entity: sensor.current_electricity_rate
icon: mdi:currency-usd
- entity: sensor.local_consumption
icon: mdi:solar-power-variant-outline
- entity: input_number.electricity_daily_charge
So they wrote that card in 2 different languages?
Guessing some cards are in perl, python, c++ etc?
and no, TypeScript is a strongly typed "version" of Javascript that is compiled into regular Javascript
with a Mushroom picture-entity card, is there a way to open up the camera entity for a tap action?
Currently I specify my entity to be an MQTT based sensor for motion and hte camera entity specifies the actual camera. So when clicking on it, rather than to open the MQTT snesor "more info", I would rather enlarge to live feed of the camera
Hi there. I have created 2 scenes which controll a certain amount of lights at once. One to turn them on and one to turn them off. On my dashboard I just want to have 1 toggle buttonm to turn them on and off. Im using dwains dashboard. Any hint on how to do that?
You can create a input_boolean and use that in an automation to toggle the scripts with a choose action based on the state of the boolean
that easy. awesome man. that works
input booleans (toggle helpers) and input buttons are great 🙂 especially as you can do things like expose booleans to alexa, and use that to control things HA can't touch. (frelling kasa plug which turned off local control, but still worked through alexa.)
I'm trying to have a view with 3 columns
however the other grid goes below for some reason rather than going to the right
is there any way to force it to the right
The default masonry layout is hard to control. You could try a horizontal stack with 3 vertical stacks inside for each column. Or look into custom options like lay-out card
the horizontal stack only takes up like a portion of the screen tho
Set the dashboard to panel mode (1 card)
ty ill try
eh looks a bit bad
ig i coudl try lay-out card
is it easy to do what im doing with that
I don't see a Layout Options button when using lay-out card
You will need the grid layout
yep
ive done that
how would i make it do 3 columns
with grid layout
alr got a solution rn
Starting with HA, I figured out last need that there is a big icon library called MDI. Are there other icon libraries installed? To some integrations add their own? Is there a way to browse what I have?
PS - I hate autocorrect
Not exactly answering your questions here but some useful info: When I'm trying to figure out what Material Design Icon I want to use, I visit https://pictogrammers.com/library/mdi/. The search and categories are helpful.
You can install more icons, if you want. For example, I like this set call custom-brand-icons (available through HACS) that has some cool icons and frequent updates. https://github.com/elax46/custom-brand-icons
Thanks
Hey folks. I'm not sure if frontend is the right place; but I can't load the media player tab/page. It's throwing unhandled promise errors in the browser console. And complaining about "TypeError" and "this.hass.entities[e.entity_id] is undefined". I'm guessing a media player has disappeared or something, but how do I fix it? I don't see any dodgy entities in config
or more accurately, the page opens and I can browse through the media, but the media bar won't load at hte bottom
ha-bar-media-player.ts is where the error is coming from
There was a conversation yesterday talking about Media Player issues: #frontend-archived message
Looks like it might be an open issue: https://github.com/home-assistant/frontend/issues/16818
Aha thanks! I'll wait for a fix then.
@inland token Another one to consider: https://github.com/vigonotion/hass-simpleicons
Uses icons from simpleicons.org which has a lot of icons for brands.
Having an issue where the frontend says card doesn't exist l, but the card does exist and it's loading via resources. It seems to only happen the first time before (eg when the js isn't cached). Basically I think the frontend is loading and attempting to load the card before all of the js resources are loaded. Any solutions for this?
Does a refresh fix the issue? I noticed my tablets will have some card problems after reboot (because the dashboard get loaded before HA is done loading stuff.) My fix: 10 seconds after HA is stated, an automation sends a Load Start URL to the tablets which are running FKB.
Yep. That just seemed hacky
Thinking about making an addon to monitor hacs for js files and then auto webpack into a single large bundle
Agreed. In my case it is just a timing thing. The dashboard refreshes before some integrations are loaded, namely, Frigate. Sometimes, custom:button-card hasn't had a chance to load so my dashboard is just full of errors.
Yeah. Seems similar
Wondering if I could bundle all the js into a single... If that would work or would make it worse because it would load slower sure to the size...
Seems like the frontend souls wait for resources to be all loaded before it displays
Maybe I'll whip up something using uglify and see
Actually, now that I'm using custom:layout-card, my dashboard is just one giant error message. (Just updated Core.)
Built a quick addon to do it. .. takes the list of js modules to combine and then uses Inotify to watch them and then runs uglify and gzip on them.... Just need to see if that's better or worse .. but the whole gzip is 8mb uncompressed and 2 compressed
anyone know how I can get the icon to span the entire card? (button-card)
Is it possible to convert the history to a graph?
Yes, you need to assign a unit_of_measurement to the sensor. Doesn't matter what unit you choose.
@meager vortex
What does the offset do?
Thanks
If you click that (?) on the right side of the page it will take you there.
Thanks
Hi, I've noticed a bug in the frontend and found an issue about that on github but it has been "locked and limited conversation to collaborators" a year ago, should I create a new issue, maybe referencing the old one or is there a reason why it has been locked?
All bugs get auto-closed after a few months of no activity. If it's still an issue feel free to re-create a new issue again, you can cite the previous issue # to maintain a link.
thanks
Is there a way I could use HTTP / Fail 2 ban to ban a whole subnet?
Can someone tell me what I'm doing wrong here? Trying to control a Shield TV remote with some buttons. Have this set but when tapping it shows "Failed to call service remote/send_command. required key not provided @ data['command']"
tap_action:
action: call-service
service: remote.send_command
data:
command: DPAD_RIGHT
target:
entity_id: remote.shield_lounge
greetings! is there a way to change the display of light switches and other items to default to using the history bar with on and off cycles on the bar? I prefer that over just seeing a big switch for the entity.
anyone around that can confirm we can Not use yaml integration platform in auto-entities integration filter? https://community.home-assistant.io/t/auto-entities-automatically-fill-cards-with-entities/147801/987?u=mariusthvdb
otherwise I wouldnt understand wht this is happening
Looks right to me... Maybe test it in devtools and see what happens?
That's the weird thing - I pulled the config from dev tools and tested it just perfectly fine in dev tools. It's like it wants to work fine when not called from Lovelace but when called from inside Lovelace it just fails for no good reason. I thought maybe because it was inside a browser_mod popup it may be failing but even creating a single button card (the default one, not the custom one) with nothing but a single tap action it's failing. Wondering if I need to submit a bug report or something.
@carmine fern I converted your message into a file since it's above 15 lines :+1:
I'd probably try disabling all your mods and try it. I feel like I've seen similar issues before related to mods, though I don't recall all the exact details. That yaml works fine for me.
someone have tha same promel, that if I click on add helper,nothink happens
@pallid zephyr I converted your message into a file since it's above 15 lines :+1:
It's gonna be the damn dashes again, I can't seem to get the hang of them.
Try removing the dashes before - type: custom:button-card under each conditional. The card clears without errors when I do that and looking at the conditional docs: yaml card: type: card_here
thanks, hope for a fast fix
Is anyone aware of a way to render the content of the newer entity dialogs as a card on a dashboard (a light dialog specifically, if that matters)?
How to make dashboards device (width) sensitive? My dashboard doesn't work on iphone because the cards are too narrow and cut off all the text...
Hi, I‘m using the markdown card with text plus a value from a weather entity. As Example: ‚Das Wetter ist: {{ states('weather.dwd_weather_yourcity') }}‘ I expected ‚sonnig‘ but get ‚sunny‘
So the value here is not in my language but in other cards like entity card it is. Is there a way to change it?
Would that include all the custom components installed via HACS? If so is there a quick and easy way to disable them all for testing?
can anyone recommend a way to have three date-time pickers in a single row? Can I, for instance, have them as buttons that open a picker?
I guess this is the closest solution? https://community.home-assistant.io/t/how-to-popup-date-picker-with-one-click/400620
greetings! is there a way to change the display of light switches and other items to default to using the history bar with on and off cycles on the bar when clicking on a switch or light badge? I prefer that over just seeing a big switch for the entity.
Thanks!
anyone know why or how to prevent HA from constantly reverting to the default dashboard instead of the one I select and set to default [about 10 times a month]?
Want a card button to say something. I would love to “read the docs,” but have no idea where to look. I discovered “cloud say.” How do I specify which voice I want to use? Working button card so far:
show_name: true
show_icon: true
type: button
entity: media_player.living_room
tap_action:
action: call-service
service: tts.cloud_say
target: {}
data:
cache: false
entity_id: media_player.living_room
message: This is a test
show_state: true
name: Hello
icon: mdi:account-voice
I get “read the docs” with links to random places. I’m not sure how you find these places. Should I be looking in the HA docs, some GitHub repository? Am I looking up docs on the button, media player, or cloud_say?
I tried voice: xyz. And just get an error that I am including an extra parameter
My thought process so far: I guess it’s built into HA, so it should be in the HA docs. Looked and discovered nothing about cloud_say. Googled cloud_say. and found links related to Alexa and something called Nabu. Don’t think either is related, but unsure how to determine if they are or not. I’m not using an Alexa.
My thought process so far: I guess it’s built into HA, so it should be in the HA docs. Looked and discovered nothing about cloud_say. Googled cloud_say. and found links related to Alexa and something called Nabu. Don’t think either is related, but unsure how to determine if they are or not. I’m not using an Alexa.
tts.cloud_say is specific to Nabu Casa. https://www.nabucasa.com/config/tts/
first link from my Google
"something called Nabu" is Nabu Casa, which is the organization created by the HA founders
Ok, so I guess my first question is how you know this, or how I should have been able to figure it out on my own. I tapped on a media player card and accidentally discovered text to speech in the “sources” section.
Second question would be how you are supposed to specify which voice to use. The link you gave only has a “gender” option
If I want to use the “JennyNeural” voice, for example
I literally Googled "home assistant cloud_say"
I did the same. I got the link you gave me. It’s either wrong or outdated, because there is no mention of voices, so I didn’t know if it was the same thing, an older version, or just shared some common code history.
well, that was a pain in the ass
service: tts.cloud_say
data:
entity_id: media_player.fr_gh
message: Hi!
options:
voice: JennyNeural
I don't know if that's actually documented anywhere
which voices you can use with which languages, that is
and the NabuCasa docs don't mention "voice" as an option, so yes, I would say that they're lacking.
these are the available options:
gender=options.get(ATTR_GENDER),
voice=options.get(ATTR_VOICE),
output=options[ATTR_AUDIO_OUTPUT],
anyway, #voice-assistants-archived for more
Wow! Thanks! I guess that I shouldn’t feel like I’m overlooking the obvious. It really does require a lot of digging and trial.
maybe it's documented somewhere, but I couldn't find it
So when you have a sensor card, and you tap on it and get the nice graph with the blue line and what looks to be period min / max shading..... How can I recreate that graph to show it on a dashboard?
That's a statistics graph. You can add a statistics graph card.
how do I get it to look the same though?
oh - I tried it again and it actually comes up the same now - not with just different lines......
before the min / max ones weren't a shaded region, just additional lines.
thats much nicer than the yellow one lol
I've posted this example before. Custom:button-cards templated for my motion detectors. Tonight, I added battery status indicators. Adds 18 lines to the template but uses a variable for the battery_level entity so each card has only an extra two lines. (The cards are subdued when clear; flash when detected.)
Dashboard's YAML: https://pastebin.com/gaFmay1B
Motion Detector Template Line 295
Generic Custom Template Line 78
Usage example at Line 5539
Where's the best tutorial on how to create a new card type?
Looking to create a 2d slider for my elgato key lights (brightness vs temperature)
Mind sharing the code for battery status? Would love that on mine.
Heyo
Is there a way to change the icon color of the Turn On All Lights button to yellow all the time? been struggling to do so
http://pastie.org/p/5LMb5ksAZRa5KzP3Phx6jT
(line 25 is the turn on all lights button)
You need to use "color_type: icon" then add "color: yellow"
@mystic timber I converted your message into a file since it's above 15 lines :+1:
I added a link to my dashboard's YAML along with line numbers to reference.
Heyo
This is maddening. Sometimes it says "Custom element doesn't exist: grid-layout", sometimes it works fine. How can a thing be defined 'sometimes'?
I think this is the right channel to ask - how does one get rid of the Energy dashboard in the default configuration? I found this: https://community.home-assistant.io/t/wth-cant-i-get-rid-of-the-energy-dashboard/467693, but cannot for the life of me figure out where to apply the mythical long press.
You can also select Edit from your profile page
My initial guess was clearly wrong.
Got it, thanks.
started working on some designs, gonna build these components next
is there any way to hide icons on the left sidebar? there used to be a custom-sidebar integration but it's deprecated now due to being nonfunctional.
I use Kiosk Mode https://github.com/NemesisRE/kiosk-mode
is there any way to do it system-wide and not per profile?
It is per dashboard but you can configure it for different users (hidden for the "tablet" user but not hidden for me) or just leave it default. Can also hide the header and various other buttons.
ty
Not sure if this is a template or a card question. It seems HA has something called templates to build strings. If I want a card to use tts to say the weather, how do I reference this string? Building the string in the template editor is pretty easy.
Write a script with the tts call with whatever message you want, and call that from whatever card you want
Tried that.
message: "Temperature is {{states('sensor.temperature')}}."
It literally says “temperature is states sensor dot temperature”
show_name: true
show_icon: true
type: button
entity: media_player.living_room
tap_action:
action: call-service
service: tts.cloud_say
target: {}
data:
entity_id: media_player.living_room
message: "Temperature is {{states('sensor.temperature')}}."
options:
voice: CoraNeural
show_state: true
icon: mdi:account-voice
name: Test
I understand that once working, I need to specify which sensor. Do they only work with certain card types?
I said: write a script and call it from the card
Most cards do not support templates
If they don't say they do, they don't
Oh, ok. So you use these templates in scripts?
Template = string builder for scripts?
They're not just one thing
That is one place
Look back through #templates-archived and see many, many examples
An entire page having nothing to do with scripts: https://www.home-assistant.io/integrations/template/
Morning all, not sure if this would be the correct place but i would like to make an icon suggestion. could we get numbered garage icons as more often than not we have more than one garage and up till now i have just named them differently but it would be ideal to have a method of identifying them just with the icon so that as an example on the watch app i can tell the difference.
Fuck off
On another note, does anyone know of any way to display a Google Maps route via an image card or similar? Obviously would need to call via Google's API but basically want to have an image card showing the best route between A and B.
Does this look like your personal advertising space? Get lost and go pilfer your wares elsewhere.
You knew exactly what you were doing. You joined a specific Discord for a specific topic, found a channel name that most closely resembled something related to Shopify page development and then spammed your crap.
I have a question regarding dashboards and websites. I know, you can embed websites with iFrames into your dashboard. But is there also a way to show websites, that block iframes? Imagine a browser inside of a lovelace dashboard in kiosk mode. Does someone knows something about that?
Maybe there‘s a reason these sites don‘t work in iframes?
In essence you want a traditional Html <frameset>. But this is not going to happen in lovelace nono
Hey everyone. I would like to have some GUI where I (or, more general, HA administrators) can configure devices to be automatically switched on/off depending on the solar energy excess. Currently, this can only be done using (very redundantly...) automations, I would like to provide a much more fancy GUI for that. But no idea how to start with adding such a thing in HA. It's more like just a card, maybe a dashboard? But... how to approach?
I'm familiar with HA integration development, but currently lack knowledge of frontend development. Some first hints would be great, thanks!
What I basically want to create is some kind of list of entries, where a user can add entities (e.g., switches, light, climate devices, e.g.) in a certain priority, defining their estimated energy consumption etc... On the backend side, as soon as enough energy for the device with the highest priority is available, this gets switched on. Then the second, etc.... and reverse, if there is a lack of energy. But no idea how to create a nice GUI for that in HA, involving a list (table) of already configured devices and their status, and a dialog to create/modify the parameters (priority, required energy, etc.) for these devices. Any hint?
Hi, since a few weeks (I am not sure if it came with an update) I am having problems with the UI. It hangs really often and is only getting healthy again after a reload. It happens on the Website (via browser) and also with the mobile app.
is there a known bug?
Is it possible to use a template for a picture url?
I have a input_text helper that separates several URLs and want to use a random value for a picture card.
I don't get this to work, but I do get a url when I use it in a markdown card for example.
- type: picture
image: >-
{% set values = states('input_text.text_sensor').split(',') %}
{{ values|random }}
Markdown that works:
type: markdown
content: |
{% set values = states('input_text.text_sensor').split(',') %}
{{ values|random }}
Most cards do not support templating or it is mentioned in the docs.
The picture card doesn't mention templating, so probably doesn't support it.
Markdown is one of the few cards that supports templating
Thanks. I'll need to think of another way then to get a random picture. Maybe use browser mod instead. Hmm...
Power consumption control
@glass ibex The stock cards, like @lyric prairie mentioned, offer a limited ability to customize the card. Consider, the custom:button-card https://github.com/custom-cards/button-card and the Mushroom card https://github.com/piitaya/lovelace-mushroom.
They are very customizable, but have a learning curve. The syntax is different between the two but concepts are the same. You can find a lot of examples here: https://community.home-assistant.io/t/fun-with-custom-button-card/238450 and https://community.home-assistant.io/t/mushroom-cards-build-a-beautiful-dashboard-easily/388590
Thank you!
Hello all, can someone give some advice on the topic posted here:
Does something like this already exist possibly?
Hi, can I somehow install this on my homeassistant version?
you can expose/hide entities from alexa/google if you want
@plain pike Is that only with the nabu casa though?
not the duckdns method as I am using
that's in HA, regardless of the method you use to connect remotely to alexa/google
@plain pike
The only option I seem to have is home assistant Assist and I'm reasonably certain that is because I'm not a nabu casa subscriber. Do you have any other thoughts if I may be in error.
I'm not a nabu casa subscriber and I have the option to expose to Alexa/google
it looks like you're exposing an alias
which says is supported by google home and assist
try looking at another entity
When I click expose entities at the bottom right, I get this list in photo above which says "to Assist"
did you integrate alexa manually ?
I did not, I actually use google assistant
but I did it through the google assistant integration
so go to your devices page
for your 'back patio light' when you click it you don't see expose to google?
Nope, but you could create button cards with a navigate action and remove them from teh sidebar if you like
also do you have default_config: in your .yaml?
let me check
@simple ridge I converted your message into a file since it's above 15 lines :+1:
I do
and you said you set it up manually using https://www.home-assistant.io/integrations/google_assistant/ ?
Yeah, that is the one I used
in your google_assistant: part, do you have an exposed_domains: ?
Yeah, I have all of that exposing from the text file
I was just hoping there was a way to do it through the gui
expose_by_default is an option
theres really no error checking etc when doing it through the text file. (I guess I just wish there was checkboxes etc. so you could turn on and off easier and not all of the pain)
Yeah, I see that. But then you end up with 500 entities exposed and showing in google assistant that are never used. But I do see your point about just exposing all and going on with it
expose by default, block the ones you don't want exposed?
Thats probably what I need to do. Invert my reasoning
Making things to complicated
So use expose by default and then under entity config set expose to false on every entity I don't want showing in google assistant?
Still seems like such a PITA for some reason.
But I do follow you on it.
Thank you for giving me some advice/ thoughts on this one
Morning all not sure if this would be
that's the thought process yes
Hi Guys, im trying to do my dashboard. Im not able to do a complete full row with some stuff on it at the top of my dashboard. Anyone have a idea ?
Can you post a screenshot of what you have so far? First guess is you're using the default Masonry view.
Look like this
i would like to pput at the top of that 1 single row with multiple thing
Like date time, Pool sensor door sensor
@plain pike Thank you!!
@plain pike For sure. Thanks again
no worries
Hi everyone, I'm trying to find a solution to print in a pretty way all of my automations.. ordered by day in a week for example. someone has an idea?
Two tabs in the same browser on the same dashboard, one works and the other has "Custom element doesn't exist: grid-layout".
Custom elements are loaded after everything else. And they get one shot. If something happens in the loading (network issues, processor spike, anything) it gives up. Refresh and it should work again.
There's also a timeout. If they don't load within that - too bad. In that case switching view and back again should work.
Overflow menu refresh I haven't seen work. Shift-refresh where I have to login to HA again sometimes works (Firefox). Is there a way to make this deterministic?
I'm wondering if it is is possible - I want to use browser_mod.popup (https://github.com/thomasloven/hass-browser_mod), and on the popup use a horizontal stack, with browser_mod.more-info in each colomn. Is that possible to do?
Checking the box to stay logged in would actually help for a start. Not 100%, but a bit.
Will do.
This trick would also help a bit for layout-card: https://github.com/thomasloven/lovelace-card-mod#performance-improvements
The popups only display cards. If you look around my repos on github, you may find something called more-info-card, though... No idea if it still works... most likely not.
Thankz - Will have a browse through. The end result I'm aiming for is having the more-info of my airconditioner and humidier showing on the popup. The popup is called with a tap-action on a state-label.
Even if they are below each other it will be acceptable, just trying to consolidte and minimise the icons on the picture elements card.
I don't see a local directory but I do see card-mod.js. Some voodoo maps "local" to www/community/lovelace-card-mod?
You'd want to do it with layout-card.js, though.
Also see the row below the code sample, about /hacsfiles/
File exists here: ./custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js
extra_module_url:
- /hacsfiles/lovelace-layout-card/lovelace-layout-card.js
?
Both tabs working so far. I can go back to beating my head on the wall over CSS. Thanks.
please don't do that, be considerate and think of how the walls feels
The following error keeps appearing when I restart:
Logger: custom_components.ui_lovelace_minimalist.base
Source: custom_components/ui_lovelace_minimalist/base.py:333
Integration: UI Lovelace Minimalist (documentation, issues)
First occurred: 1:17:51 PM (4 occurrences)
Last logged: 1:17:51 PM
HACS Frontend repo "button-card" is already installed, Remove it or disable include custom cards
HACS Frontend repo "light-entity-card" is already installed, Remove it or disable include custom cards
HACS Frontend repo "lovelace-card-mod" is already installed, Remove it or disable include custom cards
HACS Frontend repo "simple-weather-card" is already installed, Remove it or disable include custom cards```
Could someone point me to where I need to remove the duplicates?
can i get some help with a custom:button-card? i think i'm missing something
i'm copying the final code from this post into a manual card and its not working https://community.home-assistant.io/t/custom-button-card-change-icon-based-on-state/404287
Do you have the custom:button-card installed?
uh, no?
Do you have HACS?
yea
Search HACS > Frontend for button-card. Install. And refresh browser(s)
wow, i figured i'd be customizing the button card in HA, didn't think I needed a different one
The stock cards use plain names. Anything added will begin with custom:.
You'll also want to take a look at the docs for that card. There's a lot that it can do. https://github.com/custom-cards/button-card
thanks!
out of curiosity, could that if statement at the end be simplified? something like
if (states['switch.shelly_shsw_1_e8db84d7180f'].state === "on")
return "Open";
else
return "Closed";
or do you need to refer to the entity all the time?
Technically, that card can use entity as a variable if the entity was defined in the card, but you are also correct. yaml type: custom:button-card entity: switch.gargage-door label: | [[[ if (entity.state === "on") return "Open"; else return "Closed"; ]]]
aah
You can just remove the else
in my case the state and entity are 2 different sources
im just comparing it to what little powershell i know
i figured it could be simplified in some way
that's fine. The card can refer to one entity and the label can refer to the other entity.
You can condense it down to a single line if you wanted to.```yaml
type: custom:button-card
entity: person.derek
name: '[[[ if (entity.state === "home") return "At the house"; else return "Not at the house" ]]]'
And you can still remove the else
But removing the else won't return the proper label if he's looking for an Open/Closed label.
It will
You don't need 'else'. That's all I'm saying
Or just enjoy the else. Your call
You have the card looking at one entity but also the state of a different entity, right? Post your YAML so we can see what you have.
@hollow vale I converted your message into a file since it's above 15 lines :+1:
Is the state for the Shelly without _input changing? That's the state that the code is looking at. Label is looking at the Shelly_xxx_input entity.
uhhh
If you need the state of the Shelly_xxx_input then you'll probably want to create icon: and color: values. And not use state:.
the binary sensor is what reads the state
Although, an easier option might be to set the card to use the Shelly_xxx_input and then use a tap_action to toggle the Shelly_xxx entity.
i can add entity to tap_action?
you lost me
tap_action:
action: call-service
service: switch.toggle
service_data:
entity_id: switch.shelly1_98cdac0ce253```EDIT: Corrected service_data
Then, with the entity set to the binary sensor, just set up the state. ```yaml
entity: binary_sensor.shelly1_98cdac0ce253_input
state:
- value: 'on'
icon: mdi:garage-open
color: red
label: Open - value: 'off'
icon: mdi:garage-lock
color: green
label: Closed```
aah ok that did it
one more dumb question, whats the variable for dark mode primary color?
i can do var(--primary-color) but that gives me the brighter blue, i want the darker steelblue, but the card doesn't seem to know what that is
i don't want to hardcode a value because if i change the theme it won't change
You have selected this in the configuration of the integration.
Because you already installed the frontend cards through HACS, you should consider to deselect the option. As that will essentially double load the js-files as mentioned by the error
Is it possible to get the old more-info layout for switches and input_booleans?
A browser-mod perhaps? I have googled quite a lot, but no luck so far.
I'm fine with the new format for lights, but for my heaters, poolpump and so on, it is kind of not-awesome to get the new mega-large button. And then another click to see when it was on/off.
Especially when on a a computer/large monitor. The old layout suited me better for those switches.
@fallow wyvern I converted your message into a file since it's above 15 lines :+1:
Hi,
I would appreciate any help with MQTT COVER.
My garage door sends OPEN, CLOSE, OPENING, CLOSING, STOP states to this topic:
publish stat/sonoff/brama/state
I'd like to have animated garage door switch
cover:
- name: "MQTT Cover"
state_topic: "stat/sonoff/brama/state"
qos: 0
retain: true
state_open: "OPEN"
state_opening: "OPENING"
state_closed: "CLOSED"
state_closing: "CLOSING"
optimistic: false
value_template: "{{ value.x }}"
To format your text as code, enter three backticks on the first line, press Shift+Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
Is it possible to make a tile to open and close a sliding gate?
Or add text instead of arrows
Where in the settings do I find this page?
Settings > integrations
Thank you!
Hi you all, just a quick question:
is it possible to have colored buttons (off and on state) in de standard horizontal stack / button card ?
Thanks TheLobster; and how? with state_color ?
Assuming you mean you want to have custom colors for the on/off state of a button card. You can do it with card_mod. Here's an example that I have to get you started. (I combined some of the lines at the end of the code to make it fit within the 15 line restriction.)```yaml
- type: button
entity: light.hallway
card_mod:
style: |-
:host {
{% if is_state('light.hallway', 'off') %}
--card-mod-icon: mdi:light-switch-off;
--card-mod-icon-color: red;
{% else %}
--card-mod-icon: mdi:light-switch;
--card-mod-icon-color: green;
{% endif %}
}
ha-card { border: none; }```
Here's another example if you need to compare numbers and set the options:
@tribal galleon I converted your message into a file since it's above 15 lines :+1:
thanks! did not know about the card_mod
there is so much information that for beginners it is hard to find what you are looking for
Agreed. Also, the stock cards don't offer a lot of customizability. They're okay, but the community has created a lot of good stuff. Card_mod is going outside the realm of the basics. Something like the custom:button-card can do what you want and a bunch more. #frontend-archived message
@tribal galleon how to do one button without text? just one solid color. I'm trying to build a color picker for my RGB led's which are controlled by IR with the broadlink RM4 thingy
show_name: false
show_icon: false```
but that may lead to some sizing issues...
I use the custom:button-card for similar function.
show_name: false
show_icon: false
styles:
card:
- border-radius: 50%
- height: 75px
- width: 75px
- background-color: rgba(255, 0, 0, 0.5)```
you should always clear your browser cache
Style won't work for the button card. Example is for the custom:button-card (available through HACS). https://github.com/custom-cards/button-card
and...that
trying..............
.......................I'm confused, I thougt we where still talking about the card-mod ?
for me it is best to have the most simple option, which would that be? the button-card or the card-mod ? thanks
I have 2 sidebar entries "UI Lovelace Minimalist" for two dashboards which got installed. It seems to be impossible to change the name which appears in the sidebar. Opened in Settings/Dashboard, the three dots menu does not have a "raw configuration editor", and Edit Dashboard says edit UI not available when in YAML mode. Nothing that I change in the YAML for those dashboards has any apparent effect on the sidebar.
IMO, ultimately, the button-card will probably be the best route to use; you'll probably end up using it at some point in the future, especially when you've out grown the stock cards' usefulness. Card_mod, again IMO, is good for the occasional tweaks and adjustments.
You can configure everything here in the config_flow #frontend-archived message
Note that Minimalist due to some HA limitations does not support the GUI/raw-editor
Thanks you all, I have a meeting to attend. back tomorrow. @lyric prairie what is config flow ? That is also new for me.
I don't understand where to find what you've linked to.
Config flow is the technical name for the GUI menu you use to configure an integration
So there I've now changed the sidebar title of the adaptive view. Don't see how to change the other one yet.
Oh it's just called Side panel title, got it now.
does anyone know what am I doing wrong here?
the card on the left is taking the color no problem but the one on the right not so much
My guess is your entities. The first one is using an automation which has a state. The second, you have set to the script which does not have a state.
I would agree with "they only have an 'on' state if they have a delay", but they all have an "off" state if they're not running
I'm not sure what "no state" means for their entities
I looked at DevTools and the only script that I have does show a state of off. Running it happens so quickly that I never even see it change to on. The coloring that luckymethod is using is right, by default; gray = off, blue=on (or should be red in their example).
I think the easy fix for the issue above would be incorporating an input_boolean helper (for drumming or not drumming), styling based off that, and coordinating the tap_action to run the appropriate script.
script vs automation actually makes sense that's useful thanks
so I guess the mushroom cards don't allow to recolor the icons for scripts, that's too bad
@blissful tundra Yes and no. I'm working on something that you might like using the mushroom-template-card. Gimmie a few minutes. (I'm re-learning how to do it.)
Does anyone have a working example of a custom:grid-layout nested within a custom:grid-layout?
Never mind, I found the right incantation.
@blissful tundra So this kind of works. It does need an input_boolean helper to help with the state. You'll want your automations to toggle the helper appropriately.
I have most of the card set up properly but I cannot figure out how to choose which automation gets call depending on the state. But, for now, it works with tapping to start, double tapping to stop. https://pastebin.com/pxg1yjqh
Is there a card that can display 2-3 different lights/icons/colours based on a sensor?
I'd like to display my tarriff (peak/offpeak/shoulder) as red-orange-green "traffic lights"
I think you need to create a template sensor, where you can define the icon, then display that sensor in the card. if you're not using a custom card.
@prime narwhal Are you trying to have one icon that changes color (red, orange, green) and three icons (red, orange, green) that "illuminate" based on the state?
Both options are possible. But, like @dusty summit mentioned, it will depend on the card you're trying to use. (Stock cards can be used but probably have to use card_mod.)
Ideally in an entities card. Either three, with one "lit", or one that changes colour . Whatever is easier...?
to replace the text tarrifs above
Those values are actually the tariffs set into a utility_meter helper
Would it be acceptable if, for example, the dollar signs next to "Current Elect..." were to change color? Then, you wouldn't need the Traiff entities shown.
It's kindof nice being able to click on it, and see the tariff switch at particular times, But I guess a color change would be OK.
I already have template sensors for the values...
eg
- name: "Electricity Tariff"
state: "{{ 'peak' if today_at('15:00') < now() < today_at('21:00') else 'offpeak' }}"
Maybe I can just set icon_template?
but that would just change the icon (maybe) not the colour
I was thinking of incorporating some card_mod into each entity where it wouldn't be hard to change the icon colors.
lol
@hollow vale I converted your message into a file since it's above 15 lines :+1:
@hollow vale yaml tap_action: action: call-service service: switch.toggle service_data: entity_id: switch.shelly1_98cdac0ce253
If you used my code from before, it did not work. Not sure why. Experimenting because it should have worked.
I am looking for something to display a string on the dashboard but that string would likely be different on a daily basis. I was thinking of using my node-red instance to send the new string each day. Any suggestions?
shove it in an input_text, display that?
Thanks.. I have tried that. is there a way I can have it as read-only on the dashboard. I want node-red to change it but not people.
@green pivot Take a look at the markdown card. https://www.home-assistant.io/dashboards/markdown/ yaml type: markdown content: '{{ states("input_select.navigation_test_variable") }}'
type: markdown
content: '{{ now().strftime("%m/%d/%Y, %H:%M") }}'
Or if you want to really start messing around with it...
@tribal galleon I converted your message into a file since it's above 15 lines :+1:
I’m getting this error when I open the overview tab, then I make refresh and it resolve until I open the overview tab again. “Error loading the view strategy: TypeError: undefined is not an object (evaluating ‘e.entity_id’)”
I’m using version 2023.6.2
You could have node red also populate the text into a sensor instead of an input text, then nobody could change it.
How would I create a custom sensor?
Sensor node from node-red-contrib-home-assistant-websocket. You need the nodered companion integration installed, and then there are nodes in NR which create HA sensors, and when you send a payload to them they update the state/attributes.
Thanks, do they keep history on HA reboot?
I don't recall sorry.
all good. I will have a play. thanks for the info
Hi everyone
I've a question regarding UI.
I'm using YAML mode to add cards but I found that I can edit UI while using YAML by entering ?edit=1 at the end of the URL access. It's normal ?
yes
(try not to edit it twice at the same time. you'll probably lose the non yaml update.)
Ok, tk a lot!
(as long as I'm understanding you correctly, that is.)
I use my SONOS as alarm clock in the moring. Working great, except my teen agers don´t fancy the radio playing outside their bedrooms when school is out. My alarm clock script group all SONOS players, so I need to tweak that, and I would like some control of what SONOS speakers should be playing somehow in the GUI, I guess. I could make one input_boolean for each speaker and toggle those on/off, and testing for this in the script some how.
Any good ideas how to achieve this?
Two questions on media cards.
- I set my cards to only display if there is music playing, so I don't get cluttered with 13 devices if 12 of them aren't even playing music, but is there a way to set a time-out/delay so if I pause music, it doesn't hide the card for like 5 minutes or something, in case I was just pausing for a moment to take a phone call or something?
- Is there a way to "combine" cards to only show one card if they're all playing the same audio? I use either AirPlay or Alexa Multi-Room Audio most of the time and don't need a bunch of cards to all be showing the same thing.
http://img.wtwap.net/230622135922781.png
You could set up two Home assistant groups and have a single toggle for "kids off" and set the sonos group based on that.
You could use a Template card and a template to pull out the various music then list it.
Could you elaborate on that?
Presumably you know how to set up groups in Helpers. Then you can use an if in your automation to pick one group or the other.
Frankly I´ve never used the Helpers 🙂
Here is my entire script for my morning radio: https://paste.debian.net/1283872
Trying to control a Denon receiver in my effort to learn HA. Integration docs say:
To use these commands, call the denonavr.get_command service and append the specific command to the path /goform/formiPhoneAppDirect.xml?:
I understand “append the command to the path “
Then what do I do with the resultant path + command?
This seems to be one of those things that HA users just know, but it’s not really documented anywhere
Tried this in a script, based on googled examples, but it says message malformed extra keys not allowed
service: denonavr.get_command
service_data:
entity_id: media_player.denon_avr_x1700h
command: /goform/formiPhoneAppDirect.xml?PWON
I have a Denon but I use Harmony to control it
lol
I should turn it on and integrate it tho
If the integration actually works..
it did for me many moons ago
but this is a brand new install I'm on
haven't actually plugged it in since I did this install
Any idea how you enter/specify the extra needed data?
I learned never to try it in cards first, because every card uses a different language/syntax
I’m supposed to supply the entity id and command somehow. Reading a Denon technical manual was easy. Figuring out undocumented HA yaml syntax is the hard part
Figured it out. It should be service: instead of service_data: depending on where you are entering the yaml in HA. Anybody know why it is not consistent and how you know which to use where?
it is consistent as of several builds ago
you can use data: everywhere
(assuming that you use built-in cards)
Correct, but service_data vs data in different places
not any more
it is consistent as of several builds ago
you can use data: everywhere
Yes. I can use “service” everywhere, but not “service_data”
o...k... it's consistent, just not in the way you wanted?
don't use service_data: anywhere
Ok, so it works some places, but “data” now works everywhere?
Got it! Thanks!
sorry, it's been a while since I used standard cards
you should be able to use
service: whatever
data:
whatever:...
everywhere, even in cards now
I was trying to use a script and all the examples I saw used “service_data”
Thanks! Much clearer now
type: custom:button-card
name: 'off'
tap-action:
action: call-service
service: denonavr.get_command
data:
entity_id: media_player.denon_avr_x1700h
command: /goform/formiPhoneAppDirect.xml?PWSTANDBY
This card does nothing when tapped
This script works fine
service: denonavr.get_command
data:
entity_id: media_player.denon_avr_x1700h
command: /goform/formiPhoneAppDirect.xml?PWSTANDBY
That, of course, is a custom card and what we discussed earlier doesn't apply
Gotcha. So, I should read the docs for the custom card for syntax?
type: custom:button-card
name: 'off'
tap-action:
action: call-service
entity: media_player.denon_avr_x1700h
service: denonavr.get_command
service_data:
entity_id: media_player.denon_avr_x1700h
command: /goform/formiPhoneAppDirect.xml?PWSTANDBY
No luck. Latest attempt.
I configered some actionable popups using browser mod for confirmation before turning off a switch https://github.com/thomasloven/hass-browser_mod/blob/master/documentation/popups.md#actionable-popups
however, I would only like to show them when the switch is on
is there something in browser mod which I can use for that? I tried a if-then in a browser mod sequence, but that only seems to accept service calls
Using the service call in a script and evaluate there if the switch is on. Call that script from the card instead of the actionable popup
Using the DenonAVR integration. You’re supposed to do a service call to get the status of various things. What does that look like in JavaScript or any other card? For example, I’m calling denonavr.get_command with command: /goform/formiPhoneAppDirect.xml?Specificquery.
I’m guessing it’s some function in place of something like entity.attributes.volume_level
state_attr doesn’t seem to be for service calls
Have you also read this
Most actions can be done with the mediaplayer service call
No need for explicit API calls
So the turn_on command in custom:button-card should be something like:
tap_action:
action: call-service
service: media_player.turn_on
service_data:
entity_id: media_player.denon_avr_x1700h
To get the status of the device just go to dev-tools/states and search for the entity_id
That will give you the current state and all of its attributes
All available information is already coupled to the entity
Yes. I’m trying to read status info back. For example, it I want to know if the tuner is in auto/manual mode I call denonavr.get_command with the command data: /goform/formiPhoneAppDirect.xml?TMAN?
With the same integration I have all this info within HA without doing calls myself to the API
If the device is on it will display even more info like selected source etc...
If I want to know what the bass level is set to for zone2, end the command with .xml?Z2PSBS ?
I know that those properties exist
For the other properties, you’re supposed to use the command with these parameters and get a return-value. I’ve never done a service-call with a return value before. How do you do it?
Will probably use the return value to toggle button states. For example: am/fm
It's a command to the receiver, I don't think it will return any value.
At least it is not documented as such
Maybe someone in #integrations-archived can tell you more about the command
Thanks!
Where did you find that the command should return a value?
The Denon docs from Denon that are linked to in the integration docs. For example: ANAUTO at the end of the command sets tuning to auto. ANMANUAL sets to manual. AN? returns the current setting.
Yes the command does set the tuning. Does not even have a response. And even when there is a response you will probably need a get_response call to receive the response. That is not supported. So only one-way commands according all the documentation and if I understand it correctly😅
The Command "AN?" is supposed to return the current selected tuning mode. What do you mean get_response is not supported?
I'm still new to HA. I'm not familiar with the get_response command
HA documentation only talks about sending a command, not receiving a response.
Even if the Denon API supports it, that will not mean that HA supports it
So in general, there is no way in HA to read a custom setting/value?
Unless it is an already-supported sensor/property in the integration?
Yeah I guess so
So, no such thing as a custom sensor?
Not with the existing integration
I had that, but there can be issues with the device id, if you use it directly on the frontend you won't have that
hey folks, question, is there a way to view the time remaining on an automation in a card
its not a timer, its an automation that is called when you press a button with a delay
Nope