Hello,
Trying to create a template that can read the value for an attribute that has a ‘-’ in its name.
When reading:
{{ states.sensor.rpi_monitor_pi_1.attributes.drives }}
I get the following output:
{'mnt-usb': {'device': '/dev/sda1', 'mount_pt': '/mnt/usb', 'size_gb': 64, 'used_prcnt': 2}, 'root': {'device': '/dev/root', 'mount_pt': '/', 'size_gb': 16, 'used_prcnt': 22}}
So when reading the following:
{{ states.sensor.rpi_monitor_pi_1.attributes.drives.root.size_gb }}
I get ‘16’ as expected.
However, how to read:
{{ states.sensor.rpi_monitor_pi_1.attributes.drives.mnt-usb.size_gb }}
tried different things, like [“mnt-usb”] or mnt\-usb or mnt\\-usb, but they all fail…
Any idea how to get this working?
Thanks