# Opinions requested: Determine active scene

**URL:** <https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872>\
**Category:** General\
**Created:** [5 October 2021 06:36 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872 "2021-10-05T06:36:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeroenst](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeroenst/32/22682_2.png) [@jeroenst](https://discourse.nodered.org/u/jeroenst)\
**Post date:** [5 October 2021 06:36 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/1 "2021-10-05T06:36:08Z")

</div>

At my home I make use of different scenes. This works perfect but sometimes mismatches with the real world:

When I turn on a scene all lights and devices will set to the value according to the scene, which is ok. But when for example I turn off one device, the scene doesn't change.

Now I'm wondering what would be the right behaviour.

1. The scene selected stays active and ignores that the real world is different
2. The scene selected changes according to device states

The first option is easy, set scene and forget. Also visually in node red this is easy to create with standard nodes.

The second option is a lot more work, all device states has to be monitored and based on output states a scene is active or no scene is active.

I opt for the second option, but again it is a lot more work, and also less graphical because I have to program a function node that handles all the scene information.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [5 October 2021 06:47 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/2 "2021-10-05T06:47:30Z")

</div>

As you mention "scenes", are you referring to the Home Assistant set of nodes? Or something else entirely?

Is this a feature request for those nodes?

---

<div class="post-metadata">

**Author:** ![jeroenst](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeroenst/32/22682_2.png) [@jeroenst](https://discourse.nodered.org/u/jeroenst)\
**Post date:** [5 October 2021 12:01 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/3 "2021-10-05T12:01:15Z")

</div>

I have buttons on the nodered gui. These buttons send a text payload containing the scene to a change node which sets the value of the payload. The payload is send to the mqtt device topics and also to a node that changes the button colors according to the active scene.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 October 2021 12:16 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/4 "2021-10-05T12:16:42Z")

</div>

> [@jeroenst](#):
>
> Now I'm wondering what would be the right behaviour.

Are you asking for advice on how your system should behave, or help on how to implement what you want to achieve?

---

<div class="post-metadata">

**Author:** ![jeroenst](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeroenst/32/22682_2.png) [@jeroenst](https://discourse.nodered.org/u/jeroenst)\
**Post date:** [5 October 2021 14:25 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/5 "2021-10-05T14:25:18Z")

</div>

I'm doubting what would be the best choice, scenes ignoring device output states or scene status based on device output states.

So more advice then help on implementing this, although tips are always welcome.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [5 October 2021 18:55 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/6 "2021-10-05T18:55:24Z")

</div>

Personally I would have a 'scene' as a fixed setup so if a device state is changed the current 'scene' is cancelled and a manual 'scene' is entered. This manual 'scene' would have all the settings of the original 'scene', updated with the 1 (or more) changes. However, this presupposes that you are already monitoring device states which from what you say is not the case.

You should probably ask yourself a few questions:

- What is the result of a 'scene' and the real world not coinciding?

- In your first case if you turn the 'scene' on again all that happens is that the device you turned off is turned on again, is this a problem?

- Does your Dashboard show what it thinks is the current state of each device?

- Am I bothered if the 'scene' and the real world do not agree? (though given that you have asked the question this is probably 'yes')

Anything other than option 1 is going to require your flow getting feedback from the devices, so, do you want the fun of arranging this? 😆

---

<div class="post-metadata">

**Author:** ![Bigbloke](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bigbloke/32/40969_2.png) [@Bigbloke](https://discourse.nodered.org/u/Bigbloke)\
**Post date:** [6 October 2021 07:13 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/7 "2021-10-06T07:13:10Z")

</div>

I use a scene for mass switching of items. I also have a status area on my dashboard showing the state of the switches.  
All switching runs through the status switch, so that if the state of an individual switch changes it is shown on the status.  
That way I have the best of both worlds, automatic and manual control of my switch gear.

---

<div class="post-metadata">

**Author:** ![jeroenst](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeroenst/32/22682_2.png) [@jeroenst](https://discourse.nodered.org/u/jeroenst)\
**Post date:** [6 October 2021 07:36 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/8 "2021-10-06T07:36:52Z")

</div>

Ok, I had a chat with a friend of mine which uses Apple Homekit and is very satisfied. It turns out Apple Homekit does monitor the output states and determines the scene based on that info.

Also with the information you guys have given me I want to change my scene based on the output states.

Is there any node for nodered that makes this easy for me or should I go with a self programmed function node?

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [6 October 2021 13:35 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/9 "2021-10-06T13:35:01Z")

</div>

Depends on the protocol your devices are operating under. (zigbee, Tuya, Tasmota etc.)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 December 2021 13:35 UTC](https://discourse.nodered.org/t/opinions-requested-determine-active-scene/51872/10 "2021-12-05T13:35:35Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
