get lights that are on

This block is part of the globals group and was last modified in core v15.0.0.

get lights that are on v15.0.0

Returns every light currently switched on.

In pins 1 + flow
  • flow v15.0.0
    flow
  • room v15.0.0
    value
Out pins 2 + flow
  • flow v15.0.0
    flow
  • devices v15.0.0
    array
  • count v15.0.0
    number

Reads the registry for adopted devices of type light whose power state is known AND true. Lights whose state is unknown are excluded : see get active sensors for the same reasoning. Pair with array_map + light off for a 'everything off' flow.

zigbee
zwave
matter
thread
hue
smart home

get lights that are on reads the in-memory device registry, so it makes no network call and is cheap enough to run in a loop. It returns only lights whose power state is KNOWN and true: a lamp the node has not heard from since it started is left out rather than assumed off. The count pin feeds > and branch, which is the shape of "if anything is still on, do something about it".

Studio canvas example for the get lights that are on block: asking the registry which lights are on.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v15.0.0.


Back to globals Return to the main group to view all sub-groups Back to home Return to the group to view all blocks within this group