grzegorz914 / homebridge-denon-tv

Homebridge plugin for Denon/Marantz AV Receivers, publish as independent external platform accessory.
MIT License
73 stars 15 forks source link

Quiet Logs #126

Closed jdberry closed 2 years ago

jdberry commented 2 years ago

Thanks for a great plugin!

I have a power switch to shut my Denon off when I'm not using it. While the Denon is off, the plugin quite frequently (every 10 seconds?) logs that it cannot communicate with the Denon, for reasons that are obvious.

I'd like it if, at least optionally, the plugin could do the following:

I appreciate the efforts...

[Dec 29 16:51:42] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:51:42] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:51:52] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:51:52] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:01] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:01] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:11] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:11] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:20] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:20] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:30] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:30] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:39] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:39] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:49] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:49] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
[Dec 29 16:52:58] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, device info error: Error: timeout of 2000ms exceeded
[Dec 29 16:52:58] [homebridge-denon-tv] Device: 192.168.0.44 Denon Main Zone, Disconnected.
grzegorz914 commented 2 years ago

So, thanks for Your tips but in this way cannot be realized, I moved the info and state error to debug and the receiver will report only one time if Disconnected and only one time if Connected after reconnect.

jdberry commented 2 years ago

Thanks, @grzegorz914, that certainly quiets the logs. I wonder if it is too much.

When I start homebridge now, with my receiver power off, there is no indication at all that the the plugin is unable to communicate with the receiver:

[Dec 30 09:08:15] Loaded plugin: homebridge-denon-tv@3.15.6
[Dec 30 09:08:15] Registering platform 'homebridge-denon-tv.DenonTv'
[Dec 30 09:08:37] [DenonTv] Initializing DenonTv platform...
[Dec 30 09:08:37] [DenonTv] Initializing child bridge 0E:B3:EA:B7:A7:68
[Dec 30 09:08:44] [homebridge-denon-tv] Launched child bridge with PID 15211
[Dec 30 09:08:45] Registering platform 'homebridge-denon-tv.DenonTv'
[Dec 30 09:08:45] [homebridge-denon-tv] Loaded homebridge-denon-tv v3.15.6 child bridge successfully
[Dec 30 09:08:46] Homebridge v1.3.9 (HAP v0.9.8) (homebridge-denon-tv) is running on port 57061.
grzegorz914 commented 2 years ago

done

jdberry commented 2 years ago

By inspection, I think you wanted to set firstStart to false, not initStart:

https://github.com/grzegorz914/homebridge-denon-tv/blob/fd0b8268979cbb2ebebd6af7f1a488fed6044c2c/src/denon.js#L89

grzegorz914 commented 2 years ago

Its already here: https://github.com/grzegorz914/homebridge-denon-tv/blob/4fd4b1c4ddd46d299bc96461cda698b04ab1580f/src/denon.js#L89

jdberry commented 2 years ago

Thanks!