aangert / homebridge-musiccast-tv

Homebridge plugin for Yamaha MusicCast devices
GNU General Public License v3.0
15 stars 3 forks source link

Error when starting with plugin enabled #16

Closed kieranlittle667 closed 3 years ago

kieranlittle667 commented 3 years ago

Hi, I've tried for a while to get this plugin to work; it took me a while to get my json formatted correctly in a way in which it would be accepted but I get this error in my logs on startup which sends homebridge in a loop.

[6/7/2021, 8:21:54 PM] [Yamaha Stereo] Initializing MusicCastTV accessory...
[6/7/2021, 8:21:56 PM] TypeError: Cannot set property 'ConfiguredName' of undefined
    at new MusicCastTV (/homebridge/node_modules/homebridge-musiccast-tv/index.js:135:41)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:350:50
    at Array.forEach (<anonymous>)
    at Server.loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:270:29)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:162:12)
[6/7/2021, 8:21:56 PM] Got SIGTERM, shutting down Homebridge...
[6/7/2021, 8:21:56 PM] [Yamaha Stereo] volume: 36 maxVol: 161
[6/7/2021, 8:21:56 PM] [Yamaha Stereo] Input: tuner
[6/7/2021, 8:21:56 PM] TypeError: Cannot read property 'getCharacteristic' of undefined
    at Request._callback (/homebridge/node_modules/homebridge-musiccast-tv/index.js:389:29)
    at Request.self.callback (/homebridge/node_modules/homebridge-musiccast-tv/node_modules/request/request.js:185:22)
    at Request.emit (events.js:376:20)
    at Request.<anonymous> (/homebridge/node_modules/homebridge-musiccast-tv/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:376:20)
    at IncomingMessage.<anonymous> (/homebridge/node_modules/homebridge-musiccast-tv/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:482:28)
    at IncomingMessage.emit (events.js:388:22)
    at endReadableNT (internal/streams/readable.js:1336:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Here is my config { "accessory": "MusicCastTV", "name": "Yamaha Stereo", "ip": "192.168.1.187", "model": "RN-803D", "inputs": { "tuner": "Tuner", "server": "Server", "phono": "Phono", "line_cd": "CD", "optical2": "TV", "line1": "PC", "line2": "Tape", "spotify": "Spotify", "net_radio": "Net Radio", "tidal": "Tidal", "airplay": "Airplay", "bluetooth": "Bluetooth" } }

Have you got any ideas? Output from my receiver's api below also

{"response_code":0,"system":{"func_list":["wired_lan","wireless_lan","wireless_direct","network_standby","network_standby_auto","bluetooth_standby","auto_power_standby","bluetooth_tx_setting","speaker_a","speaker_b","headphone","airplay","speaker_settings","disklavier_settings","remote_info","network_reboot","ypao_setting","ypao_speaker_unit","ypao_volume"],"zone_num":1,"input_list":[{"id":"napster","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"spotify","distribution_enable":true,"rename_enable":false,"account_enable":false,"play_info_type":"netusb"},{"id":"juke","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"qobuz","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"tidal","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"deezer","distribution_enable":true,"rename_enable":false,"account_enable":true,"play_info_type":"netusb"},{"id":"airplay","distribution_enable":false,"rename_enable":false,"account_enable":false,"play_info_type":"netusb"},{"id":"mc_link","distribution_enable":false,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"server","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"net_radio","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"bluetooth","distribution_enable":true,"rename_enable":false,"account_enable":false,"play_info_type":"netusb"},{"id":"usb","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"netusb"},{"id":"tuner","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"tuner"},{"id":"optical1","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"optical2","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"coaxial1","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"coaxial2","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"line1","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"line2","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"line3","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"line_cd","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"},{"id":"phono","distribution_enable":true,"rename_enable":true,"account_enable":false,"play_info_type":"none"}],"speaker_settings":{"type":"beam","common":{"attribute":60,"swfr_crossover_list":[40,60,80,90,100,110,120,160,200],"speaker_size":[{"id":"front","size_list":["full_band","low_cut"]}]},"front_l":{"attribute":17,"range_step":[{"id":"level","min":-100,"max":100,"step":5},{"id":"distance","min":30,"max":2400,"step":5}]},"front_r":{"attribute":17,"range_step":[{"id":"level","min":-100,"max":100,"step":5},{"id":"distance","min":30,"max":2400,"step":5}]},"swfr":{"attribute":17,"range_step":[{"id":"level","min":-100,"max":100,"step":5},{"id":"distance","min":30,"max":2400,"step":5}]}},"ypao_speaker_unit_list":["a","b","a+b"]},"zone":[{"id":"main","func_list":["power","sleep","volume","mute","signal_info","prepare_input_change","link_control","link_audio_delay","link_audio_quality"],"input_list":["napster","spotify","juke","qobuz","tidal","deezer","airplay","mc_link","server","net_radio","bluetooth","usb","tuner","optical1","optical2","coaxial1","coaxial2","line1","line2","line3","line_cd","phono"],"link_control_list":["speed","standard","stability"],"link_audio_delay_list":["audio_sync_on","audio_sync_off"],"link_audio_quality_list":["compressed","uncompressed"],"range_step":[{"id":"volume","min":0,"max":161,"step":1}]}],"tuner":{"func_list":["fm","rds","dab"],"range_step":[{"id":"fm","min":87500,"max":108000,"step":50}],"preset":{"type":"separate","num":40}},"netusb":{"func_list":["recent_info","play_queue","mc_playlist","streaming_service_use"],"preset":{"num":40},"recent_info":{"num":40},"play_queue":{"size":200},"mc_playlist":{"size":200,"num":5},"net_radio_type":"airable","pandora":{"sort_option_list":["recent","alphabet"]},"siriusxm":{"api_type":"everest"}},"distribution":{"version":2.00,"compatible_client":[2],"client_max":9,"server_zone_list":["main"]},"ccs":{"supported":true}}
aangert commented 3 years ago

Could you start homebridge in debug mode using homebridge -D and post the log

kieranlittle667 commented 3 years ago

@DoctorNSA I did that, but saw there was a plugin update so updated to the latest version and that seems to have resolved it as homebridge has now started successfully and my receiver has now appeared within the accessories view and I can see it's pulling things in fine in the logs. Not sure what the issue was.

aangert commented 3 years ago

The issue might have been defining the input type tuner as it is just a group of inputs and won't work properly. Please replace tuner with am, fm or dab