So the swipe navigation isn’t working now and I don’t see an option in cch settings?
NVM I see I now need to enable it in lovelace - is that for every card or only first card?
So the swipe navigation isn’t working now and I don’t see an option in cch settings?
NVM I see I now need to enable it in lovelace - is that for every card or only first card?
Only for first card?
All config in first card only
Man, I can’t wait to get home and update CCH. Been looking forward to Swipe and Ranges. WOOHOO!!!
had already tried that yes, but unfortunately no succes.
Having copied your last post exactly in my main config, only thing left I can imagine is a setting in the view itself. I havent got a number there, so maybe that’s it?
this is my view:
title: Phones & Tablets
path: phones_tablets
icon: mdi:alert
# custom-ui JS template
# {% set state = states('sensor.family_home') %}
# {% set mapper = {'0': 'mdi:account-off',
# '1': 'mdi:account',
# '2': 'mdi:account-multiple',
# '3': 'mdi:account-multiple-check'} %}
# {{ mapper[state] if state in mapper else 'mdi:account-group'}}
# Jinja template
# {% if is_state('sensor.family_home','0') %} mdi:account-off
# {% elif is_state('sensor.family_home','1') %} mdi:account
# {% elif is_state('sensor.family_home','2') %} mdi:account-multiple
# {% elif is_state('sensor.family_home','3') %} mdi:account-multiple-check
# {% else %}} mdi:account-group
# {% endif %}
badges:
- sensor.home_badge
cards:
- type: custom:compact-custom-header
- !include /config/lovelace/tiles/tiles_family.yaml
and this my CCH main config:
# https://github.com/maykar/compact-custom-header/wiki/Main-Config-Options
type: custom:compact-custom-header
main_config: true
header: true
menu: show
options: show
chevrons: true
exceptions:
- conditions:
user_agent: iPhone
config:
menu: hide
notifications: hide
header: true
options: hide
conditional_styles:
- template:
tab:
12:
- icon: >
if (entity['sensor.family_home'].state == '0') 'mdi:account-off';
else if (entity['sensor.family_home'].state == '1') 'mdi:account';
else if (entity['sensor.family_home'].state == '2') 'mdi:account-multiple';
else if (entity['sensor.family_home'].state == '3') 'mdi:account-multiple-check';
else 'mdi:account-group';
Update
well, don’t know why, but all of a sudden the icon snapped into place! Hope this is here to stay, as it was one of the niceties regular HA had over Lovelace. You’ve just made my day thank you very much indeed!
I’ll leave the post as it was, for reference to other community members.
@mayker, can I just suggest you have an error in the docs? (It was looking at @Mariusthvdb post that showed me why mine wasn’t working )
Should this:
- type: custom:compact-custom-header
main_config: true
conditional_styles:
- template:
- background: > # Style the header's background can use CSS colors or background images.
if (entity["input_boolean.living_room"].state == "off") "#000";
else if (entity["input_boolean.living_room"].state == "on") "url('/local/bg.jpg')";
- tab:
3: # Number of the tab to style.
- icon: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "mdi:account";
else "mdi:account-off";
- color: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "blue";
else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
be this:
- type: custom:compact-custom-header
main_config: true
conditional_styles:
- template:
background: > # Style the header's background can use CSS colors or background images.
if (entity["input_boolean.living_room"].state == "off") "#000";
else if (entity["input_boolean.living_room"].state == "on") "url('/local/bg.jpg')";
tab:
3: # Number of the tab to style.
- icon: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "mdi:account";
else "mdi:account-off";
- color: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "blue";
else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
haha. well you never know who you help with posting a bit of a struggle…
must say I am a bit confused with the need for dashes in this config.
So used to only needing them when more than 1 item is listed, I would think (in my specific icon template) to need this:
conditional_styles:
template:
tab:
12:
icon: >
if (entity['sensor.family_home'].state == '0') 'mdi:account-off';
else if (entity['sensor.family_home'].state == '1') 'mdi:account';
else if (entity['sensor.family_home'].state == '2') 'mdi:account-multiple';
else if (entity['sensor.family_home'].state == '3') 'mdi:account-multiple-check';
else 'mdi:account-group';
instead of:
conditional_styles:
- template:
tab:
12:
- icon: >
if (entity['sensor.family_home'].state == '0') 'mdi:account-off';
else if (entity['sensor.family_home'].state == '1') 'mdi:account';
else if (entity['sensor.family_home'].state == '2') 'mdi:account-multiple';
else if (entity['sensor.family_home'].state == '3') 'mdi:account-multiple-check';
else 'mdi:account-group';
And a quick, hopefully simple question…
What can I use here in the else
to revert the colour back to the ‘normal’ one?
e.g.
'var(--SOMETHING-HERE)'
- color: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "blue";
else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
@Mariusthvdb you’re absolutely right, you shouldn’t need the hyphen when you only have one item. It should be considered a bug and I’m on it.
@klogg Give this a shot.
- color: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "blue";
else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
else "var(--SOMETHING-HERE)";
Sorry, my fault, I wasn’t clear…
I want to know what the SOMETHING-HERE
is to point to the default color of the tab icons
Sorry, try this:
- color: > # MDI icon for tab or button.
if (entity["device_tracker.galaxys8"].state == "home") "blue";
else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
else null;
Let me know if that works for you, I may need to make a change if it doesn’t
wouldn’t that be 'var(--paper-item-icon-color)'
cool. You do breath in between releases do you…? relax…
I love @mayker ‘s work but @RomRider is just KILLING it in the new features stakes! I hope neither of them burn out and take some time to enjoy the roses.
OH, IT’S ON like donkey kong! You’re going down @RomRider!
Once I work out the kinks of the current features I’m going to slow down considerably.
I hadn’t noticed that someone took up button-card, need to check out the new features. I stopped using it a while back when development on it slowed and entity-buttons were introduced.
You will be astonished at what he’s done with it!