impeham
(Liran)
April 9, 2019, 8:48am
1
what is the process for using icons from local storage for buttons for example - i’m using the following:
cards
cards:
entity: automation.game_neon_mode_set
icon: ‘mdi:reload’
name: Game Neon Mode Reset
tap_action:
action: call-service
service: mqtt.publish
service_data: RESET
type: entity-button
i want to replace the icon:mdi with a local file, but when i try something like ‘icons/xxx.png’ it doesn’t load it (the file is located in HASS/icons folder). am i doing it right?
are there any restrictions related to png resolutions?
tom_l
April 9, 2019, 10:36am
2
The file has to be in your config/www
directory (or a subdirectory there of).
If you dont have a www directory in your config folder, create one and restart HA.
You then can specify local icons or images like this:
/local/your_subdirectory_if_you_have_one/your_icon.png
1 Like
impeham
(Liran)
April 9, 2019, 12:32pm
3
i’ve put the file in /config/www, but isn’t found by the card configuration - i’ve tried these:
icon: local/neonmodechange.png
icon: /local/neonmodechange.png
icon: www/neonmodechange.png
icon: /www/neonmodechange.png
but none works
Pippyn
April 9, 2019, 12:36pm
4
You shouldn’t use icon:
, but entity_picture:
. You can do that with customize entities
impeham
(Liran)
April 9, 2019, 12:41pm
5
not sure i understand - i try the following:
cards:
cards:
entities:
input_select.gameneon_mode
type: entities
entity: automation.game_neon_mode_set
entity_picture: /local/neonmodechange.png
name: Game Neon Mode Reset
tap_action:
action: call-service
service: mqtt.publish
topic: home/gameneon/setmode
service_data: RESET
type: entity-button
type: horizontal-stack
the yaml is valid, but entity_picture isn’t showing the png
Pippyn
April 9, 2019, 12:56pm
6
No you can’t set the image in lovelace (that i know of) you’ll have to do that via the customize entities. View the docs I linked in my previous post.
1 Like
tom_l
April 9, 2019, 1:08pm
7
It depends on the card. For example, it works in the custom tiles card:
- column: 3
entity: script.lounge_kodi_player_skip_fwd_10
icon:
value: /local/icons/fast-forward-10.png
row: 5
impeham
(Liran)
April 9, 2019, 6:01pm
8
oh i see your point - will check that out thx.
impeham
(Liran)
April 9, 2019, 9:56pm
9
i tried to set it up using customization but couldn’t get it working.
the card
cards:
entity: automation.game_neon_mode_set
name: Game Neon Mode Reset
tap_action:
action: call-service
service: mqtt.publish
service_data:
topic: home/gameneon/setmode
payload: RESET
type: entity-button
type: vertical-stack
the following is in configuration.yaml under “homeassistant:”
customize:
automation.game_neon_mode_set:
entity_picture: /local/www/neonmodechange.png
the configuration is valid, but still - the image is not loaded
is that even possible for a type_button defined in the UI? if not - is there a push button equivalent with the same properties that can be added to yaml configuration instead?
tom_l
April 9, 2019, 10:01pm
10
Read my post again. The url is local/ not local/www/.
Also please format your posts correctly.
impeham
(Liran)
April 9, 2019, 10:08pm
11
the png file is located under config/www - was my path wrong?
how do i format the code paragraph - can’t see an option for that in the editor…
tom_l
April 9, 2019, 10:11pm
12
The www folder is accessed by using /local in HA. Not /local/www/
There should be a banner at the top of the page explaining how to format your post unless you’ve hidden it.
impeham
(Liran)
April 15, 2019, 8:24pm
13
still having a problem to set the png for entity_button but i made a test and tried to customize a switch defined in my configuration with
switch.candles_power:
entity_picture: /local/neon.png
this works, however, changing “switch.candles_power” to “automation.game_neon_mode_set” for a UI entity-button type created in lovelace like the following isn’t working - so a picture cannot be set for entity-button? is there an equivalent non ui type for push button?
cards:
- type: entities
entities:
- input_select.gameneon_mode
- tap_action:
service_data: RESET
service: mqtt.publish
action: call-service
entity: automation.game_neon_mode_set
icon: 'mdi:reload'
type: entity-button
name: Game Neon Mode Reset
type: horizontal-stack
Did you find a way in the end? I am struggleing to change the icon of a media_player and would like to know how to achieve that.