Template tool question

I am trying to use the template tool in Developer Tools to learn more about using templates.
If I enter:
Office light is on? {{ is_state(‘switch.officelight’, ‘on’) }}

It correctly returns True or False.

If I enter:
{{ light.steve_desk_light }}

I get:
UndefinedError: ‘light’ is undefined

Likewise:
sensor.disk_use_percent = {{sensor.disk_use_percent}}

returns:
UndefinedError: ‘dict object’ has no attribute ‘freezer_temperature_c’

Am I doing something wrong or does the template tool not have scope to my states?

You can’t just supply the entity id and expect to get back the state. You need to ask for the state of the entity, like this:

{{ states('light.steve_desk_light') }}

Or ask for an attribute value, like this:

{{ state_attr('light.steve_desk_light', 'brightness') }}

Note that example will only work if the light is on.

Thanks. I’ll stumble through more tomorrow…

More here https://www.home-assistant.io/docs/configuration/templating/#states