Closed anoldgreydog closed 3 years ago
Update
I manually edited vieramatic.json to remove the duplicate entry and it now appears on the "accessories" tab but hasn't appeared in the Home app (it's been about 5 minutes).
It looks like there may be some cleanup missing on uninstall. It's possible that I added hdmi 3 twice the first time I tried the plugin, but I went through a full uninstall (including config) and reinstall, so I know I didn't add it twice the second time.
yup, the issue is that you duplicated the hdmi port id which has to be unique. i'll add a check to block that in my side soon.
for now removing the hb bridge from the home.app, removing the accessories/vieramatic.json
file, restarting homebridge (now with a fixed config without duplicated hdmi port ids) and re adding the hb bridge again to home.app again should be enough. Please do note that you ned to add both the bridge and TV itself to home.app.
hope this helps, if not just bug me :-)
thanks for your patience!
@anoldgreydog
fwiw homebridge-vieramatic@2.0.25
that just got published has a fix that now avoids an hard crash when duplicated entries are found (just ignores them) while having error messages a bit more helpful to the end user.
Thanks for the help. The Home app is asking me for an 8 digit code to add the TV, but I can't find anything resembling that. Am I being dense or is there something else I need to do?
that's the 'pin' defined in your homebridge.conf
. or if not there in the homebridge boot logs ...
search on them for something along ...
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:
┌────────────┐
│ 012-34-567 │
└────────────┘
Starting to advertise 'homebridgeMobile 7732' using bonjour-hap backend!
hope this helps
Ah right, thanks. I hadn't connected the two.
Hi Antonio. Thanks for all the help; I finally got it connected, but I don't think it's going to be right for me.
I prefer to have my TV switched off at the socket, rather than leave it on standby (partly because I have a LED strip powered from the USB socket, and that stays on when the TV is on standby, partly because I don't like leaving things on standby if it's not necessary). If I cut the power, then the plugin stops working the next time the TV is switched on. I get errors like this:
[18/02/2021, 13:44:24] [PanasonicVieraTV] setInput 2 Error: Request failed with status code 500
at createError (/usr/local/lib/node_modules/homebridge-vieramatic/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-vieramatic/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-vieramatic/node_modules/axios/lib/adapters/http.js:260:11)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
config: {
url: 'http://192.168.0.50:55000/nrc/control_0',
method: 'post',
Even if I just turn it off at the back of the set, it fails when I switch back on.
It's annoying because it works really nicely when it's connected, but I don't want to have to restart the Homebridge server every time I turn the TV on.
Thanks again for the assistance in getting it going.
@anoldgreydog
can you paste the full error log from where the snippet above come from ? the plugin should afaict recover gracefully from the TV being powered down.
Thanks!
@AntonioMeireles OK, thanks for getting back to me. Here's the log from when I restarted the server. I've removed some activity from TuyaWeb and SmartThings plugins, but it's otherwise complete.
I hope we can get this working fully - it has so much more capability than the official Panasonic Alexa skill (which is pretty useless, TBH). Plus I can use Shortcuts to do cool things...
Ok. many thanks!. digging. will get back to you soon.
@AntonioMeireles If it's any help, I tried to be a bit more scientific about it.
Great job - huge THANKS!.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>612</errorCode>
<errorDescription>No such session</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
seems to be the culprit, as the TV gets OFF and then ON its' own session counters get reset on TVs side which messes with the plugin's ones. Need to spot a way to handle this smoothly. expect a test version soon with a tentative fix or workaround. Will be only after i release a version with full support for homebridge@1.3.0
which should be out very, very, soonish, probably later today.
Thanks again for your patience!
Good to know you've found a possible culprit. Take your time; I've lived without it for years, a few days isn't going to be a problem. Also, I was a software guy for 30 years, I know exactly what it's like trying to track down bugs.
Hi @anoldgreydog,
i've just published homebridge-vieramatic@3.0.7-beta.1
which should have finally this fixed, while also not inducing any undesired side effects. Could you please give it a try and feedback ? [installation should be along sudo npm i -g homebridge-vieramatic@3.0.7-beta.1
albeit that's not a given and is your local setup dependant]
Thanks again for your patience and have a great weekend!
António
Thanks @AntonioMeireles. I will give it a go, but it may have to wait until tomorrow. I'll get back to you as soon as I've tried it out.
@AntonioMeireles It looks good. I've tried it by switching the TV off at the socket and then back on again, and it all looks to work properly. There's a message:
[28/02/2021, 10:29:53] [PanasonicVieraTV] A session mismatch was found, so the session counter was reset in order to move on.
which I assume is your fix.
I do still have an issue that, if I try to control it via Shortcuts, it will do everything except set the input back to HDMI 1. Probably a problem with shortcuts (HDMI1 is the first entry in the selector list, so maybe it's treating it differently) - I only raise it in case you've seen something similar and know a work-around. It's not a problem with the plugin, since it works fine if I make the selection from the Home app. I just wanted a Shortcut because it's a, you know, shortcut. 😎
I'm also seeing
[28/02/2021, 10:30:54] [homebridge-vieramatic] This plugin slows down Homebridge. The read handler for the characteristic 'Active' on the accessory 'Viera B455' was slow to respond! See https://git.io/JtMGR for more info.
Should I configure the plugin as an isolated bridge? It suggests that running it as an such can improve responsiveness and reliability.
--
Then I got another one (in red!) which said
[28/02/2021, 10:41:56] [homebridge-vieramatic] This plugin slows down Homebridge. The read handler for the characteristic 'Active' on the accessory 'Viera B455' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
I suppose this could be related to switching it off and on at the wall socket - I got a 'not responding' warning inside the Home app. Probably an unfortunate timing thing, as I just tried it again, and it came up fine and updated itself nicely. Still, it's there if you want to have a look - it doesn't seem to do any lasting damage.
@anoldgreydog
thanks for your quick feedback. some comments bellow:
[PanasonicVieraTV] A session mismatch was found, so the session counter was reset in order to move on.
this is indeed the signature of the fix.
regarding...
(...)it will do everything except set the input back to HDMI 1.(...).
This is expected and i just have no way of fixing this without Panasonic's help.
The issue is that i'm simply not aware of ANY way to get the input being used from the TV (as we have for sound's volume) at any given moment, so the plugin isn't simply aware of what to go back to as regarding inputs it isn't aware of TV's input (and/or apps) state.
It is true that the plugin is able to switch apps/inputs (and could be told to remember last one set) but that isn't a specially reliable thing as on the real world people will also use traditional remotes which quickly would get everything on non deterministic states. So, so far, nothing really to do here, yet ...
the remaining errors are more or less expected, and should be safe to ignore - it's just the plugin (and homebridge/homekit) getting accommodated that the TV is gone.
So, unless homebridge, the plugin, or the Home.app hang for real, and are not able to recover themselves (it shouldn't really happen anymore now AFAICT) everything is behaving as it should.
All the best, and a great weekend!
P.S. FWIW unless critical issues arise i expect to get this out of beta later today or mid tomorrow for wider consumption.
@AntonioMeireles
Thanks for everything you've done, it's been great working with someone so responsive.
The issue with switching inputs is a Shortcuts problem, I'm pretty sure. I'm just asking it to switch to an input, so the one it's currently on is irrelevant. Also, it works fine if I do it directly in the Home app - long-press the tile, select the input and it sets it with no problem. If I set any other input by sending the request to the Home app from a shortcut, that works fine. It's only when I try to set HDMI1 by sending a request from Shortcuts that it fails. Even then, it's only an issue because that's the only input that doesn't get automatically selected by the device that's connected to it and it's a pain having to dig out the remote just to do that one specific job. I can live with doing via Home, rather than the shortcut.
Thanks again for all your help.
@anoldgreydog
thanks for your update. regarding the original issue OK to close ? or you feel that's still room for improvements ?
thanks again for your patience!
@AntonioMeireles
It's fine as far as I'm concerned. I did a bit more poking and managed to fix the other problem. It now sets HDMI1 from a shortcut correctly. I don't what fixed it, but everything is now working as I expect, so feel free to close and many thanks for your efforts.
@anoldgreydog
thanks me too
All the best,
Describe your issue I have installed the plugin and gone through the setup process, apparently successfully. It made the connection and got the two codes. However, it's not appearing under the Accessories tab or in the Home app. Looks like the plugin is hitting an unhandled exception:
There is a duplicate hdmi entry in the vieramatic.json that looks to be related:
it only appears once in the config.json, though.
Issue Context Please add the following items, when applicable:
the homebridge logs, up from starting until the bug popped up there.
[18/02/2021, 09:45:57] Homebridge is running on port 51825. [18/02/2021, 09:45:57] [PanasonicVieraTV] found a 'Panasonic VIErA' TV (TX-49FX700B) at '192.168.0.50' (requires crypto for comunication).
(node:2602) UnhandledPromiseRejectionWarning: Error: Cannot add a Service with the same UUID '000000D9-0000-1000-8000-0026BB765291' and subtype '3' as another Service in this Accessory. at Accessory._this.addService (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:281:17) at PlatformAccessory.addService (/usr/local/lib/node_modules/homebridge/src/platformAccessory.ts:92:41) at VieramaticPlatformAccessory.configureInputSource (/usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:386:35) at /usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:315:12 at Proxy.forEach ()
at new VieramaticPlatformAccessory (/usr/local/lib/node_modules/homebridge-vieramatic/src/accessory.ts:313:35)
at VieramaticPlatform.deviceSetup (/usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:217:14)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at /usr/local/lib/node_modules/homebridge-vieramatic/src/platform.ts:63:23
(Use
node --trace-warnings ...
to show where the warning was created) (node:2602) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:2602) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. NOTICE: Temperature Unit is Now: (C) NOTICE: Updating Global Values | HubIP: 192.168.0.64 | UseLocal: false WARN: Devices to Remove: (0) [] INFO: Devices to Update: (9) GOOD: Devices to Create: (0) [] ALERT: Total Initialization Time: (1 seconds) NOTICE: Unknown Capabilities: [] INFO: SmartThings DeviceCache Size: (9) INFO: WebServer Initiated... INFO: Sending StartDirect Request to SmartThings | SendToLocalHub: (false) INFO: Direct Connect Active | Listening at 192.168.0.83:8000 INFO: SmartThings-v2 Hub Communication Established [18/02/2021, 09:45:58] [TuyaWebPlatform] Missing requiredid
property on device configuration, received: { "device_type": "form" } [18/02/2021, 09:45:58] [TuyaWebPlatform] Existing Accessory found [Name: Socket 2] [Tuya ID: bfc10568288fbaa03cyijx] [HomeBridge ID: 55d9cb9f-054b-4422-8f68-9a078d45904c] [18/02/2021, 09:45:58] [TuyaWebPlatform] [Socket 2] Characteristic.On - {"format":"bool","unit":null,"minValue":null,"maxValue":null,"minStep":null,"perms":["pr","pw","ev"]} [18/02/2021, 09:45:58] [TuyaWebPlatform] Existing Accessory found [Name: Socket 1] [Tuya ID: bf0e97b0ddf9684ee2kfxa] [HomeBridge ID: 15279ff5-8fb6-4218-bd46-c6bd640b64fb] [18/02/2021, 09:45:58] [TuyaWebPlatform] [Socket 1] Characteristic.On - {"format":"bool","unit":null,"minValue":null,"maxValue":null,"minStep":null,"perms":["pr","pw","ev"]} [18/02/2021, 09:45:58] [TuyaWebPlatform] Existing Accessory found [Name: Spotlights] [Tuya ID: 715280524c11ae18fabd_1] [HomeBridge ID: 1d718dec-3142-4640-9d64-ae251d5a8f60] [18/02/2021, 09:45:58] [TuyaWebPlatform] [Spotlights] Characteristic.On - {"format":"bool","unit":null,"minValue":null,"maxValue":null,"minStep":null,"perms":["pr","pw","ev"]} [18/02/2021, 09:45:58] [TuyaWebPlatform] Existing Accessory found [Name: Worktop] [Tuya ID: 715280524c11ae18fabd_2] [HomeBridge ID: f78d0ac1-8e33-4605-8eb0-e906cb794e00] [18/02/2021, 09:45:58] [TuyaWebPlatform] [Worktop] Characteristic.On - {"format":"bool","unit":null,"minValue":null,"maxValue":null,"minStep":null,"perms":["pr","pw","ev"]} [18/02/2021, 09:45:58] [TuyaWebPlatform] Existing Accessory found [Name: Utility] [Tuya ID: 715280524c11ae18fabd_3] [HomeBridge ID: af4ec104-3b13-46df-9e90-1749f72a227a] [18/02/2021, 09:45:58] [TuyaWebPlatform] [Utility] Characteristic.On - {"format":"bool","unit":null,"minValue":null,"maxValue":null,"minStep":null,"perms":["pr","pw","ev"]} INFO: INFO: Your plugin version is up-to-date NOTICE: Sending Plugin Status to SmartThings | UpdateAvailable: false | newVersion: 2.3.8the contents of
accessories/vieramatic.json
(path is relative to homebridge's datadir)Details about your specific homebridge setup
anything else you may find relevant