I have a sensor with some attributes that are actually just hour numbers, like
hour_1: 8
hour_2: 9
hour_3: 10
hour_4: 11
I am trying to extract these values and show them on a markdown card, but its acting up.
If I do below setup I get nothing out.
type: markdown
content: >-
{{ state_attr('sensor.weather_birkerod_hours_forecast','day0_2_hour') }}
If I do below, which have just an added h, then I get both the sensor value and the h printed out.
type: markdown
content: >-
{{ state_attr('sensor.weather_birkerod_hours_forecast','day0_2_hour') }} h
If I do below, where I try to get a leading 0 on single digit values, then I get the single digit values with the leading 0 printed, but the double digit that require no leading 0 will not be printed.
type: markdown
content: >-
{{ state_attr('sensor.weather_birkerod_hours_forecast','day0_2_hour') | timestamp_custom('%S') }}
It does not matter if the output of the sensor are set as numbers or as text with qoutes around.
I am trying to just get the numbers with maybe a leading 0.
I am thinking about a fake conversion or something like that, to get around the bug, but I am not sure what is possible in those embedded code lines in the card configuration.
I hope someone can come up with a way forward.
Thanks.