ekutner / home-connect-hass

Alternative (and improved) Home Connect integration for Home Assistant
MIT License
511 stars 53 forks source link

Why are all devices named "Siemens Siemens ..." #242

Closed AleXSR700 closed 10 months ago

AleXSR700 commented 11 months ago

Describe the bug

A clear and concise description of what the bug is.

Hi, I just switched from the old Home Connect to this alternative and all my entities' friendly_names start with "Siemens Siemens" instead of just one "Siemens".

Version of the custom_component

Configuration


Add your configuration here.

Debug log

Paste the exception info here
ekutner commented 10 months ago

it's a good idea to provide the requested information when opening an issue. What is your configuration?

AleXSR700 commented 10 months ago

My configuration is default. So id and password. That's why I did not post anything there. :)

ekutner commented 10 months ago

I can only assume that your appliance name, as it comes from the API includes the brand name. You can use the name_template parameter to control how the friendly name is constructed. Check out the README for more information.

AleXSR700 commented 10 months ago

But would that not affect all devices then? Or do you mean that Siemens/Bosch sometimes adds the manufacturer to the device name and sometimes they do not? Because the default template should also include the appliance type, which is not shown.

I will try with just the name and report back :)

ekutner commented 10 months ago

I've never seen them do that before but since the default friendly name is just a concatenation of the brand + appliance name + control name the only way it would get duplicated is if the appliance name contains the brand name. This can be verified if you press the "Home Connect Debug" button in the UI and upload the log file.

AleXSR700 commented 10 months ago

So, I changed template to just $name and then the entities' friendly names were all just the pure name of e.g. the program, like "Brilliance Dry" for one of the dishwasher programs. Interestingly, the entity_id did not change and was correct. So binary_sensor.siemens_sx758x06te_68a40e1dc037_dishcare_dishwasher_option_brilliancedry. After changing to $manufacturer - $name the friendly name was "Siemens - Brilliance Dry" (entity_id remained unchanged). So also logical.

When I then siwtched to $appliance - $name I only got "- Brilliance Dry". So no manufacturer or model.

I then switched back to $brand $appliance - $name and am now seeing "Siemens Siemens SX758X06TE/42 - Brilliance Dry".

I am quite confused :D

Interestingly the device overview shows "manufacturer: Siemens" and "model "SX758X06TE" (without the "/42" at the end.

Can you make heads or tails of this?

Why is $brand = Siemens $appliance = $name = Brilliance Dry and $brand $appliance - $name = Siemens Siemens SX758X06TE/42 - Brilliance Dry

How funny! :D

Btw., I enabled logging but saw no info on restart.

ekutner commented 10 months ago

The appliance should be "Dishwasher", in your case it seems to be "Siemens" and I can only assume it is coming that way through the API. The reason you didn't see it when you only used "$appliance" is because HA has some logic to hide common prefixes of entity names (but I never bothered looking exactly what is the logic there so can't say why it didn't hide the "Siemens Siemens" prefix.

You don't need to enable logging, just press the Home Connect Debug button.

AleXSR700 commented 10 months ago

I meant the debug logging. :)

Appliance then would need to be "Siemens SX...", so make and model. And the model is different from the model that I see in the devices overview. Is the "Model" information different from what you pull via $appliance?

P.S.: When I used $appliance - $name I also did not see it. So HA must be filtering it out if it is the beginning of something, not just standalone.

ekutner commented 10 months ago

really, just press the button and upload the log, that's the only suggestion I have.

AleXSR700 commented 10 months ago

home-assistant_home_connect_alt_2023-09-12T20-23-16.987Z.log

Nothing there

ekutner commented 10 months ago

you didn't push the "Home Connect Debug" button

AleXSR700 commented 10 months ago

I did. Tried it twice, actually. Worked for the tasmota integration (but there I could manually remove a device instead of only the entire integration, so maybe that was different).

I will try again with changing the template in case it does not check the name on boot.

AleXSR700 commented 10 months ago

Sorry, tried again ad changed the template twice and restarted HA. Names change and log remains empty.

ekutner commented 10 months ago

I'm not sure what you are doing but you are not PRESSING the button: image

AleXSR700 commented 10 months ago

home-assistant_home_connect_alt_2023-09-12T22-03-04.762Z.log

Sorry for that. I enabled debug logging as I do in all other integrations. I did not check for a dedicated additional debug button in the HCA device.

Looks like I would need enumber instead of name or $appliance without anything in front of it :)

ekutner commented 10 months ago

As I expected. This is your appliance name, as coming from the API:

      "name": "Siemens SX758X06TE/42",
      "brand": "Siemens",

And this is how it should be (copied from my appliance):

      "name": "Washing machine",
      "brand": "Bosch",

I don't know if this is something they have done on purpose or if someone just typed the wrong value in their database for your specific appliance. Anyway, you can manually change the names in HA if you wish. I'll close the issue now.

AleXSR700 commented 10 months ago

I have two devices and both show this.

Could you expose enumber? You are reading it, it is just not selectable via config yet :)

ekutner commented 10 months ago

How would that help? it's hardly a friendly name. A better solution would be to support a different name template per appliance, but that's not a quick fix and I don't have the time to work on it now.

AleXSR700 commented 10 months ago

Currently correct in my case would be $brand $enumber - $name

ekutner commented 10 months ago

enumber is not really a useful friendly name. so I don't see the point in doing that

AleXSR700 commented 10 months ago

"enumber": "SX758X06TE/42"

That is precisely the model number of the device. So combined with manufacturer it would be the correct friendly name.

No idea who is in charge of data at BSH, but clearly they are playing it fast and loose :-D

So I thought, since you are reading the data, maybe it would be possible to pass all properties of the json to the template. Users can then check the log to see which properties they need. In my cases manufacturer and enumber.

Bit I understand if the hassle is to big just because BSH has no system in place ;-)

ekutner commented 10 months ago

It may be "correct" but my point is that it is not friendly, I wouldn't want my wife to see such names in the dashboard. Bottom line is that the right solution is to allow customizing the template by appliance but it take a while before I have the time to do that.

ekutner commented 10 months ago

Well, I had some time while waiting for another job to complete. Look for "appliance_settings" in version 0.6.5.

AleXSR700 commented 10 months ago

It may be "correct" but my point is that it is not friendly, I wouldn't want my wife to see such names in the dashboard. Bottom line is that the right solution is to allow customizing the template by appliance but it take a while before I have the time to do that.

Interesting. And I was wondering who needs to know $appliance, because I know that the WM is the washing machine and the SX is the dishwasher :-D

I always have my devices named after their model and never "tv bedroom" or "tv living room" :-D

AleXSR700 commented 10 months ago

Well, I had some time while waiting for another job to complete. Look for "appliance_settings" in version 0.6.5.

I will this when I get home, thank you :-)

From description I am not sure yet if it will return a formatted version of the entity_id name "Bosch something" in your case or the actual "bosch_something".

But per appliance templating is definitely cool! :-)