Cool works thx
It even shows the °C after the state
Cool!
Thx mate
Any idea when the title problem will be fixed?
mayker
(maykar (pronounced "maker" with a southern accent))
87
I don’t really give estimated times for anything like this anymore. Currently working 2 jobs, trying to finish up a large project due for my coding bootcamp, and, most importantly, keep the family happy.
When I give time frames for fixes or feature implementations it just adds to the pile of stress I’m trying to manage, so I need to stop doing it. Explaining it here so that I can just link to this post when someone else asks a similar question
Can somebody help me with my custom header? I want my text to be aligned to the left (as opposed to the icons to the right). And at the same time change the style options (font-family and font-weight).
This is what I have now:
I use the following code (that I have copied and mixed from this thread )
Ok, sorry for this, it was indeed both an obvious AND newb issue.
Should have removed compact mode: true.
A possibly total newb or obvious question: I 'm getting a Your configuration contains comment(s), these will not be saved. Do you want to continue? message when trying to use the vertical scroller in the raw configuration editor. Do I have to be using yaml mode for lovelace, or is there something else that I’m missing?
custom_header:
compact_mode: true
default_tab: >-
{% if is_state("media_player.playerkatana", "playing") %}1{% else %}0{%
endif %}
button_text:
options: >-
{{ hours24 }}:{{ minutesLZ }} <br><div style='display:inline-block;
height:22px; width:22px; vertical-align:bottom;'><ha-icon
icon='mdi:weather-{% if is_state("weather.home", "partlycloudy")
-%}partly-cloudy{%- else -%}{{ states('weather.home')}}{%- endif
%}'></ha-icon></div> {{ states('sensor.temperature_38') }}°
header_text: >-
<style>
#flipper {color:#999;}
#flip {height:24px;overflow:hidden;}
#flip > div > div {color:#fff;height:24px;margin-bottom:24px;display:inline-block;}
#flip div:first-child {animation: show 10s linear infinite;}
@keyframes show {
0% {margin-top:-144px;}
5% {margin-top:-96px;}
33% {margin-top:-96px;}
38% {margin-top:-48px;}
66% {margin-top:-48px;}
76% {margin-top:0px;}
100% {margin-top:0px;}}
#flipper p {position:fixed;color:#999; }
</style>
<div id=flipper><div id=flip><div><div>
{{states('counter.count_espresso')}} coffees today</div></div><div><div>
{{states('sensor.total_48h_precipitation')}}mm precipitation during the last 48 hours</div></div><div><div>
Sonoff 2 was on for {{states('sensor.sonoff_2_on')}} minutes today</div></div><div><div>
{{states('counter.count_espresso')}} coffees today</div></div><div><div>
swipe_nav:
animate: swipe
prevent_default: true
skip_tabs: 5
swipe_amount: 10
wrap: true
title: ''
views:
mayker
(maykar (pronounced "maker" with a southern accent))
92
Sorry, late reply. You had a couple of unclosed divs, didn’t break anything, but you want to make sure that each div has and opening and closing tag. Also, it looks like you’re using reverse_button_direction: true so that’s what I based the changes below on.
Essentially all I did was remove the unneeded first <div> tag, made sure the text element’s div had a closing tag </div>, and gave it a style to push it to the right float:right; and a font font-family: Comic Sans MS, cursive, sans-serif; (fogot to add a font-weight, but just add that to the same style in the first div)
I’m trying to change the header to get a spotify style footer using the latest version of CH. But when I scroll down to the bottom of the page the bar scrolls.
Is there anything I can do to fix it?
mayker
(maykar (pronounced "maker" with a southern accent))
100
Sorry for the late reply on this one. This is a really creative use of templates, very cool. I’ll have to test this a bit once I get one of my iOS devices up and running again. On Android, and any other browser really, it doesn’t let you scroll past the bottom of the page like that, but you might want to play with view_css: to add padding or a margin to the views bottom or one of the other advanced styling options may help.
Hi, I tried this but it’s not what I meant (sorry if my idea was unclear). Basically I want to recreate this (see below) as a custom header. I now use two markdown cards for the text (the bottom text are multiple markdown cards each wrapped inside its own conditional card, to only show when a certian sensor is on) and button cards for the icons (tied to the same sensors).
The downside of this way is that I have to copy it to each lovelace tab and that it’s gone when you scroll. That’s why I want to recreate this exact layout as a custom header that’s always there. So welcome text on the left, under there conditional text based on entity states and sensors on the right.
This is when there is an alert: the icon turns orange and the orange text apears (using markdown wrapped inside a conditional card). When multuple sensors are on, the markdown cards will swipe vertically (wrapped all the cards inside swiper card with autoplay parameter )
Perhaps this is a little too much to do in Custom Header, but I have seen other things like vertical text swipes and sensors. So I have hopes this is possible If the bottom text is too much, I’ll be more than happy to just have the welome greet on the left and the icons on the right (so without the bottom text in orange).
mayker
(maykar (pronounced "maker" with a southern accent))
102
It’s possible for sure and you’re a bit of the way there already. It will be trial and error, and you may even need to modify the styles of multiple elements with advanced styling. All of this isn’t really a feature or supported in CH, it’s a happy accident that you can insert your own HTML and CSS that can be templated with Jinja.
just thinking out aloud here, but since the above markdown setup could be written as an !include, probably even is, (believe that’s how Jim added it to all views in his Theme package before),
wouldn’t it be nice if we could somehow import that as an !include in the custom header? Must admit I haven’t tried or investigated that yet, but it would seem feasible, at least conceptually…
This above is not something I got from Jim, I designed/coded my own lovelace view. I do know he has some kind of notifications as well, but I have not looked into his code to see how he created his.
Using !include inside the header_text would be amazing, provided it also carries over the style options…
I think what would be amazing (and open up a LOT of new doors) is if HA allowd us to pin a card in the screen. This way you can create your own banner/header pin it and it will always be at the op when scrolling. You’d need to copy it to all tabs, but that’s a small price to pay (I think you can just create an !include to easily duplicate it).