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

No such file or directory accessories/vieramatic.json #85

Closed tegola closed 2 years ago

tegola commented 2 years ago

Describe your issue

I have upgraded to Hoobs 4 on a Raspberry PI 4 and added a new bridge running only the Vieramatic plugin. I added my TV (which was running on Hoobs 3 a few days ago, with the same plugin) and got this error claiming that the vieramatic.json doesn't exists (which is true).

Issue Context

The vieramatic.json file doesn't exist, so the error is legit. Here's the logs:

7/11/2021, 23:43:25Vieramatic BridgeLoaded plugin 'homebridge-vieramatic'
7/11/2021, 23:43:25Vieramatic BridgeLoading 1 platforms...
7/11/2021, 23:43:25Vieramatic BridgePanasonicVieraTVlaunching encryption helper endpoint on :8973
7/11/2021, 23:43:25Vieramatic BridgePanasonicVieraTVhandling '192.168.1.232' from config.json
7/11/2021, 23:43:25Vieramatic BridgeBridge is running on port 51836.
7/11/2021, 23:43:25Vieramatic BridgePanasonicVieraTVfound a 'Panasonic VIErA' TV (TX-58EX700EA) at '192.168.1.232' .
7/11/2021, 23:43:25Vieramatic BridgePanasonicVieraTVInitializing 'TV' first time ever.
7/11/2021, 23:43:26Vieramatic BridgeWARNINGunhandled rejection: Error: ENOENT: no such file or directory, open '/var/lib/hoobs/vieramaticbridge/accessories/vieramatic.json'
tegola commented 2 years ago

More context: I have not used the Hoobs migration tool, the whole config was set from Hoobs UI, no manual config file tinkering.

AntonioMeireles commented 2 years ago

Hi,

a) can you log in into your HOOBs box and check if there's a vieramatic.json somewhere else in the filesystem there ? b) does /var/lib/hoobs/vieramaticbridge/accessories/vieramatic.json exist ? if so with which permissions and whit what inside ? c) if /var/lib/hoobs/vieramaticbridge/accessories/vieramatic.json doesn' t exist... does /var/lib/hoobs/vieramaticbridge/accessories/ exist ? if so whith which permissions ? If not some questions for /var/lib/hoobs/vieramaticbridge/... d) finally, do things behave if not using a bridge ?

Thanks in advance for your patience!

tegola commented 2 years ago

Hello!

Here's the entire file tree for /var/lib/hoobs. As you can see, there is not vieramatic.json, nor a accessories directory, only the vieramatic.accessories directory:

hoobs@raspi:/var/lib/hoobs $ tree -L 2
.
├── access
├── backups
├── bridges.conf
├── hoobs.log
├── hub
│   ├── cache
│   ├── package.json
│   └── themes
├── hub.conf
├── layout.conf
├── tuyawebbridge
│   ├── cache
│   ├── config.json
│   ├── node_modules
│   ├── package.json
│   └── yarn.lock
├── tuyawebbridge.accessories
│   └── cachedAccessories
├── tuyawebbridge.conf
├── tuyawebbridge.persist
│   ├── AccessoryInfo.4CB8A1FBD93C.json
│   └── IdentifierCache.4CB8A1FBD93C.json
├── vieramaticbridge
│   ├── cache
│   ├── config.json
│   ├── node_modules
│   ├── package.json
│   └── yarn.lock
├── vieramaticbridge.accessories
│   └── cachedAccessories
├── vieramaticbridge.conf
└── vieramaticbridge.persist
    ├── AccessoryInfo.2193706DF3B3.json
    └── IdentifierCache.2193706DF3B3.json

11 directories, 23 files

All these files have been created using Hoobs' UI, which can still manage it (if, for example, I delete a bidge from the UI, the bridge files vanis). Here are the permissions:

hoobs@raspi:/var/lib/hoobs $ ls -l
total 60
-rw-r--r-- 1 root root  832 Nov  7 23:18 access
drwxr-xr-x 2 root root 4096 Nov  7 23:17 backups
-rw-r--r-- 1 root root  456 Nov  8 21:40 bridges.conf
-rw-r--r-- 1 root root 3152 Nov  7 23:42 hoobs.log
drwxr-xr-x 3 root root 4096 Nov  7 23:30 hub
-rw-r--r-- 1 root root 2080 Nov  7 23:22 hub.conf
-rw-r--r-- 1 root root  159 Nov  7 23:22 layout.conf
drwxr-xr-x 3 root root 4096 Nov  7 23:43 tuyawebbridge
drwxr-xr-x 2 root root 4096 Nov  7 23:31 tuyawebbridge.accessories
-rw-r--r-- 1 root root  512 Nov  7 23:20 tuyawebbridge.conf
drwxr-xr-x 2 root root 4096 Nov  7 23:19 tuyawebbridge.persist
drwxr-xr-x 3 root root 4096 Nov  8 21:41 vieramaticbridge
drwxr-xr-x 2 root root 4096 Nov  8 21:40 vieramaticbridge.accessories
-rw-r--r-- 1 root root  512 Nov  8 21:41 vieramaticbridge.conf
drwxr-xr-x 2 root root 4096 Nov  8 21:41 vieramaticbridge.persist

For you question d), I have no way to test without a bridge. Hoobs' UI forces you to use a bridge, be it a new one or an existing one.

Thank you!

AntonioMeireles commented 2 years ago

@tegola - THANKs

this looks like an hoobs specific 'mis-feature' (that may be workaroundable from my side) as homebridge's api.user.cachedAccessoryPath() seems to be returning 'wrong' directory from HOOBs point of view (and according to the data you posted)

could you try please to manually create /var/lib/hoobs/vieramaticbridge/accessories/ directory and restart homebridge to check if things still fail and if so with which error ?

tegola commented 2 years ago

Manually creating the directory did the trick!

AntonioMeireles commented 2 years ago

@tegola

great to hear! will push a new version with the workaround in a bit ;-)

THANKS!

AntonioMeireles commented 2 years ago

@tegola

homebridge-vieramatic@3.2.3 is out and things should now work out of the box for your use case without any sort of manual intervention. could you confirm please ?

thanks again!

tegola commented 2 years ago

Hoobs plugin system still shows version 3.2.2. I'll check later, once 3.2.3 becomes available.

tegola commented 2 years ago

@AntonioMeireles flawless 🎉

Thanks

AntonioMeireles commented 2 years ago

@tegola

great to hear! Closing.

Cheers from Porto, Portugal!