onkyo_eiscp_ruby

A Ruby implementation of eISCP (ethernet Integra Serial Control Protocol) for controlling Onkyo receivers.

I’m still sort of updating this code. Please feel free to reach out if there’s something you need that it doesn’t do, I may be willing to help.

The python version linked below sees much more activity.

Features

**Inspired by github.com/miracle2k/onkyo-eiscp

**Protocol information from michael.elsdoerfer.name/onkyo/ISCP-V1.21_2011.xls

What’s missing?

Using the Library

msg = EISCP::Message.new(command: 'PWR', value: '01')
                msg.zone                => 'main'
                msg.command             => "PWR"
                msg.value               => "01"
                msg.command_name        => "system-power"
                msg.command_description => "System Power Command"
                msg.value_name          => "on"
                msg.value_description   => "sets System On"
EISCP::Receiver.discover
receiver = EISCP::Receiver.new
receiver = EISCP::Receiver.new('10.0.0.132')
receiver = EISCP::Receiver.new do |msg|
                  puts msg.command
                  puts msg.value
                end
receiver.connect
receiver.connect do |msg|
                  puts "Received: #{msg.command_name}:#{msg.value_name}"
                end
receiver.disconnect
receiver.model => "TX-NR609"
                receiver.host  => "10.0.0.111"
                receiver.port  => 60128
                receiver.mac_address => "001122334455"
                receiver.area => "DX"
receiver.update_state
                receiver.state["MVL"] => "22"
                receiver.human_readable_state["master-volume"] => 34
# Turn on receiver
                receiver.system_power "on"

                # Query current input source
                receiver.input_selector "query"
                
                # Turn the master volume up one level
                receiver.master_volume "level-up"

                # Set the master volume to 45
                receiver.master_volume "45"
                
                # Change the input to TV/CD
                # Note: when a command value has more than one name (an array in the YAML file)
                #       we default to using the first entry. So for `['cd', 'tv', 'cd']` you get:
                receiver.input_selector "cd"
# Parse various ISCP strings
                iscp_message = EISCP::Parser.parse "PWR01"
                iscp_message = EISCP::Parser.parse "PWR 01"
                iscp_message = EISCP::Parser.parse "!1PWR01"
                iscp_message = EISCP::Parser.parse "!1PWR 01"

                # Parse human readable,
                EISCP::Parser.parse("main-volume 34")

Using the Binaries

Contributing