sibbl / hass-lovelace-kindle-4

How to build your own Kindle 4 photo frame displaying your Home Assistant Lovelace panel
MIT License
318 stars 6 forks source link

Template for Lovelace #1

Closed Pattern91 closed 3 years ago

Pattern91 commented 3 years ago

Hey there,

I really enjoy your work! I set everything up and almost running. I have 2 problems. I really like your design of the Lovelace Dashboard, how did you manage it to be in a single column mode? I always have to columns...

The second problem is, the kindle is updating the image and the log looks fine, but the image is not displayed. I just get a blank screen. The URL is available in my network. Here is a part of the log:

Tue Jan 5 18:32:23 UTC 2021: Set CPU scaling governer to powersave Tue Jan 5 18:32:23 UTC 2021: Set prevent screen saver to true Tue Jan 5 18:32:23 UTC 2021: Remaining battery 98 Tue Jan 5 18:32:23 UTC 2021: Enabling and checking wifi Tue Jan 5 18:32:24 UTC 2021: Connected to wifi Tue Jan 5 18:32:24 UTC 2021: Found default gateway 192.168.178.1 Tue Jan 5 18:32:29 UTC 2021: Screen saver image file updated Tue Jan 5 18:32:29 UTC 2021: Removed temporary files Tue Jan 5 18:34:29 UTC 2021: SUCCESS, will update again on 1609871609

Edit: I could solve the second problem by reducing the greyscale from 16 to 8 although the kindle should be able to display this kind of image.

sibbl commented 3 years ago

@Pattern91 thanks for your feedback.

To get the single column, enable the panel mode for the Lovelace view (see docs).

After doing so, you can set one single card to be spread across the whole width. If you use a vertical-stack, you can then put multiple cards into one single column.

A sample lovelace config might looks like this, note the panel: true in line 3:

  - title: Screensaver
    path: screensaver
    panel: true
    theme: eink
    icon: 'mdi:image-album'
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: entity
            entity: sensor.time
            name: Time
          - entities:
              - entity: sensor.netatmo_outdoor_temperature
                index: 0
                show_state: true
                color: var(--text-primary-color)
              - color: var(--secondary-text-color)
                entity: sensor.solar_elevation
                line_width: 1
                show_fill: false
                show_legend: false
                show_state: false
                y_axis: secondary
            hour24: true
            hours_to_show: 24
            line_width: 2
            lower_bound_secondary: 0
            name: Outdoor temperature
            points_per_hour: 1
            show:
              extrema: false
              graph: line
              points: false
              labels: false
              labels_secondary: false
            type: 'custom:mini-graph-card'
          - type: weather-forecast
            entity: weather.openweathermap

Regarding grayscale I also don't know the exact details. Although 16 bit grayscale colors should be supported, the internal tool to draw the images seems to only support 8 bit. I've just added the parameter in hope that it might be helpful for newer Kindle devices.