ekutner / home-connect-hass

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

BSH Dishwasher operation state issues #274

Closed pabsi closed 9 months ago

pabsi commented 9 months ago

Describe the bug

I am having issues trying to read/consume the operation state of my dishwasher washing program, because instead of "Run" is reporting it as "BSH.Common.EnumType.OperationState.Run". The dishwasher sensor being (in my case): 262080629728002257_bsh_common_status_operationstate

For example, I use conditional cards to display the remaining time if it is running, but hide it otherwise. To achieve this, I use this code:

      - entity: sensor.262080629728002257_bsh_common_status_operationstate
        state_not: BSH.Common.EnumType.OperationState.Run

The interesting thing is that when I click on the entity, the history data is shown as "Run" or "Ready": image

Version of the custom_component

I am using version 0.6.8 as per HACS.

Configuration

I am not using any special YAML config. Just the integration and displaying the data with the above block of code.

Debug log

Not providing logs, since I do not believe this is a bug, but just the way the information retrieved from the BSH cloud is displayed.

Please correct me if I am wrong.

I'd also like to take the opportunity to thank you, the author, for such amazing integration (much, much better than the official one!). Finally selecting programs via a dropdown, and a button to start the program :clap: Perfect :pray:

ekutner commented 9 months ago

Thanks, I'm glad you like it. But I don't understand your issue. Are you saying that you have to check for a value of "BSH.Common.EnumType.OperationState.Run" when you expect it to be just "Run"? If so then that is by design. The display value of "Run" which you see in the UI is is just a human readable translation of the internal value. I know it's different than how most HA integrations work but I believe that code shouldn't depend on human language. It shouldn't matter if your language is ENglish or German or Spanish, the code should be the same, which means the internal values should be language independent.

If you really want to change this behavior you can add sensor_value_translation: server to your configuration which will set the sensor values to the actual text.

pabsi commented 9 months ago

Thank you for your response @ekutner

I see. I understand you. It's just not very user friendly to write automations with such complex, non-user-friendly values. But thankfully my automation is now finished, so it was a matter of curiosity really.

Thank you again :pray:

ekutner commented 9 months ago

I've added a note about it to the README