• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A node module to control your yamaha receiver

Yamaha-nodejs

NPM Downloads Dependency Status

A node module to control your yamaha receiver. Tested with RX-V775, should work with all yamaha receivers with a network interface.

Install

npm install yamaha-nodejs

Example

var YamahaAPI = require("yamaha-nodejs");
var yamaha = new YamahaAPI("192.168.0.100");
yamaha.powerOn().then(function(){
	console.log("powerOn");
	yamaha.setMainInputTo("NET RADIO").then( function(){
		console.log("Switched to Net Radio");
		yamaha.selectWebRadioListItem(1).then(function(){
			console.log("Selected Favorites");
			yamaha.selectWebRadioListItem(1).then(function(){});
		});

	});
});

Prerequisites

  • To power on the yamaha, network standby has to be enabled
  • The Yamaha reveiver is stateful. Some commands only work work if the receiver is in the right state. E.g. to get web radio channels, the "NET RADIO" input has to be selected.

Methods

var yamaha = new Yamaha("192.168.0.100")
var yamaha = new Yamaha() // Auto-Discovery
yamaha.powerOff(zone) // or "System" for sytem power
yamaha.powerOn(zone)  // or "System" for sytem power
yamaha.isOn(zone)
yamaha.isOff(zone)

//Volume
yamaha.setVolumeTo(-500, zone) // Value must be divisble by 5 or value will be rejected
yamaha.volumeUp(50, zone)
yamaha.volumeDown(50, zone)
yamaha.muteOn(zone)
yamaha.muteOff(zone)

//Extended Volume Settings
yamaha.setBassTo(60)          //-60 to 60 (may depend on model)
yamaha.setTrebleTo(60)        //-60 to 60 (may depend on model)
yamaha.setSubwooferTrimTo(60) //-60 to 60 (may depend on model)
yamaha.setDialogLiftTo(5)     //0 to 5 (may depend on model)
yamaha.setDialogLevelTo(3)    //0 to 3 (may depend on model)
yamaha.YPAOVolumeOn()
yamaha.YPAOVolumeOff()
yamaha.extraBassOn()
yamaha.extraBassOff()
yamaha.adaptiveDRCOn()
yamaha.adaptiveDRCOff()

//Playback
yamaha.stop(zone)
yamaha.pause(zone)
yamaha.play(zone)
yamaha.skip(zone)
yamaha.rewind(zone)

//Remote (Case Sensitive Values)
yamaha.remoteCursor(command) // 'Up', 'Down', 'Left', 'Right', 'Return', 'Sel'
yamaha.remoteMenu(command)   // 'Option', 'Display'

//Switch Input
yamaha.setInputTo("USB", 2)
yamaha.setMainInputTo("NET RADIO")

//Party Mode
yamaha.partyModeOn()
yamaha.partyModeOff()
yamaha.partyModeUp()
yamaha.partyModeDown()

//Basic
yamaha.SendXMLToReceiver()

//Get Info
yamaha.getBasicInfo(zone).done(function(basicInfo){
    basicInfo.getVolume();
    basicInfo.isMuted();
    basicInfo.isOn();
    basicInfo.isOff();
    basicInfo.getCurrentInput();
    basicInfo.isPartyModeEnabled();
    basicInfo.isPureDirectEnabled();
    basicInfo.getBass();
    basicInfo.getTreble();
    basicInfo.getSubwooferTrim();
    basicInfo.getDialogueLift();
    basicInfo.getDialogueLevel();
		basicInfo.getZone();
    basicInfo.isYPAOVolumeEnabled();
    basicInfo.isExtraBassEnabled();
    basicInfo.isAdaptiveDRCEnabled();
})

yamaha.isHeadphoneConnected()
yamaha.getSystemConfig()
yamaha.getAvailableInputs()
yamaha.isMenuReady("NET_RADIO")

// FM Tuner
yamaha.getTunerInfo()
yamaha.getTunerPresetList()
yamaha.selectTunerPreset(1)
yamaha.selectTunerFrequency(band, frequency)

//Select Menu Items
yamaha.selectUSBListItem(1)
yamaha.selectWebRadioListItem(1)

// Single Commands, receiver has to be in the right state
yamaha.getWebRadioList()
yamaha.selectWebRadioListItem(1)

