# Onkyo 616 Power-stats

**URL:** https://discourse.nodered.org/t/onkyo-616-power-stats/50889
**Category:** General
**Created:** [11 September 2021 12:57 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889 "2021-09-11T12:57:03Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 12:57 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/1 "2021-09-11T12:57:03Z")

</div>

I want the use the information i get form my AVR

```auto
11.9.2021, 14:48:22node: abc38942f12dbb25
eiscp : msg.payload : Object
object
command: "system-power"
argument: "on"
iscp_command: "PWR01"
host: "192.168.1.12"
port: "60128"
model: "TX-NR616"

```

I have tried it with the following:

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

but no success.

Would be thankfull for your help

---

<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: [11 September 2021 13:23 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/2 "2021-09-11T13:23:20Z")

</div>

What data from that debug are you trying to access?

You should not have two `=` signs in one statement. Please explain what you are trying to do.

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 13:28 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/3 "2021-09-11T13:28:12Z")

</div>

I get a eiscp.msg from my AVR using this node - **node-red-contrib-eiscp**

What i try to do is, i want to know the power status  
I think it is more usefull to search for the following status:  
iscp\_command: "PWR00" = off  
iscp\_command: "PWR01" = on

The AVRsends a message each time a change is made

Is there an easy way to do this?

---

<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: [11 September 2021 13:29 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/4 "2021-09-11T13:29:03Z")

</div>

I don't see anything like that in the debug output you have shown.

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 13:30 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/5 "2021-09-11T13:30:56Z")

</div>

Row 5  
I added the = to make it easier to understand

---

<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: [11 September 2021 13:33 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/6 "2021-09-11T13:33:47Z")

</div>

Do you mean the line

```auto
iscp_command: "PWR01"

```

If so then you can address that as `msg.payload.iscp\_command. But you have not explained what you want to do with that.

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 13:36 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/7 "2021-09-11T13:36:57Z")

</div>

Yes, thats the line i mean

I'm sorry for making it so complicated. i am quite a beginner.

I want the information (PWR on / off) to turn on the light in my room  
The problem is that thes msg is included in most other msg...

```auto
11.9.2021, 15:33:34node: 0e75888fbb6c8a4d
eiscp : msg.payload : Object
object
iscp_command: "NSBON"
host: "192.168.1.12"
port: "60128"
model: "TX-NR616"
command: "PWR"
argument: "[Circular ~]"
11.9.2021, 15:33:34node: abc38942f12dbb25
eiscp : msg.payload : Object
object
command: "PWR"
iscp_command: "NMDOFF"
host: "192.168.1.12"
port: "60128"
model: "TX-NR616"
argument: "[Circular ~]"

```

I suspect that I have to take the information in the exact order so that I don't read out wrong data

---

<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: [11 September 2021 13:38 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/8 "2021-09-11T13:38:31Z")

</div>

Sorry, I have no idea what you are trying to do. Perhaps knowledge of the node you refer to is required. I thought you were just asking how to access data in messages you were receiving.

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 13:39 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/9 "2021-09-11T13:39:48Z")

</div>

that's exactly what i want to do... i want to work with the msg PWR01 and PWR00 form the msg.

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

is that the right way?

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 13:54 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/10 "2021-09-11T13:54:26Z")

</div>

maybe a changenode could help?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/600107b0a6462bf616482d84fb5b7c8f148debd5.png)

---

<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: [11 September 2021 14:29 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/11 "2021-09-11T14:29:04Z")

</div>

> [@Wurmi](#):
>
> is that the right way

Oh, you are trying to set the values in msg.payload, not read them out.

Please don't post screenshots, it means I can't copy your code and correct it. I can see that you are trying to set msg.payload.command to "power-status" but what are you trying to set iscp\_command to?

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 14:39 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/12 "2021-09-11T14:39:52Z")

</div>

looks like I'm on the completely wrong way.  
Yes, I just want to know if my AVR is on or off

I get a lot of information and i want to work with the PWR01 / PWR00 to get them in boolean true/false

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

Should be like

if iscp:command = PWR01  
then return true

if iscp:command = PWR00  
then return false

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [11 September 2021 14:52 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/13 "2021-09-11T14:52:59Z")

</div>

try

```auto
msg.payload = msg.payload.iscp_command === "PWR01";

```

or

```auto
msg.payload = msg.payload.argument === "on";

