Hello. My 1st post as a HA user, after many years of Openhab use. I have to say I wish I switched earlier - HA so much quicker and easier to use, especially with Z2M integration. Thank you all.
I’m trying to extract the ‘Last period’ attribute from a utility sensor. Using the Template editor (which is excellent) I can extract attributes with a single word, but not those with a space.
The attributes of the sensor below, plus some lines from template editor I’ve been trying.
Attributes
Source -
sensor.house_power_consumption_kwh
Status - collecting
Last period - 0.28
Meter period - hourly
Cron pattern - 0 * * * *
Template Editor
{{ state_attr(‘sensor.hourly_electricity’, ‘Last period’) }}
{{ state_attr(‘sensor.hourly_electricity’, ‘status’) }}
{{ states.sensor.hourly_electricity.attributes.status }}
{{ states(‘sensor.hourly_electricity’) }}
output:
None
collecting
collecting
0.08
Running latest HAOS on pi4
Thanks in advance