# Better way for current-state and event?

**URL:** <https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948>\
**Category:** General\
**Created:** [26 January 2024 15:54 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948 "2024-01-26T15:54:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris909090](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chris909090/32/87685_2.png) [@Chris909090](https://discourse.nodered.org/u/Chris909090)\
**Post date:** [26 January 2024 15:54 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948/1 "2024-01-26T15:54:06Z")

</div>

Hello together,

I'm new in Node-red so maybe this easy question.

I would like a value to be sent on start and on change.  
Is this only possible via this path with event node current\_state node and join node or is it not more convenient in a node?  
Thanks for your help!

 ![FB_IMG_1706284320010](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9e91a242743ce62e2691dca82b5d13e3a0cfd005.jpeg)

---

<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:** [26 January 2024 16:02 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948/2 "2024-01-26T16:02:19Z")

</div>

Welcome @Chris909090

You don't need a `join` Node.

Just plug both your `current_state` Node, and the `event` Node to the same Node that will consume that value.

You only use the `join` Node if you need to... well... join 2 incoming messages together.

The `join` Node has no use here. at least based on your question

---

<div class="post-metadata">

**Author:** ![Chris909090](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chris909090/32/87685_2.png) [@Chris909090](https://discourse.nodered.org/u/Chris909090)\
**Post date:** [26 January 2024 16:15 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948/3 "2024-01-26T16:15:38Z")

</div>

Ok thanks for yout answer. I will try it. A way to use event and cutrent-state in one node is not possible or?

---

<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:** [26 January 2024 16:17 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948/4 "2024-01-26T16:17:57Z")

</div>

Not for Node RED to decide - that is based on who developed the nodes you are using.  
With that said, you can look at creating a [subflow](https://nodered.org/docs/user-guide/editor/workspace/subflows) to achieve it

i.e create a subflow that.

- Allows you to fetch the value
- spits out updates when they happen

Then use that single subflow instance where you need it in your main flow

---

<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:** [26 January 2024 16:22 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948/5 "2024-01-26T16:22:05Z")

</div>

> [@Chris909090](#):
>
> A way to use event and cutrent-state in one node is not possible or?

Most here don't use Home Assistant so don't know what those nodes send. Can you show us what comes from those nodes and explain in more detail exactly what you want to do?

---

<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:** [25 April 2024 16:22 UTC](https://discourse.nodered.org/t/better-way-for-current-state-and-event/84948/6 "2024-04-25T16:22:17Z")

</div>

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