# Too stupid to use switch node and/or function with Aqara magic cube T1 Pro :(

**URL:** https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102
**Category:** General
**Tags:** function-node, switch-node
**Created:** [28 December 2023 20:23 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102 "2023-12-28T20:23:55Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [29 December 2023 15:13 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/21 "2023-12-29T15:13:07Z")

</div>

Again that works for me, the message arrives at debug node seite 4 (which I had to create and wire up)

Can you check that you don't have a wire directly joining your input and seite 1?

---

<div class="post-metadata">

### Author: ![ikarisan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ikarisan/32/86698_2.png) [@ikarisan](https://discourse.nodered.org/u/ikarisan)
#### Post date: [29 December 2023 16:05 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/22 "2023-12-29T16:05:56Z")

</div>

LOL, the debug node is ALWAYS triggered. Even if there is no wire connected!

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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [29 December 2023 16:29 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/23 "2023-12-29T16:29:36Z")

</div>

> [@ikarisan](#):
>
> the debug node is ALWAYS triggered. Even if there is no wire connected

Did you deploy after removing the wire? Refresh the browser to be sure you are viewing the actual flow running.

PS, do you have an issue? The debug node named "side 4" was triggered by the 4th output. Is that what you expected?

---

<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: [29 December 2023 16:53 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/24 "2023-12-29T16:53:04Z")

</div>

> [@ikarisan](#):
>
> the debug node is ALWAYS triggered. Even if there is no wire connected!

Restart node-red

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [29 December 2023 16:54 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/25 "2023-12-29T16:54:43Z")

</div>

You are giving us mixed messages.

> [@ikarisan](#):
>
> But regardless of which value "side" has, the first output (side == 1) is always triggered.

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

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

> [@ikarisan](#):
>
> it doesn't matter whether side is 1,2,3,4,5 or 6. Output 1 reacts every time.

> [@ikarisan](#):
>
> LOL, the debug node is ALWAYS triggered. Even if there is no wire connected!

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

Delete the debug nodes OUTPUT 1 and Output Cube.  
Deploy.

Do you still see output from these two nodes?

Do you have debug nodes with the same names on other flows?

---

<div class="post-metadata">

### Author: ![ikarisan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ikarisan/32/86698_2.png) [@ikarisan](https://discourse.nodered.org/u/ikarisan)
#### Post date: [29 December 2023 18:40 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/26 "2023-12-29T18:40:53Z")

</div>

Sorry for the confusion about the different messages. The CubeT1 is a dice with six sides. Depending on the side pointing upwards, the value for "side" is between 1 and 6. But the switch node should still react correctly. But deleting the strange debug node and restarting Node-Red helped.

---

<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: [29 December 2023 21:51 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/27 "2023-12-29T21:51:05Z")

</div>

The switch node _is_ reacting correctly is it not?

---

<div class="post-metadata">

### Author: ![ikarisan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ikarisan/32/86698_2.png) [@ikarisan](https://discourse.nodered.org/u/ikarisan)
#### Post date: [30 December 2023 10:59 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/28 "2023-12-30T10:59:49Z")

</div>

Yes, it works as expected. The problem was apparently only due to the faulty debug node.

---

<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: [28 February 2024 11:00 UTC](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102/29 "2024-02-28T11:00:29Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/too-stupid-to-use-switch-node-and-or-function-with-aqara-magic-cube-t1-pro/84102.md?page=1)
