@finity you were right!! the “>” was the missing piece.
I read the @Didgeridrew suggestion, but, as I’m a ‘hardware guy’ I googled ‘python multi-line quote symbol’ and couldn’t find anything useful
Hi all, I am not at all good with templates but I’m trying to use one in a Markdown card to extract the date only from a timestamp, but don’t really know how to do it. Wondering if someone can please help me.
type: markdown
content: >-
**ON THE WAY:**
{% for package in
states.sensor.seventeentrack_packages_in_transit.attributes.packages %} **{{
package.friendly_name }}:** Last tracked on {{ package.timestamp }} {{
package.info_text }}.
{% endfor %}
In the above I’d like the timestamp to only show the date, in the format dd-mm-yy. Could someone please show me how this is done, if it is actually possible?
Probably you can help me. I have no idea what I am doing wrong. I am trying to get m GameDay sensor right (which I did with this tutorial Create an "Upcoming Sports Game" card with Google Calendar) I was already writing down my request in this group but no one could help me
I used the sensor configuration everyone else has but it shows not what it’s supposed to. It should be like "next Game Saturday 26th at 15.30 but instead it’s formatted terribly
Thats my code
#Eintrachts Next Up Date
- platform: template
sensors:
eintracht_date:
entity_id: calendar.eintracht_frankfurt_spielplan_profimannschaft
friendly_name: Eintrachts next game
value_template: >-
{% if is_state('calendar.eintracht_frankfurt_spielplan_profimannschaft', 'on') %}
Playing Now
{% else %}
{% set st = state_attr('calendar.eintracht_frankfurt_spielplan_profimannschaft', 'start_time') %}
{% if st != None %}
{{ as_timestamp(st) | timestamp_custom("%A, %b %d at %-I:%M %p") }}
{% else %}
No games scheduled
{% endif %}
{% endif %}
#Eintrachts Next Opponent
- platform: template
sensors:
eintrachts_opponent:
entity_id: calendar.eintracht_frankfurt_spielplan_profimannschaft
friendly_name: Eintrachts Next Opponent
value_template: >-
{{ states.calendar.eintracht_frankfurt_spielplan_profimannschaft.attributes.message }}
Yes, so if you were to take the +1 hour of your time zone and subtract it from local you get utc. If the input time is local, then you need to convert it as a local timestamp, not utc like you’re doing
This is both of you not understand that the conversion is treating the sting as utc. Make it timezone agnostic by removing the Z. Then use as datetime and as local
Yes there’s 3 types of datetimes: local, utc, and none. None has no concept of a what timezone it is, so you can then attach one to it… by using as_local.