<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.domoticz.com/index.php?action=history&amp;feed=atom&amp;title=NAD7050</id>
	<title>NAD7050 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.domoticz.com/index.php?action=history&amp;feed=atom&amp;title=NAD7050"/>
	<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=NAD7050&amp;action=history"/>
	<updated>2026-09-18T20:44:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=NAD7050&amp;diff=7753&amp;oldid=prev</id>
		<title>Robhuls: /* Link to forum posts */</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=NAD7050&amp;diff=7753&amp;oldid=prev"/>
		<updated>2017-01-12T21:00:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Link to forum posts&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Purpose=&lt;br /&gt;
Operate the NAD D 7050 Direct Digital Network Amplifier from Domoticz. &lt;br /&gt;
=Dependencies - hardware / software / operating system=&lt;br /&gt;
*NAD D 7050 Direct Digital Network Amplifier&lt;br /&gt;
*python3 (sudo apt-get install python3)&lt;br /&gt;
&lt;br /&gt;
=Domoticz Setup - switches, variables, version=&lt;br /&gt;
*Setup -&amp;gt; Hardware&lt;br /&gt;
*For type select Dummy&lt;br /&gt;
*Press Add&lt;br /&gt;
*Press the create virtual sensors blue bubble on the new device that appeared on the top&lt;br /&gt;
*Type NADControl for the name and select Selector for the type&lt;br /&gt;
*Press the create virtual sensors blue bubble again&lt;br /&gt;
*Type NADVolume for the name and select Dimmer for the type&lt;br /&gt;
*Go to the switches tab&lt;br /&gt;
*Edit the NADVolume slider and give them an amplifier icon&lt;br /&gt;
*Edit the NADControl button and give it an amplifier icon. Furthermore, link the switches to the commands for the python script as:&lt;br /&gt;
[[File:NADcontrol_content.png]]&lt;br /&gt;
&lt;br /&gt;
=Installation instructions=&lt;br /&gt;
The NAD 7050 should be connected to the network and have a static IP.&lt;br /&gt;
=Scripts with comments=&lt;br /&gt;
A python script sents the commands to the NAD7050. The script must be called with the new volume setting when changing the volume and we use a LUA script for that. This can be done under setup -&amp;gt; more options -&amp;gt; events. Under event name type NAD7050 and select lua instead of blockly. Then paste the following script in the text box: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
commandArray = {}&lt;br /&gt;
if (devicechanged[&amp;#039;NADVolume&amp;#039;]) then&lt;br /&gt;
    volume = devicechanged[&amp;#039;NADVolume&amp;#039;]&lt;br /&gt;
    os.execute(&amp;#039;/home/pi/domoticz/scripts/python/nad_selector.py volume &amp;quot;&amp;#039;..volume..&amp;#039;&amp;quot;&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
return commandArray&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and press save. Now we still need the python script that actually operates the NAD7050, inspired by the work of Tom Hartley (https://gist.github.com/anonymous/07cd28fe578ec49839db). *Create the following script named nad_selector.py in /home/pi/domoticz/scripts/python&lt;br /&gt;
*Do not forget to change the ip address to match the static IP of your NAD 7050&lt;br /&gt;
*And make the file executable using chmod u+x nad_selector.py&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/python3&lt;br /&gt;
&lt;br /&gt;
TCP_IP = &amp;#039;192.168.10.23&amp;#039;&lt;br /&gt;
TCP_PORT = 50001&lt;br /&gt;
BUFFER_SIZE = 1024&lt;br /&gt;
&lt;br /&gt;
import socket&lt;br /&gt;
import sys, time&lt;br /&gt;
import codecs&lt;br /&gt;
&lt;br /&gt;
# Function to send codes to the NAD7050&lt;br /&gt;
def send(MESSAGE):&lt;br /&gt;
    MESSAGE = codecs.decode(MESSAGE, &amp;#039;hex_codec&amp;#039;)&lt;br /&gt;
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;br /&gt;
    s.connect((TCP_IP, TCP_PORT))&lt;br /&gt;
    s.send(MESSAGE)&lt;br /&gt;
    s.close()&lt;br /&gt;
&lt;br /&gt;
command = sys.argv[1]&lt;br /&gt;
if command == &amp;#039;source&amp;#039;:&lt;br /&gt;
    channel = int(sys.argv[2])  # Input number from command line&lt;br /&gt;
    send(&amp;#039;0001020901&amp;#039;)  # Switch NAD on&lt;br /&gt;
    time.sleep(0.5)  # Otherwise the second connection is refused&lt;br /&gt;
    send(&amp;#039;000102030&amp;#039; + str(channel))  # Select input&lt;br /&gt;
elif command == &amp;#039;volume&amp;#039;:  # Set the volume&lt;br /&gt;
    volume_number = sys.argv[2].split(&amp;#039;:&amp;#039;)[1].split(&amp;#039;%&amp;#039;)[0]&lt;br /&gt;
    volume = 2*int(volume_number)  # NAD volume runs from 0 to 200&lt;br /&gt;
    volume_hex = str(hex(volume)[2:]).zfill(2)  # And is entered as hex&lt;br /&gt;
    send(&amp;#039;00010204&amp;#039;+volume_hex)&lt;br /&gt;
elif command == &amp;#039;off&amp;#039;:&lt;br /&gt;
    send(&amp;#039;00010207010001020207&amp;#039;)  # Enable Eco mode&lt;br /&gt;
    time.sleep(0.5)&lt;br /&gt;
    send(&amp;#039;0001020900&amp;#039;)  # Off command (no longer reachable by network)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;#039;command not recognized&amp;#039;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Example of use=&lt;br /&gt;
[[File:NADexample.png]]&lt;br /&gt;
&lt;br /&gt;
=Link to forum posts=&lt;br /&gt;
[https://www.domoticz.com/forum/viewtopic.php?f=23&amp;amp;t=13663 Forum topic]&lt;br /&gt;
&lt;br /&gt;
[https://gist.github.com/anonymous/07cd28fe578ec49839db The original NAD 7050 reverse engineered code]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/abaretta/nu.baretta.nad Homey app for the NAD7050]&lt;/div&gt;</summary>
		<author><name>Robhuls</name></author>
	</entry>
</feed>