LUA Usage Question - Accessing an attribute

Still getting my feet wet with the LUA Architecture. Trying to retrieve an attribute and somehow my syntax is not correct.

I can issue a command:


but I can’t seem to find the right syntax to retrieve the capability.

local state = capabilities.switch1.switch

Not sure what the syntax needs to retrieve a capability attribute.


It should be something like this:

local state = device:get_latest_state("switch1", "switch", "switch")

Here’s the documentation:

1 Like