# Home Assistant entities - Switch on sub-flow

**URL:** <https://discourse.nodered.org/t/home-assistant-entities-switch-on-sub-flow/88684>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [13 June 2024 19:18 UTC](https://discourse.nodered.org/t/home-assistant-entities-switch-on-sub-flow/88684 "2024-06-13T19:18:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seba-VT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/seba-vt/32/91929_2.png) [@Seba-VT](https://discourse.nodered.org/u/Seba-VT)\
**Post date:** [13 June 2024 19:18 UTC](https://discourse.nodered.org/t/home-assistant-entities-switch-on-sub-flow/88684/1 "2024-06-13T19:18:12Z")

</div>

I'm building a subflow to control lights. I'm trying to use a "Home Assistant Entities" switch node.

I was able to make it work in a flow with no issues, but my problem is that when I put it into a subflow and create copies of that subflow, the switch remains the same for all copies and does not create a new switch for each copy. If I toggle the switch from Home Assistant, all the subflows toggle.

How can I make the entities unique for each flow?

I have tried searching for documentation about the Node Red Companion Integration but couldn't find anything.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [13 June 2024 19:49 UTC](https://discourse.nodered.org/t/home-assistant-entities-switch-on-sub-flow/88684/2 "2024-06-13T19:49:42Z")

</div>

Welcome to the forums @Seba-VT

I don't think many here will have the answer - most here are not HA users.  
But at a guess, I would think these nodes are using some global state object.

Other than my assumption above, you may get better answers from the HA community.

---

<div class="post-metadata">

**Author:** ![Seba-VT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/seba-vt/32/91929_2.png) [@Seba-VT](https://discourse.nodered.org/u/Seba-VT)\
**Post date:** [13 June 2024 19:52 UTC](https://discourse.nodered.org/t/home-assistant-entities-switch-on-sub-flow/88684/3 "2024-06-13T19:52:30Z")

</div>

Thanks @marcus-j-davies. I'll post this question on a HA forum.

---

<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:** [11 September 2024 19:52 UTC](https://discourse.nodered.org/t/home-assistant-entities-switch-on-sub-flow/88684/4 "2024-09-11T19:52:40Z")

</div>

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