One of the challenges of running in this kind of configuration is that both units respond to the same remote control signals. I have switched off remote receiving on the SR7010 as I just want it to behave as a power amp. However, as the 7010 has no trigger inputs (alas, only outputs), the problem remains of how to power up the SR7010, and power it down, in tandem with the AV8805.
Here's the end result;
Here's how this was done in Node-Red....
I use Node-Red for a lot of my automation needs, but hadn't previously done any IP control of AV devices. My first thought was to intercept remote commands from my Harmony Hub and build actions based on that. (there's a node for that!). However, in the end, I figured direct control would be best.
Searching for 'Marantz' in the Node-Red Palette Install section, one option shows up that looks like it might fit the bill;
On testing, though, and on careful reading of the documentation, it turns out that while this promises Input and Output nodes to read and write events and commands, only the output node is functional. However, it does work to send commands as can be seen in this small setup;
The output node is configured to connect to the SR7010 on Port 80;
The Injection nodes are configured to send on and off commands;
Here we have the AV8805 events passing through a switch to remove the 'raw' data and pushed on to a debug node and a second switch that reads the event type;
This then calls either the On or Off functions that contain a very basic script with the relevant JSON that's then passed into the SR7010.
Net result: when the AV8805 is powered on or off in any way (remote control, Marantz app, pressing the physical power button), the SR7010 follows suit. Here's a sequence where the AV8805 is powered on, then off a short time later.
This achieves everything I need for now. That I have events streaming from the devices is useful for future automations like, for example, bringing up the lights when the units are powered off, so I can see my way out of the room!
Here's the Node-Red export for the above flows;
[{"id":"db3e257b.b46038","type":"debug","z":"bb6157c.e254fa8","name":"Marantz AV8805","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1420,"y":580,"wires":[]},{"id":"155239ff.b93336","type":"marantz-http-out","z":"bb6157c.e254fa8","name":"SR7010","controller":"8f628e5c.6925a","x":1600,"y":820,"wires":[]},{"id":"234a69c5.7aead6","type":"inject","z":"bb6157c.e254fa8","name":"Power Off","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"cmd\": \"power\", \"value\": \"off\"}","payloadType":"str","x":1080,"y":800,"wires":[["155239ff.b93336"]]},{"id":"dccee7dc.d6c118","type":"denon-in","z":"bb6157c.e254fa8","name":"AV8805","connection":"d5279c32.3382","x":1050,"y":640,"wires":[["3e11e283.9deb2e"]]},{"id":"b6b5227c.10248","type":"denon-in","z":"bb6157c.e254fa8","name":"SR7010","connection":"12bc4cf2.bab933","x":1050,"y":480,"wires":[["72f6f18.f5ea41"]]},{"id":"3b6737a6.9f1ea8","type":"switch","z":"bb6157c.e254fa8","name":"filter events","property":"payload.event","propertyType":"msg","rules":[{"t":"eq","v":"mainZoneOn","vt":"str"},{"t":"eq","v":"mainZoneOff","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1230,"y":680,"wires":[["a1544569.86b9e8"],["7854910c.17ba5"]]},{"id":"86f3b6aa.f82938","type":"debug","z":"bb6157c.e254fa8","name":"Marantz SR7010","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1390,"y":480,"wires":[]},{"id":"72f6f18.f5ea41","type":"switch","z":"bb6157c.e254fa8","name":"filter 'raw'","property":"payload.event","propertyType":"msg","rules":[{"t":"neq","v":"raw","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1200,"y":480,"wires":[["86f3b6aa.f82938"]]},{"id":"fb323670.3c2018","type":"inject","z":"bb6157c.e254fa8","name":"Power On","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"cmd\": \"power\", \"value\": \"on\"}","payloadType":"str","x":1080,"y":860,"wires":[["155239ff.b93336"]]},{"id":"7854910c.17ba5","type":"function","z":"bb6157c.e254fa8","name":"Power Off","func":"msg.payload = {\"cmd\": \"power\", \"value\": \"off\"}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1420,"y":700,"wires":[["155239ff.b93336"]]},{"id":"a1544569.86b9e8","type":"function","z":"bb6157c.e254fa8","name":"Power On","func":"msg.payload = {\"cmd\": \"power\", \"value\": \"on\"}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1420,"y":660,"wires":[["155239ff.b93336"]]},{"id":"3e11e283.9deb2e","type":"switch","z":"bb6157c.e254fa8","name":"filter 'raw'","property":"payload.event","propertyType":"msg","rules":[{"t":"neq","v":"raw","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1200,"y":600,"wires":[["db3e257b.b46038","3b6737a6.9f1ea8"]]},{"id":"8f628e5c.6925a","type":"marantz-http-controller","name":"SR7010","host":"192.168.1.10","port":"80"},{"id":"d5279c32.3382","type":"denon-connection","name":"AV8805","address":"192.168.1.85","port":"23"},{"id":"12bc4cf2.bab933","type":"denon-connection","name":"SR7010","address":"192.168.1.10","port":"23"}]
No comments:
Post a Comment