olicooper / esphome-nspanel-lovelace-native

Custom ESPHome component for NSPanel utilising the TFT firmware of the project 'joBr99/nspanel-lovelace-ui'
Other
34 stars 6 forks source link

[Feature] Screensaver Entities and Locales #22

Open r0bb10 opened 1 month ago

r0bb10 commented 1 month ago

Hi!

I've finally managed to test your esphome port for the nspanel, i wouls say it's pretty damn cool and works great so far (not tested extensively but i'm going to).

I've noticed some differences for now with the original tasmota/appdaemon version that maybe could be implemented:

nspanel_lovelace:
  id: nspanel
  sleep_timeout: 10
  locale:
    temperature_unit: celcius
    # day_of_week_map:
    #   sunday: ['Sun', 'Sunday']
    #   monday: ['Mon', 'Monday']
    #   tuesday: ['Tue', 'Tuesday']
    #   wednesday: ['Wed', 'Wednesday']
    #   thursday: ['Thu', 'Thursday']
    #   friday: ['Fri', 'Friday']
    #   saturday: ['Sat', 'Saturday']
  screensaver:
    time_id: homeassistant_time
    ## For formatting options see: https://cplusplus.com/reference/ctime/strftime/
    # time_format: '%H:%M'
    # date_format: '%A, %d. %B %Y'
    weather:
      # entity_id: weather.openweathermap
      ## NOTE: use this version (after following the instructions on the README) with Home Assistant v4.4.0+
      entity_id: sensor.weather_forecast_daily
  cards:
    - type: cardThermo
      sleep_timeout: 5
      title: Fancoil Living
      thermo_entity_id: climate.fancoil_living_hvac
      entities:
        - entity: weather.openweathermap
          color: [255,255,255]
        - entity: sensor.weather_forecast_hourly
          type: 0
          name: ""
          color: [255,255,255]
        - entity: sensor.weather_forecast_hourly
          type: 1
          name: ""
          color: [255,255,255]
        - entity: sensor.weather_forecast_hourly
          type: 2
          name: ""
          color: [255,255,255]
        - entity: sensor.weather_forecast_hourly
          type: 3
          name: ""
          color: [255,255,255]
        - entity: sensor.temperatura_living
          icon: mdi:home-thermometer-outline
          color: [255,255,255]
  1. In the screensaver section it can only be specified 1 entity for weather but as per docs here those can be specified and to enable the alternative layout the sixth entities needs to be specified.. can this option be added?

  2. Can locale be enabled for the traslation or does it require much work? The appdaemon version can use locale: "it_IT" but in esphome i only found the temp scale that can be customized.

  3. I've waited until recently to test because of the missing cardthermo but now that it's in confident to fully switch.. testing i just noticed that the buttons (off, cool, heat) area not centered in the card but are alligned to the left.. the rest seems working perfectly.

Thanks again for this!

olicooper commented 3 weeks ago
  1. Yeah I have not added support for this yet. It needs refactoring because this was the first thing I added when I started the project and a lot has changed since so I can't give you a timeline on support for this yet.
  2. I plan to support locales and I have started accounting for locales in the project but all the translations need to be stored on the device so I have to be careful with my approach. I am currently thinking about using the esphome python build script to dynamically generate a C++ translation array which includes only the selected language, but I'm not sure what that looks like yet.
  3. I didn't add this because or time constraints when originally implementing the thermo card. I can probably revisit this soon.
olicooper commented 3 weeks ago

@r0bb10 I've started working on translations (see the translations branch).

It would be great to know if it works for you? It probably needs a more work before merging it to dev. I imagine that there are a few missing translations - if you spot any missing ones just let me know.. I only have English and German configured so far, but you can create your own custom translation if you copy en.json, and update your config to point to the new language file (the path is relative to your esphome config file) e.g.

nspanel_lovelace::
  locale:
    language: custom.json

Once you've added your new language you can submit a PR on the translations branch or I can add for you if you send it me. A lot of the translations can be found here: https://github.com/joBr99/nspanel-lovelace-ui/tree/main/apps/nspanel-lovelace-ui/luibackend/translations