AntonioMeireles / homebridge-vieramatic

Homebridge plugin for Panasonic™ Viera™ TVs (includes support for 2018 and later models)
Apache License 2.0
43 stars 9 forks source link

Allow setting TV's name from within HB's config.json #38

Closed Marfre888 closed 3 years ago

Marfre888 commented 3 years ago

Hey @AntonioMeireles

I'm running into a small problem where if I change the name of the TV in home app, after each reboot of homebridge it resorts back to the name given to it by the plugin (IE: the tv's model number)

Is there a way where I could assign a name to the TV inside homebridge, or just make it so the plugin doesn't force a change to the tile name after every reboot.

Thanks for your work,

Mark

AntonioMeireles commented 3 years ago

@Marfre888

Hi,

sorry lag,

currently best way is to change the name of the TV on the TV itself (it defaults to the TV's model number) to whatever you want.

Is that enough for you ?

All the best, and thanks for your patience!

António

Marfre888 commented 3 years ago

@AntonioMeireles It is a start, but that doesn't accept any spaces and is limited in the number of characters I can use.

Last week @g30r93g has said that he will stop updating his plugin, and instead focus on porting features from his plugin to yours.

Two simple yet effective features that his plug in has and would be great to port over are;

  1. Being able to assign a name to each tv (which would transfer over to homekit). In my case I want to name it as; Upstair Living Room Television, which is not possible by renaming the TV
  2. If TV is not detected on the ip set, it will assume it is switched off, and set the plugin to 'off' instead of no response. It already does this technically, but it requires that the plugin first discovers the tv upon rebooting homebridge. @g30r93g assumed that the TV was off and set it to off by default.

Thanks

AntonioMeireles commented 3 years ago

@Marfre888

thanks again for your patience

Marfre888 commented 3 years ago

@AntonioMeireles

  1. @g30r93g Thanks you for implementing it so quick. I didn't expect you to do it so quick haha

  2. I read through #42, and that would should fix the problem. Thank you. I noticed @g30r93g's plugin did also have a rare tendency of getting the power states confused in his plugin. Assuming you aren't really restarting homebridge often that seems like a small price to pay if a second restart correct the problem.

Thank you so much for this plugin

g30r93g commented 3 years ago
  1. ... I noticed @g30r93g's plugin did also have a rare tendency of getting the power states confused in his plugin.

Yes I wasn't tracking the Screen's State correctly so whenever you used the physical remote it wouldn't be accurate and that sometimes would crash homebridge. @AntonioMeireles has done a fantastic job of this plugin, a way better job than my hack 😄

AntonioMeireles commented 3 years ago

@Marfre888

this is now in shipping 2.0.11. confirm please that it works /behavesper your request / expectations 😄 .

and many thanks for your patience!

Marfre888 commented 3 years ago

@Marfre888

this is now in shipping 2.0.11. confirm please that it works /behavesper your request / expectations 😄 .

and many thanks for your patience!

Hi,

  1. Works great. Thank you. It's awesome that I don't have to have a checklist of things to do after I restart homebridge

  2. Was this also incorporated?

AntonioMeireles commented 3 years ago

@Marfre888 this is now in shipping 2.0.11. confirm please that it works /behavesper your request / expectations 😄 . and many thanks for your patience!

Hi,

  1. Works great. Thank you. It's awesome that I don't have to have a checklist of things to do after I restart homebridge

thanks! great to hear.

  1. Was this also incorporated?

WoL support is being worked on. see here for details.

going to close this one as it is done / working. feel free to reopen if issues arise again!

thanks again for your patience!

Marfre888 commented 3 years ago

Hi @AntonioMeireles,

I tried installing the beta, however, it doesn't address my 2nd issue. My TV isn't that old so I'm not after a WOL feature

My issue is this;

When restarting homebridge, if the tv is switched off (not in standby), the plugin decides to ignore it and in turn, the Home app displays no response on the tile which can only be fixed by restarting homebridge again.

What I think should happen, is while the plugin is loading (after a homebridge restart), if a TV has been assigned to a specific IP in the config. If the TV is not found on that IP, it should assume it as being switched off instead of ignoring it, and continue to ping it periodically for power state as it does now.

AntonioMeireles commented 3 years ago

@Marfre888

ah, got it now. right now, that behaviour is by design, and there are reasons for it. sadly fixing it will force some design changes in the plugin structure. will see what i can do!

Marfre888 commented 3 years ago

@AntonioMeireles

Thank you for incorporating this, can confirm it does load TV as off and turns off as soon as I turn on TV.

However in homebridge log I get this error, homebridge stil seems to load fine

getSpecs: Error: connect EHOSTUNREACH 192.168.1.14:55000 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) { errno: -113, code: 'EHOSTUNREACH', syscall: 'connect', address: '192.168.1.14', port: 55000, config: { url: 'http://192.168.1.14:55000/nrc/ddd.xml', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.21.0' }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 3500, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], data: undefined }, request: <ref 1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false }, _events: [Object: null prototype] { response: [Array], error: [Function: handleRequestError], timeout: [Function] }, _eventsCount: 3, _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: 10485760, protocol: 'http:', path: '/nrc/ddd.xml', method: 'GET', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: '192.168.1.14', port: '55000', nativeProtocols: [Object], pathname: '/nrc/ddd.xml' }, _ended: true, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Socket], _header: 'GET /nrc/ddd.xml HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'User-Agent: axios/0.21.0\r\n' + 'Host: 192.168.1.14:55000\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/nrc/ddd.xml', _ended: false, res: null, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: '192.168.1.14', protocol: 'http:', _redirectable: [Circular 1],

  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'http://192.168.1.14:55000/nrc/ddd.xml',
_timeout: Timeout {
  _idleTimeout: -1,
  _idlePrev: null,
  _idleNext: null,
  _idleStart: 12253,
  _onTimeout: null,
  _timerArgs: undefined,
  _repeat: null,
  _destroyed: true,
  [Symbol(refed)]: true,
  [Symbol(kHasPrimitive)]: false,
  [Symbol(asyncId)]: 813,
  [Symbol(triggerId)]: 809
},
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] } [12/15/2020, 10:28:55 AM] [PanasonicVieraTV] WARNING: unable to fetch specs from TV at '192.168.1.14 [12/15/2020, 10:28:58 AM] [PanasonicVieraTV] successfully loaded Upstairs Living Room Television

AntonioMeireles commented 3 years ago

@Marfre888

thanks for your feedback. incorporated it into just released homebridge-vieramatic@2.0.13.

Is there anything else regarding this issue still worth fixing ?

thanks again for your patience and have a great weekend!

Marfre888 commented 3 years ago

@Marfre888

thanks for your feedback. incorporated it into just released homebridge-vieramatic@2.0.13.

Is there anything else regarding this issue still worth fixing ?

thanks again for your patience and have a great weekend!

Hi @AntonioMeireles,

This is working great. Thank you so much.

I'm still getting the above error in the logs when I restart homebridge with TV off, but otherwise, it works great.

Can this be safely ignored?

Thanks

AntonioMeireles commented 3 years ago

yes, it can. it's just saying that it isn't being able to reach the TV (which is factually true ).

will close. please reopen if something is still wrong.

All the best and happy new 2021