homebridge-samsungtv-control2
homebridge-samsungtv-control2 copied to clipboard
Unable to get USN / UUID
Hi @mmende,
Thanks for creating plugin. Nice job 👍 I did get the pair1 to work and i have token. But I'm not able to get the USN / UUID, it is not presentet in the logs.
Plugin loads:
Pair works:
But no USN / UUID in logs.
Any pointers?
Nice to hear that pairing worked at least. Can you tell me the model number of your tv? It might not be covered by my model parser function yet.
Hi @mmende,
Thanks for getting back to me so quick 👍 Modell is UE65HU7505 I think it is a 2014 model.
Hi @mmende ,
Another thing that would be great where to get the config posibillity to add condifg via the Home Bridge WEB UI: If you want your plugin to show a config UI editor in the plugin homebridge-config-ui-x, you can add a file config.schema.json to the root of your plugin.
The specifications of that JSON schema are detailed in https://github.com/oznu/homebridge-config-ui-x/wiki/Developers:-Plugin-Settings-GUI
It's def not a mandatory thing to have in your plugin, but it helps many users that use that UI homebridge plugin to maintain their installation and don't want to mess up with JSON editing 😉
Ok the model number can be parsed and the tv is from 2014 (npx homebridge-samsungtv-control model UE65HU7505
). Therefore the discovery seems to have problems discovering your tv. Can you try a manual discovery by running npx homebridge-samsungtv-control discover
(note that this doesn't add the tv to homebridge but rather exists for debugging purposes...)
I already added a basic json schema but renamed it to _config.schema.json
for now because you would have to wait for the device discovery anyway and I thought it might be more confusing to be confronted with the ui when you can't really add any configuration before knowing the parameters. However you could theoretically run the manual discovery before and acquire the usn's etc. before now. It might be a good idea to add it back and add some documentation for this way of setting it up. The json editing is also a good argument for doing so.
Hi @mmende,
I suggest a "good" instruction in web ui about steps needed to fill config page. Or perhaps a "button/link to press in the UI to perform discovery? Might not be that easy to configure. Someone is bound to do it wrong anyways, but you know :)
Debugg info:
C:\Windows\System32>npx homebridge-samsungtv-control discover
Searching for devices...
(node:3120) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found)
at EventEmitter.--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3120) [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.
(node:3120) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:3120) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found)
at EventEmitter.--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
C:\Windows\System32>
Hm, seems to be the same error as in #23 ... I will have to figure out a way to reproduce this problem.
Concerning config ui: I don't know if it is possible to add buttons with interactions within config ui but this would probably be the nicest solution.
Hi @mmende,
I tried to use http to se if my TV actually respondet to something:
This is http://IP:8001
Is it a setting that might need to be enabled on the TV to get a response?
Ah if I use the whole string api/v2/ i get alot of information from the TV:
Is the ID the same as USN / UUID?
Where is the _config.schema.json located? It would not mind trying it out.
Yes id seems to be the same. I saw some options to disable/enable network control on my tv's but the menu structure varies strongly across models.
You can find the file here. However I didn't touch the file for some commits now and cannot guarantee that it fully works with the current configuration. The file is not being published at the moment, therefore you have to copy it to the location where the plugin is installed yourself (so in your case C:\Users\kenneth\AppData\Roaming\npm\node_modules\homebridge-samsungtv-control
)
Hi @mmende,
I added the config file and added configuration:
Config file:
Everything looks good, but I get error in log:
No butten apear in homeapp.
Yeah this is the same error as in #23 . This error seems to appear in the device discovery and will therefore lead to the plugin not being able to be loaded successfully. I will let you know (in this thread) when I know what's going on there.
@mmende thank you :)
@mmende, I see that a new release is out, but web config has changes a lot and does not contain the USN, token and name config part. How is config suppose to look now?
Thanks!!
The config shouldn't have changed actually. Can you tell me which changes you mean exactly?
Kind regards
Now it looks like this:
Before you can see a bit up this page.
The config should look the same as before e.g. like this:
{
"platform": "SamsungTVControl",
"name": "SamsungTVControl",
"devices": [
{
"usn": "uuid:a7001fbe-c776-11ea-87d0-0242ac130003",
"name": "Bedroom TV",
"token": "YOUR_PAIRING_TOKEN",
"inputs": [
{
"name": "Sleep 30m",
"keys": "tools,down*3,enter,down,enter,return"
}
]
}
]
}
...basically as described in the readme examples. I guess the new top level name
property comes from a slightly changed function call that registers the plugin within homebridge. Apart from that all should be compatible with the current release.
Ok, thanks. Strange the plugin UI dont show the same. I'll have a go manual config.
I didn't reactivate the schema json file yet because I want to extend the command line tools so far that you can get all infos you need upfront. Otherwise I suspect people to be a bit overwhelmed by the config screen with a lot of infos they don't have yet when they initially install the plugin.
Ah, yes that is correct. I'll look at enabeling the extention to see how it looks. I'm not to good with code.
Enabling web ui, I god this:
And it created this input to config:
It is a bit different from what your config example and the device dont what up in Apple Home. No error during restart :) So I´ll try to change config manually to see if that helps.
Hm... it looks like you twisted usn and token and furthermore as far as I remember correctly the usn usually starts with uuid:
. You can run npx homebridge-samsungtv-control discover
to get the correct usn without needing to crawl through the homebridge log if that helps.
You are right, I did reverse them. When trying the pair1, I don't get the UUID/USN presented in logs so I picked it up from http://tv_ip:8001/api/v2/ there it is shown without uuid:
So I changed it, and let plugin UI do the config.
No error on startup, plugin is loading, but there is no entry in log for Samsung TV other than this:
Ok, did running npx homebridge-samsungtv-control discover
list your tv?
I get this:
This states a different uuid as well.
Hm ok ... this might also be another upnp device in your network and can be ignored if the usn differs. However as from the pictures above it seems like your tv does not expose the manufacturer field which this plugin currently uses to find out which upnp devices are possible samsung tv's. Therefore your tv might not be listed yet. I might remove this part in the next version as the plugin can also use the modelName property to identify samsung tv's (which your tv seems to expose as expected). I'll let you know when I published the next version with this fix included.
@mmende thanks :)
Just a quick update @mmende, I did get the device in home kit, but it is not doing anything. That in it self is not strange sins tv is not connecting.