BenPru / luxtronik

Luxtronik integration for Home Assistant
MIT License
66 stars 23 forks source link

Error message in attributes #168

Closed Linos88 closed 8 months ago

Linos88 commented 8 months ago

Hi, Can the error message be included in the attributes of "sensor.luxtronik_xxx_error_reason"?

I can read the error message in the card.

Bildschirmfoto 2023-10-22 um 16 00 50

But in the states I can only see the error code.

Bildschirmfoto 2023-10-22 um 15 57 22
BenPru commented 8 months ago

Do you mean you would like to see the Error code and not the Error text in the state? Thanks for your issue. I realized that the translation for cause and remedy texts are missing in the new version.

Linos88 commented 8 months ago

The Error text in the state (Lovelace UI) is nicešŸ‘

Can you enter the error text in the attributes? IMG_6372

Thank you very much for the great work. It has become a very good integration

BenPru commented 8 months ago

The text is a translation and you can not get it out of the HA functionality. This wish was rejected from the HA core team: PR 65743 You can use a plugin for this: Home-Assistant-custom-components-Custom-Templates

Linos88 commented 8 months ago

Ohh wow, that's interesting. Nevertheless, thank you for your support.

I have to think of something else how I can send myself the error text as a notification.

Gifford47 commented 6 months ago

@Linos88 @BenPru Did managed this issue or is any translation or attribute of the error text available? IĀ“ve still the same issue

Linos88 commented 6 months ago

@Gifford47 I have not found a way to get the error text. A new sensor must be created for this, with the right data point in the Luxtronic

BenPru commented 6 months ago

@Linos88 @BenPru Did managed this issue or is any translation or attribute of the error text available? IĀ“ve still the same issue

Yes: image

Gifford47 commented 6 months ago

but in the status attributes (code, cause, remedy) there's are only the code 717 stored. like posted here. @BenPru can you save the translation of the failure code into the appropriate attributes?

Linos88 commented 6 months ago

@BenPru šŸ‘.  IMG_6491 @Gifford47 Search for the "WP last error" sensor, here you will find the error text in the attributes

Gifford47 commented 6 months ago

Thanks for the answer, but I have the same issue as @Linos88. As you can see, the status attributes have only the code and not the translated text. In my case I want to send a notification to the mobile phone what the exact error is. Screenshot_20231214_200827_Home Assistant.jpg

BenPru commented 6 months ago

As you can see, the status attributes have only the code and not the translated text.

Yes, the raw value is always the code. The text comes with the translation in the frontend. And the notfiy services uses the raw values and doesn't make translations - it runs in the backend. I have no solution for this. You can create an issue in the HA core github.

Gifford47 commented 6 months ago

Ok, but would it be possible to read the appropriate translation JSON file, translate the error reason to a string and save it in some new text attributes? This could be done every time the sensor has changed. The necessary language is already defined by this awesome integration isn't it? :)