tavicu / homebridge-samsung-tizen

Homebridge plugin for Samsung TV's with Tizen OS
MIT License
647 stars 89 forks source link

No labels on switches #623

Closed zx8 closed 1 year ago

zx8 commented 1 year ago

Similar to this issue - https://github.com/JeroenVdb/homebridge-daikin-cloud/issues/27

I have the same issue with the labels not showing in iOS 16 HomeKit. Another plug-in found a solution to fix it.

They wrote the following in the release notes in the update that fixed it:

„Added Configured Name characteristic to the Switch, Stateless Programmable Switch, and Lightbulb services. This appears to be necessary for HomeKit on iOS 16 to show anything other than the accessory name without manually changing all of the names within the Home app.“

Could we get the same fix in this plugin?

Thanks for the great work!

tavicu commented 1 year ago

Hi @zx8,

Thank you for the suggestion. Tested it and it works :)

I have just pushed a new version with the fix.

MarkBarbieri commented 1 year ago

@zx8, great find, and thanks for the quick implementation @tavicu

Metatropics commented 1 year ago

@tavicu Why decision to append device.config.name to accessory.config.name?

tavicu commented 1 year ago

@Metatropics because you can have the same switch, with the same name and you won't know of which device it is.

Or you can set the switches as general to apply to all devices and again, you will not know what parent does the accessory have.

Example:

{
    "platform": "SamsungTizen",
    "switches": [
        {
            "name": "Mute",
            "mute": true
        },
        {
            "name": "Sleep",
            "sleep": 60
        }
    ],
    "devices": [
        {
            "name": "Bedroom TV",
            "ip": "192.168.50.202",
            "mac": "7C:64:56:4D:DD:75"
        },
        {
            "name": "Living Room TV",
            "ip": "192.168.50.209",
            "mac": "7C:64:56:4D:DD:75"
        }
    ]
}

With the main device name prepended: Screenshot 2023-03-03 at 21 22 36

Without the name: Screenshot 2023-03-03 at 21 23 21

I don't think it's a big deal especially that Home app will remove the Room name from the accessory if it's the same.

For example if the room name is Bedroom and the accessory name is Bedroom TV Sleep you will only have TV Sleep in the name of the accessory when you are on that room.

Also you can change the name of the accessory in the home app :)

I will have to test if changing only ConfiguredName (like you did in the PR https://github.com/tavicu/homebridge-samsung-tizen/pull/624) will affect only what is shown in the main accessory popup or will change the name everywhere. I will test it tomorrow and if it's changing only the name from the popup I will merger the PR :)

Metatropics commented 1 year ago

But why do you make the decision of distinguishing switches, when the user can perfectly do that in the config if he desires? What's the point of allowing the configuration if you rename it?

Also you can change the name of the accessory in the home app :)

Wrong, it resets after every homebridge restart, hence my PR.

tavicu commented 1 year ago

But why do you make the decision of distinguishing switches, when the user can perfectly do that in the config if he desires? What's the point of allowing the configuration if you rename it?

Because not everybody that use this plugin knows how programming works and what logic it will have. The plugin is designed to work for everybody, including users that don't have anything with writing code :). So it should be as simple as it can for the normal user to find what every switch does.

Wrong, it resets after every homebridge restart, hence my PR.

I will have to test if changing only ConfiguredName (like you did in the PR https://github.com/tavicu/homebridge-samsung-tizen/pull/624) will affect only what is shown in the main accessory popup or will change the name everywhere. I will test it tomorrow and if it's changing only the name from the popup I will merger the PR :)

tavicu commented 1 year ago

I have tested and if only ConfiguredName is changed then it will be changed in the Home app but not in the Homebridge UI Accessories tab.

IMG_3845

I will think regarding the change, but at the moment I am inclined to stay like this. Because 99% of users will name the TV like their room name.

IMG_8C1C88095449-1

Another solution and the best one that I can think right now will be to create an option that allows you to choose if you want to prepend the main device name or not.

Wrong, it resets after every homebridge restart, hence my PR.

Ideed. I will look into that and see if we have any options to fix it.

Metatropics commented 1 year ago

Because not everybody that use this plugin knows how programming works and what logic it will have.

It's not required. If you're using this plugin, you know your away around config.json

Because 99% of users will name the TV like their room name.

Then I guess I'm in the 1%. I consider it redundant when it's very clear what room it's in. Same as the switches, it's clear what device it belongs to. And as mentioned, if I want to name it however I want to distinguish it and prefix it with whatever, I should have that ability.

Screenshot 2023-03-03 at 2 34 15 p m

Another solution and the best one that I can think right now will be to create an option that allows you to choose if you want to prepend the main device name or not.

That's very straightforward, I'll can look into it.

tavicu commented 1 year ago

That's very straightforward, I'll can look into it.

Yup, it's easy to do it :) I will make the change tomorrow and come back with a comment after I have released the new version

Metatropics commented 1 year ago

Cool!

I kept thinking about this and had some lingering questions:

tavicu commented 1 year ago
  • This is only for the scenario when switches are shown as separate tiles, right? Otherwise I struggle to see a chance of confusion.

For Home app, yes, when they are shown as separate tiles. For Homebridge UI it will be every time :)

  • When is confusion happening? Would a serial number help to display helpful info?

