# Smartthings Switch On and Off issue

**URL:** https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098
**Category:** General
**Created:** [4 August 2020 00:13 UTC](https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098 "2020-08-04T00:13:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Doug](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@Doug](https://discourse.nodered.org/u/Doug)
#### Post date: [4 August 2020 00:13 UTC](https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098/1 "2020-08-04T00:13:22Z")

</div>

![Flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/9575ffe8032b8a9a3c4b383f4cca3a5cd8d3383a.jpeg)

The Query inject works just fine and is configured:  
 ![Query](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/89bc106788de4fd3f6bc7198a31384dd4fb4abca.jpeg)

However I am unable to turn on or turn off the switch. On inject:  
 ![On](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/678d1ea476699c811861f9800c150e0131eba7c2.jpeg)

Front Window On/Off node is configured:  
 ![Front Window Node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d4237fe8fa16bf1f8ef5e491b6aff70a2bf2735.jpeg)

The Smartthings On/Off node info and help:

 ![Node Info](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/826da35148aa25613a479c177637e826da815be8.jpeg)

The Smarthings switch works fine, I can turn it on and off with its app, and my Query in node red sees the state change.

Any help would be greatly appreciated.

Thank you.

---

<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: [4 August 2020 08:18 UTC](https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098/2 "2020-08-04T08:18:39Z")

</div>

The instructions say that you need to set the payload to an object containing `{value: 1}` not just the the number 1. To do that in the inject node set the type to `{} JSON` and the content to `{"value": 1}`

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [4 August 2020 09:06 UTC](https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098/3 "2020-08-04T09:06:18Z")

</div>

or with Node-RED 1.1.x you can just set inject to msg.payload.value to 1  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3bf9b1f861891ab12b330d90642d54649972543a.png)

---

<div class="post-metadata">

### Author: ![Doug](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@Doug](https://discourse.nodered.org/u/Doug)
#### Post date: [4 August 2020 13:08 UTC](https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098/4 "2020-08-04T13:08:27Z")

</div>

Thank you both very much! Works perfect!!

---

<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: [3 October 2020 13:08 UTC](https://discourse.nodered.org/t/smartthings-switch-on-and-off-issue/31098/5 "2020-10-03T13:08:29Z")

</div>

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