// Chained Commands, they ensure the receiver is in the right state
yamaha.switchToFavoriteNumber()
yamaha.gotoFolder('/NET_RADIO/Radio/Favorites', 'NET_RADIO')

// Find the index of a list item to select using the name of the item,
// returns -1 if not found. Will move the list page down so index will always
// between 1 and 8.
yamaha.getIndexOfMenuItem(
    await yamaha.getWebRadioList(), 
    'BBC Radio 1', 
    'NET_RADIO'
)

// Zone Commands
yamaha.getAvailableZones()
yamaha.getZoneConfig(zone)

Zones

The zone parameter is optional, you can pass a number or a string

Promises

All these methods return a promise:

yamaha.isOn().then(function(result){
	console.log("Receiver is:"+result);
})

Execute Tests

mocha mochatest.js --ip 192.168.0.25
or with autodiscovery
mocha mochatest.js

Discovery

If the IP is omitted in the constructor, the module will try to discover the yamaha ip via a SSDP call. Thanks @soef @mwittig

Changelog

0.8:

  • FIX Remove get request delays

More Repositories

1

lz4_flex

Fastest pure Rust implementation of LZ4 compression/decompression.
Rust
435
star
2

ts-dependency-graph

prints a dependency graph in dot/mermaid format for your typescript/react project
TypeScript
174
star
3

serde_json_borrow

Fast JSON deserialization on borrowed data
Rust
70
star
4

wana_kana_rust

Utility library for checking and converting between Japanese characters - Hiragana, Katakana - and Romaji
Rust
55
star
5

toml-to-json-online-converter

toml to json and json to toml online converter - written in rust compiled to wasm
HTML
29
star
6

binggan

Benchmarking library for stable Rust
Rust
25
star
7

rust_measure_time

measures and prints wall time in rust for given scope
Rust
14
star
8

veloci

High performance fulltext search engine
Rust
10
star
9

cool-id-generator

Rust
7
star
10

lz4-wasm

https://pseitz.github.io/lz4-wasm/
JavaScript
7
star
11

bench_riddle

Repo To Blogpost https://quickwit.io/blog/performance-investigation
Rust
4
star
12

japanese-dictionary

JavaScript
3
star
13

HomeAutomation.js

JavaScript
3
star
14

future_cache

async cache that caches futures and their results in rust
Rust
3
star
15

germansynonyms

uses openthesaurus and nodejs to find german synonyms
JavaScript
3
star
16

chinese

HTML
2
star
17

chemtrailsimulator

JavaScript
2
star
18

rust_simplex_noise

Rust
2
star
19

GitAliases

Just some useful git aliases
Shell
2
star
20

tantivy_bench_graph

regression tracking for tantivy benchmarks
JavaScript
2
star
21

reddit-api-node

2
star
22

quickcalc

A spotlight like calculator based on iced
Rust
1
star
23

easystarts

typescript port of easystarjs
JavaScript
1
star
24

node-hdbconnect

hana database driver for node - wraps hdbconnect
Rust
1
star
25

stay_focused

C
1
star
26

vint32_rust

fast vint u32 encoding for rust
Rust
1
star
27

fastcpy

fastcpy
Rust
1
star
28

rust_string_hashmap

Rust
1
star
29

Sublime-Keymap

1
star
30

masterofcellion

JavaScript
1
star
31

watcher

watch files, copy git stage
JavaScript
1
star
32

DHCP-Broadcast-Callback

Lets you register a callback for received DHCP Callbacks with the MAC adress of the issuing device.
JavaScript
1
star
33

sort_and_fragmentation

small experiment to measure memory fragmentation on sort speed
Rust
1
star
34

Custom-Highlighter

Highlights text for any ruleset
JavaScript
1
star
35

rappable

JavaScript
1
star
36

diskbased_json_array

file based random access json array
JavaScript
1
star
37

fst_compression

Rust
1
star
38

SoundOnReturn

Plays sound on a yamaha receiver, when mobile phone connects with wlan
JavaScript
1
star
39

quantile_compare

quantile_compare
Rust
1
star
40

tocfl

chinese TOCFL vocabulary by levels
Rust
1
star
41

kanji_hanzi_converter

Translate Japanese Kanji to Chinese Hanzi
Rust
1
star
42

peakmem-alloc

Measure the peak memory consumption of a given scope in rust
Rust
1
star
43

test_serde_formats

test_serde_formats
Rust
1
star