```

---

<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: [11 September 2021 15:01 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/14 "2021-09-11T15:01:52Z")

</div>

> [@Wurmi](#):
>
> if iscp:command = PWR01  
> then return true
> 
> if iscp:command = PWR00  
> then return false

What if iscp\_command is neither of those?

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 15:13 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/15 "2021-09-11T15:13:44Z")

</div>

Thanks for that - now i get true or false.  
The last "problems" are

how can i make a request  
how can i filter the msg - may no longer be necessary if I can make a specific request

@Colin  
if i get no answer it should be false

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [11 September 2021 15:15 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/16 "2021-09-11T15:15:17Z")

</div>

> [@Wurmi](#):
>
> how can i make a request

what sort of request?

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 15:16 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/17 "2021-09-11T15:16:51Z")

</div>

Thats my flow

```auto
[{"id":"db0692a9434fea7d","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"c89fa2e909d1f1e3","type":"eiscp-in","z":"db0692a9434fea7d","name":"Onkyo","controller":"336bdaabba8044df","x":430,"y":200,"wires":[["47f31ad091d7fc4c","ef2096db35d97c33"]]},{"id":"8f46cf382d03aae7","type":"eiscp-out","z":"db0692a9434fea7d","name":"","controller":"336bdaabba8044df","x":810,"y":280,"wires":[]},{"id":"dd181b6f0685663d","type":"function","z":"db0692a9434fea7d","name":"Ein","func":"msg.payload = msg.payload.iscp_command = \"system-power\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":280,"wires":[["8f46cf382d03aae7"]]},{"id":"d496520ae2eaff96","type":"function","z":"db0692a9434fea7d","name":"Aus","func":"msg.payload = \"system-power=off\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":320,"wires":[[]]},{"id":"3f26ed9a629d5c7c","type":"inject","z":"db0692a9434fea7d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":440,"y":280,"wires":[["dd181b6f0685663d"]]},{"id":"c566f14f72e3ecf0","type":"inject","z":"db0692a9434fea7d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":440,"y":320,"wires":[["d496520ae2eaff96"]]},{"id":"47f31ad091d7fc4c","type":"function","z":"db0692a9434fea7d","name":"EIN","func":"msg.payload = msg.payload.iscp_command === \"PWR01\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":160,"wires":[["94bf1d2ddb4f1aac"]]},{"id":"94bf1d2ddb4f1aac","type":"debug","z":"db0692a9434fea7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":780,"y":180,"wires":[]},{"id":"ef2096db35d97c33","type":"function","z":"db0692a9434fea7d","name":"AUS","func":"msg.payload = msg.payload.iscp_command === \"PWR00\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":220,"wires":[["8a198fd7c201d341"]]},{"id":"8a198fd7c201d341","type":"debug","z":"db0692a9434fea7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":220,"wires":[]},{"id":"336bdaabba8044df","type":"eiscp-controller","name":"Onkyo","host":"192.168.1.12","port":"60128","model":"TX-NR616"}]

```

If i click on inject it should return the PWR Status  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7dff6214e19f20353d9092168e147576acce596c.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [11 September 2021 15:35 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/18 "2021-09-11T15:35:10Z")

</div>

Have you tried  
`msg.raw = "PWR01" // on`  
or  
`msg.raw ="PWR00" // off`  
from the node read me

> It is possible to send a raw data command, set `msg.raw` to the command you want to send. If msg.raw is set, this will overwrite any msg.payload, and it will send the command in raw format.

> Example: `msg.raw = 'NPR03'` (this will select and play the 3rd item in your internet radio favorites)

so my guess is above the sending "PWR01" should turn the device on,  
This is just guess work as i do not have the node installed or a device to test.

> **[node-red-contrib-eiscp](https://flows.nodered.org/node/node-red-contrib-eiscp)**
>
> Integra / Onkyo (ISCP protocol) for node-red

---

<div class="post-metadata">

### Author: ![Wurmi](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@Wurmi](https://discourse.nodered.org/u/Wurmi)
#### Post date: [11 September 2021 15:46 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/19 "2021-09-11T15:46:51Z")

</div>

> [@E1cid](#):
>
> msg.raw = "PWR01" // on

Sorry that was my fault. I have read the instructions and on / off should work - in the flow above i forgot to mention i was trying to send a request with the inject and not a cmd for ON / OFF

My problem is that i get e punch of infos back

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

The msg with the "ture" should be the PWR Status. The rest should be uninteresting information

---

<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: [11 September 2021 16:02 UTC](https://discourse.nodered.org/t/onkyo-616-power-stats/50889/20 "2021-09-11T16:02:13Z")

</div>

Once again you have not made it clear. I am guessing that you only want to interpret messages with iscp\_command PWR01 or PWR00, in which case the function could be

```auto
if (msg.payload.iscp_command === "PWR01") {
  msg.payload = true
} else if (msg.payload.iscp_command === "PWR00") {
  msg.payload = false
} else {
  msg = null // this prevents the function from sending anything
}
return msg

```

[Next page](https://discourse.nodered.org/t/onkyo-616-power-stats/50889.md?page=2)
