This seems to be a somewhat common topic, the solutions i have read are all unique and none seem to work in my case. I always end up with the sensor being unavailable.
I haven’t figured exactly how i will deal with this data, for now i just want to make a template sensor that makes any of these numbers available that are under the source sensor’s state attributes. As you see comma separated under the label “today”.
I am unfamiliar with the information contained by a Nordpool sensor so it’s unclear to me if the value of the today attribute is a comma-separated string or a list. The template above assumes it’s a string.
The sensor once again ends up unavailable and i get the following in the log:
TemplateError('UndefinedError: 'list object' has no attribute 'split'') while processing template 'Template("{{ state_attr('sensor.nordpool_kwh_se4_sek_3_10_025', 'today').split(', ')[1] }}")' for attribute '_attr_native_value' in entity 'sensor.today1'
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.