Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request #55

Closed
labaland opened this issue Jun 16, 2022 · 12 comments
Closed

Request #55

labaland opened this issue Jun 16, 2022 · 12 comments
Labels
enhancement New feature or request

Comments

@labaland
Copy link

labaland commented Jun 16, 2022

Hi, i have a BOSCH dishwasher.
Is it possible to change "select" to a switch to power on & off?

select.010100522145000977_bsh_common_setting_powerstate

@GHeiner
Copy link

GHeiner commented Jun 17, 2022

Hi I support this request. I use for everything custom-buttons an d I'm using the layout from matt8707. So using a select is not handy.

@ekutner
Copy link
Owner

ekutner commented Jun 18, 2022

As a general rule the UI control to use is automatically detected based on the type of the entity in the HC API. A switch control is used for boolean entities, however the power state entity is not boolean (and in fact it has other states than on/off). All that said I think it does make sense to show a switch for appliances where the entity has exactly two states which happen to be on/off, so I've make that change and you can try it out with beta version 0.5.0-b8.
Note that this wasn't a trivial change so let me know how it works.

@ekutner ekutner added the enhancement New feature or request label Jun 18, 2022
@labaland
Copy link
Author

As a general rule the UI control to use is automatically detected based on the type of the entity in the HC API. A switch control is used for boolean entities, however the power state entity is not boolean (and in fact it has other states than on/off). All that said I think it does make sense to show a switch for appliances where the entity has exactly two states which happen to be on/off, so I've make that change and you can try it out with beta version 0.5.0-b8. Note that this wasn't a trivial change so let me know how it works.

Sweet!

And one more request:
is it possible for u or us? to change the state from "Dishcare.Dishwasher.Program.MachineCare" to "MachineCare" or / "Machine Care"

image

It is showing right here but not when using state templates with like custom:button-card:

image

@ekutner
Copy link
Owner

ekutner commented Jun 18, 2022

Enum values in history can't be translated, if you're seeing them in current values then please submit a PR with updates to the translation files. See #26 for more info.

@pswid
Copy link

pswid commented Jun 20, 2022

It works for some of the devices, but not all:

  • coffee machine also has two power states but instead On and Off it has On BSH.Common.EnumType.PowerState.On and Standby BSH.Common.EnumType.PowerState.Standby.
  • washing machine and dryer has also two states but On BSH.Common.EnumType.PowerState.On and "Totally off" (probably BSH.Common.EnumType.PowerState.MainsOff). Unfortunately if you remotely trigger state "totally off" washing machine or dryer powers off totally (so also disconnects from the cloud) and you can power it on again only locally. So maybe instead of on/off switch the better option would be just off button?

@ekutner
Copy link
Owner

ekutner commented Jun 20, 2022

@pswid I'm not sure what you mean. From what I understand from your description everything seems to be working fine.

@pswid
Copy link

pswid commented Jun 20, 2022

It does, but for the devices mentioned above, PowerStatus, although only two values are possible, is still displayed as select and not switch. Standby (and MainsOff?) should be equivalent to Off. Don't you think?

image

@pswid
Copy link

pswid commented Jun 20, 2022

I also noticed that for ovens integration shows PowerStatus as select with 4 options (on, off, mainsoff and standby) while only two of them are working (on and standby). The other two (off and mainsoff) cause 409 error.

I don't know why the HC API reports four available PowerState options for ovens, while the documentation https://api-docs.home-connect.com/settings#power-state mentions only about two of them (it's probably an API bug). So in the case of ovens, you could also make a switch (on and standby values) instead of select with options that are not working...

@ekutner
Copy link
Owner

ekutner commented Jun 20, 2022

The integration doesn't know anything about specific appliances or entities, everything is detected and generated on the fly and that is not going to change. If the API returns values other than On and Off then the control will be a select, that too is now a general handling of all entities and is not going to change. I can say that in many cases the documentation doesn't match the actual behavior so I'm not sure which one is wrong but assuming it's the API that HC will have to fix it on their side.

@GHeiner
Copy link

GHeiner commented Jun 21, 2022

Hi i tested the new power switch with my dishwasher and it worked excellent. I only have a Bosch Bosch dishwasher so I couldn't test more.

But fif you want me to test something please let me know.

@pswid
Copy link

pswid commented Jun 21, 2022

I can understand you don't want to make workarounds of the HC API errors (e.g. for four oven power states available although only two are working). However, why not to replace select by switch toggling between on and standby for devices that support only that two power states?

@ekutner
Copy link
Owner

ekutner commented Jun 21, 2022

There is nothing special about the power setting either. I added generic handling of enums that only have On/Off values but I don't want to second guess what the other values do.

@ekutner ekutner closed this as completed Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants