# Service :: Turn off not working

**URL:** <https://discourse.nodered.org/t/service-turn-off-not-working/46726>\
**Category:** General\
**Created:** [5 June 2021 09:21 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726 "2021-06-05T09:21:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alamapstieks](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@alamapstieks](https://discourse.nodered.org/u/alamapstieks)\
**Post date:** [5 June 2021 09:21 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/1 "2021-06-05T09:21:09Z")

</div>

Hi Guys,

I have some strange behaviour (running node red v1.3.3) where I call a service to switch off a switch, but it switches it on instead? Any ideas? As you can see below I am calling the turn-off but it fires turn\_on?!

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/d/dda19cd742e8a3fecb9545ebcf4e32ba7d43d8d2.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2a0f8d21aaa0b7c8400ed6ec4317db666d4ab374.png)

Many thanks

---

<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 June 2021 10:11 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/2 "2021-06-05T10:11:52Z")

</div>

This seems entirely Home Assistant related so you might be better asking on an HA forum.

---

<div class="post-metadata">

**Author:** ![alamapstieks](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@alamapstieks](https://discourse.nodered.org/u/alamapstieks)\
**Post date:** [5 June 2021 20:58 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/3 "2021-06-05T20:58:21Z")

</div>

> [@alamapstieks](#):
>
> I have some strange behaviour (running node red v1.3.3) where I call a service to switch off a switch, but it switches it on instead? Any ideas? As you can see below I am calling the turn-off but it fires turn\_on?!

thanks will try them - I thought this was NR related 🙂

---

<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 June 2021 21:19 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/4 "2021-06-05T21:19:16Z")

</div>

> [@alamapstieks](#):
>
> I thought this was NR related

Well it obviously _is_ node-red related in that you are using node-red. However, that node is provided by HA so if it is not doing what you expect then you need to ask someone who knows about HA. Most here use node-red standalone to run their system, without HA.

---

<div class="post-metadata">

**Author:** ![michaelblight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/michaelblight/32/445_2.png) [@michaelblight](https://discourse.nodered.org/u/michaelblight)\
**Post date:** [7 June 2021 07:37 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/5 "2021-06-07T07:37:05Z")

</div>

That node will override settings based on the inbound msg. So if it receives "turn\_on" in `msg.payload.service`, it will override the "turn\_off" config. Alternatively, the override might be in the `data` property, which is getting merged. You could use a `debug` node to show the whole message going into this node to look for it.

---

<div class="post-metadata">

**Author:** ![alamapstieks](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@alamapstieks](https://discourse.nodered.org/u/alamapstieks)\
**Post date:** [7 June 2021 09:05 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/6 "2021-06-07T09:05:08Z")

</div>

> [@michaelblight](#):
>
> will override settings based on the inbound msg. So if it receives "turn\_on" in `msg.payload.service` , it will override the "turn\_off" config. Alternatively, the override might be in the `data` property, which is getting merged. You could use a `debug` node to show the whole message going into this node to look for it.

Thanks @michaelblight , I added a switch node and that works!

---

<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:** [21 June 2021 09:05 UTC](https://discourse.nodered.org/t/service-turn-off-not-working/46726/7 "2021-06-21T09:05:52Z")

</div>

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