I have made a platform in configuration.yaml to display month and day and time. It displays the day in lower case while the month begins with a capital letter. I would like it all to display in upper case if possible. It’s okay if only the first letter is uppercase (for example Thursday).
I have finally upgraded HA after using an old version for a few years. This is in my configuration.yaml:
sensor:
- platform: template
sensors:
dayoftheweek:
value_template: >
{% set dag = states('sensor.date') %}
{{ now().strftime("%A") | lower }}
month:
value_template: >
{% set maanad = states('sensor.date') %}
{{ now().strftime("%B") }}
dateofthemonth:
value_template: >
{% set datum = states('sensor.date') %}
{{ now().strftime('%-d') }}
Then i have used the raw configuration editor and have copied from my old HA system:
I might be missing something, but why do you translate the day in the template to lower case to begin with?
strftime(“%A”) applied to a datetime object will return the day starting with uppercase
And while on the subject of deprecation: it looks like you are using card-mod to style the markdown card.
If you update to any version > 3.4 (and you should - version 4 is out to keep up with the latest changes to the HA frontend), then you need to add the card_mod: key to all your styles.
Edit: jinja2 also has a capitalize function/filter if you ever need to do this in a template (as opposed to correcting the original sensor, which does seem like the more sensible solution).
Sorry if I’m just not understanding, but I just installed this Home Assistant from scratch and haven’t added card mod js. I copied the code for the sensors into my new HA instance. How do i remove the references to card mod because I’m fine with the style i currently get?
Just to be clear, the advice about card-mod was In reference to your markdown cards on your dashboard - not related to your sensor configuration.
It should be enough to have your markdown configured like this, deleting everything under the style: key, which wouldn’t be doing anything without card-mod installed anyway.
Thank you, I removed all instances of style so references to card mod should be gone. Now I just wonder about the template platform, how I should change it.
I’m so new to all this I’m still on the far, lower left of the Dunning-Kruger curve. That being said, isn’t there a space missing in this line of OP’s configuration?