Coder Social home page Coder Social logo

Comments (6)

GiorgioUghini avatar GiorgioUghini commented on May 26, 2024 1

I think this relates with HA and not directly with this integration.
Displaying 512 instead of a string is the wanted behavior as you can interpret 512 as a state that does not change if you change localization.
See this pull request in HA core: home-assistant/core#65743

P.s.: really need to have the localization in your template? As a temporary solution you can use a custom component like this one: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Custom-Templates

from homeassistant-fusionsolar.

PiotrMachowski avatar PiotrMachowski commented on May 26, 2024 1

@olibos PiotrMachowski/Home-Assistant-custom-components-Custom-Templates#1

from homeassistant-fusionsolar.

olibos avatar olibos commented on May 26, 2024 1

Thank you @PiotrMachowski ,
I've installed the version 1.0.1 and it works perfectly!

Template:

Sun State: {{ states("sun.sun") }}
Sun Label: {{ ct_state_translated("sun.sun", "en") }}
Inverter State: {{ states('sensor.inverter_1_inverter_status') }}
Inverter Label: {{ ct_state_translated("sensor.inverter_1_inverter_status", "en") }}

Result: 👍

Sun State: above_horizon
Sun Label: Above horizon
Inverter State: 512
Inverter Label: Grid connection

I hope, your proposal reach HomeAssistant Core 😉. But in the meantime it's a good workaround!
Thanks @GiorgioUghini for the suggestion!

@tijsverkoyen , it could be good to mention @PiotrMachowski integration in the README to help people in the same use case.
What do you think?
If it helps, I can make a PR with some text suggestions.

from homeassistant-fusionsolar.

tijsverkoyen avatar tijsverkoyen commented on May 26, 2024

Which version of Home Assistant are you using?

from homeassistant-fusionsolar.

olibos avatar olibos commented on May 26, 2024

Hello @tijsverkoyen ,
Here is my setup:

Home Assistant 2023.2.0
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230201.0 - latest

Here is a sample of my Issue:
image
With the following YAML

  - entity: sensor.inverter_1_active_power
    type: custom:template-entity-row
    secondary: |
      {{states('sensor.inverter_1_inverter_status')}}
    icon: mdi:solar-power
    name: Soleil

As @GiorgioUghini says, it's not related to your integration but more a general question.
And I agree in most scenarios it's easier to handle codes than texts but for Lovelace dashboard it's not really user friendly ðŸĪŠ.

I'll try @GiorgioUghini 's workaround in the meaning time, I'll let you know if it works for me

from homeassistant-fusionsolar.

olibos avatar olibos commented on May 26, 2024

Unfortunately, it does not solve my problem 🙁.
After installing @PiotrMachowski 's package:

Template:

Sun State: {{ states("sun.sun") }}
Sun Label: {{ ct_state_translated("sun.sun", "en") }}
Inverter State: {{ states('sensor.inverter_1_inverter_status') }}
Inverter Label: {{ ct_state_translated("sensor.inverter_1_inverter_status", "en") }}

Result

Sun State: below_horizon
Sun Label: Below horizon
Inverter State: 0
Inverter Label: 0

from homeassistant-fusionsolar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google âĪïļ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.