Presence-Faker in NodeRed multiple devices

I’m trying to figure out a way to use NodeRed Presence-Faker to randomly turn lights on and off in the house. My catch is that I would like to identify a handful of lights (say 5 or 6) and have at minimum 2 of the lights on at any given moment.

Currently, I find that I need to connect Presence-Faker to a given light, so essentially 5 different Presence-Fakers for 5 different lights. But in that configuration, they all work independently and consequently I can have all 5 off at any given moment.

Is there an easy way to accomplish this?

Thanks,

Eric

There is an example vacation flow in the cookbook. It does not use presence faker but it does the same thing.

Thanks for the link! I have been trying to figure out how the group was created in HomeAssistant though. In the cookbook it indicates:

group:
  vacation_lights:
    name: Vacation Lights
    entities:
      - light.night_light
      - light.kitchen
      - switch.bedroom_light
      - switch.laundry_room

But based on the HA Group docs, this is “Old Style Groups” and are no longer recommended. I tried in a Group Helper, but cannot seem to include both light and switch entities within the same group.

Is there some other mechanism that I am not aware of that would allow me to group different objects together?

Is there any way to retrieve Entities in NodeRed and filter by Label? I don’t see any labels in the JSON payloads returned by the GetEntities node.

Thanks!

Eric

You can modify the get-entities node to get a list of entities by label.

Thanks! I saw that after I posted. I ended up creating different groups with the same label, and then some twisted logic in NR to fetch the different groups by label, and then flatten the entity_ids, then fetch the entity_ids by state. Not sure it is the nicest option available, but seeming it is functional.

Still need to test some more.