# 2 push buttons one sets the status to on, the other to off

**URL:** https://discourse.nodered.org/t/2-push-buttons-one-sets-the-status-to-on-the-other-to-off/68726
**Category:** General
**Created:** [8 October 2022 15:50 UTC](https://discourse.nodered.org/t/2-push-buttons-one-sets-the-status-to-on-the-other-to-off/68726 "2022-10-08T15:50:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hansge31](https://avatars.discourse-cdn.com/v4/letter/h/35a633/32.png) [@hansge31](https://discourse.nodered.org/u/hansge31)
#### Post date: [8 October 2022 15:50 UTC](https://discourse.nodered.org/t/2-push-buttons-one-sets-the-status-to-on-the-other-to-off/68726/1 "2022-10-08T15:50:12Z")

</div>

I'm looking to implement a two push button logic, switching a smart power socket.  
The first push button should set the state to on (1 or multiple times triggered)  
The second push button sets the state to off  
How to implement?

---

<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: [8 October 2022 16:08 UTC](https://discourse.nodered.org/t/2-push-buttons-one-sets-the-status-to-on-the-other-to-off/68726/2 "2022-10-08T16:08:22Z")

</div>

Configure one of the buttons to send 1 (or whatever is required to turn it on) and the other to send 0. Feed them both to the node controlling the socket.

---

<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: [22 October 2022 16:09 UTC](https://discourse.nodered.org/t/2-push-buttons-one-sets-the-status-to-on-the-other-to-off/68726/3 "2022-10-22T16:09:19Z")

</div>

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