In the Home app the only connection between a separate tile and the main accessory is by looking at the Serial Number where the IP is shown.

  • Will the config option be on the switch or device level?

Device level, you can see current options that are created for Frame TVs here: https://tavicu.github.io/homebridge-samsung-tizen/configuration/frame-tvs.html#options

The current flow will remain as default and I will add a new option that will probably be Switch.PrependName.Disable which if it's selected it will not prepend the device name to switches.

  • For consistency will there be option to prefix room name to device names?

I don't understand the question. Homebridge don't have access to details of which room the device is assigned to.

Metatropics commented 1 year ago

Thanks I'm aware, though definitely not my point; just observing the unintended bias and consequences of imposing an inflexible nomenclature versus freedom of naming as structured or confusing as you want, like 99.99% of plug-ins do.

tavicu commented 1 year ago

Unfortunately the plugin cannot satisfy all users requests, but it does satisfy the majority. Fortunately GitHub have the option to fork the repository and change the plugin as you want :)

In 5 years since this plugin was released you are the first to have this problem. If it was a request from many users it would have been changed by now.

You can activate it by setting the option like this:

{
    "name": "Bedroom TV",
    "ip": "10.20.30.40",
    "mac": "A0:B1:C2:D3:E4:F5",
    "options": [
        "Switch.DeviceName.Disable"
    ]
}

After making the change you will have to restart your Homebridge server to apply it.

You can also read the documentation https://tavicu.github.io/homebridge-samsung-tizen/configuration/device-settings.html#options

Metatropics commented 1 year ago

the option to fork

Explain to me how on one hand you say the motivation behind the switches name change was so users don't have to deal with "code", but on the other you're quick to propose it and till today was the only option to opt-out of 5.2.5 change?

In 5 years since this plugin was released

Not sure what you're referring to, my only issue ever in years of plugin use was the aforementioned arbitrary switch name imposition of days ago, which was optional till today.

tavicu commented 1 year ago

Explain to me how on one hand you say the motivation behind the switches name change was so users don't have to deal with "code"

There are normal users who just want to install the plugin and that's it. And there are power users who can fork the repository and do whatever they want.

but on the other you're quick to propose it and till today was the only option to opt-out of 5.2.5 change? Not sure what you're referring to, my only issue ever in years of plugin use was the aforementioned arbitrary switch name imposition of days ago, which was optional till today.

I think you don't understand the change in 5.2.5, I just added a characteristic that apply when the switches are shown on the same device, the switch name was always defined like that and it was shown correctly until iOS 16 when something changed.

But I know you missed that line since you didn't even change it in your PR.

https://github.com/tavicu/homebridge-samsung-tizen/blob/v5.2.4/lib/services/switch.js#L20

If something don't fit your needs then it's not my fault, you should start learn and fulfill your needs, or hire someone to do it for you!

And as an example, I don't even use this plugin anymore because I have migrated to another platform, but I still help you guys. Also, even when I have used the plugin, I only needed to be able to turn it On and Off, nothing more, but I did implement new features and extended the plugin when more people asked for it and they were nice.

At this point I will stop responding to your messages because it seems nothing can make you happy and you also look irritated.

Metatropics commented 1 year ago

There are normal users who just want to install the plugin and that's it. And there are power users who can fork the repository and do whatever they want.

And there’s that bias in UX I mentioned.

I think you don't understand the change in 5.2.5

Thank you for assuming I don’t understand ONE LINE of code.

I just added a characteristic that apply when the switches are shown on the same device, the switch name was always defined like that and it was shown correctly until iOS 16 when something changed.

I’ve been on iOS 16 forever and this new “feature” of overwriting configured name with prefixed name on reload barely started with v5.2.5

But I know you missed that line since you didn't even change it in your PR.

If anyone missed anything it was you, I just modified the only line you added.

If something don't fit your needs then it's not my fault, you should start learn and fulfill your needs, or hire someone to do it for you!

So I was happy with how something has worked forever, you change it, I point out an issue, you hurriedly provide a way to opt out 2 days later, but it’s all somehow my fault?

because it seems nothing can make you happy and you also look irritated.

I’m not the one ending the argument, my dude.

seanmcquade20 commented 1 year ago

I'd have to say I agree with @Metatropics on this one. I just name my TV "TV" and add it to the correct room. Forcing "TV" in front of every switch does make voice automations a little more cumbersome than they need to be. I've added the code manually to the plugin config.json for now to stop this from happening. Would be great if we could have it as an toggle option in the config going forward.