Code Monkey home page Code Monkey logo

lilygo-weather-esphome's Introduction

lilygo-weather-esphome

Weather display for a LilyGo T-Display-S3 using ESPHome

Tested on ESPHome 2023.2.4 and LilyGo T-Display-S3 (no touch)

Retrieves data from Home Assistant using the AccuWeather forecast (for daily) and Met.No forecast (for hourly). Press the KEY button to switch to the hourly view, it toggles back to daily after 15 seconds.

Installation:

  • Copy lilygo-weather-esphome.yaml to config/esphome
  • Create config/esphome/weather and put the contents of weather folder in there
  • Update Yaml to point it to your accuweather (daily) and met.no (hourly) weather forecast entities
  • update ESPHome device passwords with unique ones for your installation

lilygo-weather-esphome's People

Contributors

alexphredorg avatar

Stargazers

 avatar Simon avatar  avatar Pat avatar  avatar  avatar Tony Hopkins avatar  avatar  avatar  avatar  avatar spotlesscoder avatar Kenneth M Klausner avatar inaki avatar  avatar Rob Latour avatar  avatar Patricio Suarez avatar  avatar  avatar

Watchers

Terry avatar  avatar

lilygo-weather-esphome's Issues

Superfluous libraries in yaml config

Hi,

I just came across your repo, and saw that you have a

libraries:
    - SPI
    - FS
    - SPIFFS
    - OpenFontRender=https://github.com/Bodmer/OpenFontRender.git

block in your weather.yaml file.

With the latest versions of the t-display-s3 component, you shouldn't need those libraries (the ones really required are automatically included). This might speed up your compilation a bit.

(That is of course, assuming that you don't need the libraries explicitly for doing some fancy stuff).

Compile problem with ESPHOME as of January 2024

Am getting this error as of Janaury 16 2024 (yaml was not changed):

INFO Reading configuration /config/esphome/esphome-weather-display.yaml...
INFO Detected timezone 'America/Toronto'
Failed config

binary_sensor.gpio: [source <unicode string>:325]
  platform: gpio
  pin: 
    number: 14
    mode: 
      input: True
      output: False
      open_drain: False
      pullup: False
      pulldown: False
    inverted: False
    ignore_strapping_warning: False
    drive_strength: 20.0
  name: Key Button
  id: key_button
  internal: True
  filters: 
    - invert: {}
  on_press: 
    - then: 
        - display.page.show_next: 
            
            ID 'disp' of type tdisplays3::TDisplayS3 doesn't inherit from display::DisplayBuffer. Please double check your ID is pointing to the correct value.
            id: disp
        - component.update: 
            id: disp
  disabled_by_default: False```

Touch version

Hello. Any option to create a touch version? Thanks!

missing TFT_eSPI.h

Hi thanks for putting this together. I gave it a try but got the following error on install:

Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/src/main.cpp.o
In file included from src/main.cpp:60:
src/tft_espi_display.h:4:10: fatal error: TFT_eSPI.h: No such file or directory



#include <TFT_eSPI.h>
^~~~~~~~~~~~
compilation terminated.
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib8d6/tdisplays3/touchscreen/t_display_s3_touchscreen.cpp.o
In file included from /data/lilygo-weather-display/.piolibdeps/lilygo-weather-display/tdisplays3/touchscreen/t_display_s3_touchscreen.cpp:1:
/data/lilygo-weather-display/.piolibdeps/lilygo-weather-display/tdisplays3/touchscreen/t_display_s3_touchscreen.h:3:10: fatal error: esphome/components/i2c/i2c.h: No such file or directory
#include "esphome/components/i2c/i2c.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

ESPHOME update 2023.7 and beyond fail

When trying to do an update in HomeAssistant 2023.7.0 - ESPHome I was getting this error message which did not previously exist:

`Generating partitions /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/partitions.bin
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib505/AsyncTCP-esphome/AsyncTCP.cpp.o
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib6b4/SPI/SPI.cpp.o
Archiving /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib6b4/libSPI.a
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib01c/FS/FS.cpp.o
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib01c/FS/vfs_api.cpp.o
Archiving /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib505/libAsyncTCP-esphome.a
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/libc1a/SPIFFS/SPIFFS.cpp.o
/config/esphome/lilygo-weather-display.yaml: In lambda function:
/config/esphome/lilygo-weather-display.yaml:246:7: error: 'Image' was not declared in this scope
Image *image = NULL;
^ ~
/config/esphome/lilygo-weather-display.yaml:246:7: note: suggested alternative:
In file included from src/esphome.h:31,
from src/main.cpp:3:
src/esphome/components/image/image.h:34:7: note: 'esphome::image::Image'
class Image : public display::BaseImage {
^~~~~
/config/esphome/lilygo-weather-display.yaml:246:20: error: expected primary-expression before '=' token
Image *image = NULL;
^
/config/esphome/lilygo-weather-display.yaml:250:45: error: expected primary-expression before '=' token
if (condition == "clear-night") image = id(icon_clear_night);
^
/config/esphome/lilygo-weather-display.yaml:251:45: error: expected primary-expression before '=' token
else if (condition == "cloudy") image = id(icon_cloudy);
^
/config/esphome/lilygo-weather-display.yaml:252:51: error: expected primary-expression before '=' token
else if (condition == "partlycloudy") image = id(icon_partlycloudy);
^
/config/esphome/lilygo-weather-display.yaml:253:42: error: expected primary-expression before '=' token
else if (condition == "fog") image = id(icon_fog);
^
/config/esphome/lilygo-weather-display.yaml:254:43: error: expected primary-expression before '=' token
else if (condition == "hail") image = id(icon_rainy);
^
/config/esphome/lilygo-weather-display.yaml:255:48: error: expected primary-expression before '=' token
else if (condition == "lightning") image = id(icon_lightning);
^
/config/esphome/lilygo-weather-display.yaml:256:54: error: expected primary-expression before '=' token
else if (condition == "lightning-rainy") image = id(icon_lightning);
^
/config/esphome/lilygo-weather-display.yaml:257:46: error: expected primary-expression before '=' token
else if (condition == "pouring") image = id(icon_pouring);
^
/config/esphome/lilygo-weather-display.yaml:258:44: error: expected primary-expression before '=' token
else if (condition == "rainy") image = id(icon_rainy);
^
/config/esphome/lilygo-weather-display.yaml:259:44: error: expected primary-expression before '=' token
else if (condition == "snowy") image = id(icon_snowy);
^
/config/esphome/lilygo-weather-display.yaml:260:50: error: expected primary-expression before '=' token
else if (condition == "snowy-rainy") image = id(icon_snowy_rainy);
^
/config/esphome/lilygo-weather-display.yaml:261:44: error: expected primary-expression before '=' token
else if (condition == "sunny") image = id(icon_sunny);
^
/config/esphome/lilygo-weather-display.yaml:262:44: error: expected primary-expression before '=' token
else if (condition == "windy") image = id(icon_windy);
^
/config/esphome/lilygo-weather-display.yaml:263:17: error: expected primary-expression before '!=' token
if (image != NULL)
^~
/config/esphome/lilygo-weather-display.yaml:265:30: error: expected primary-expression before ')' token
it.image(0, 38, image);
^
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib933/OpenFontRender/FileSupport.cpp.o
Archiving /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib01c/libFS.a
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib933/OpenFontRender/OpenFontRender.cpp.o
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib933/OpenFontRender/base/basepic.c.o
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib933/OpenFontRender/base/ftadvanc.c.o
Archiving /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/libc1a/libSPIFFS.a
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib933/OpenFontRender/base/ftapi.c.o
Compiling /data/lilygo-weather-display/.pioenvs/lilygo-weather-display/lib933/OpenFontRender/base/ftbase.c.o
*** [/data/lilygo-weather-display/.pioenvs/lilygo-weather-display/src/main.cpp.o] Error 1
========================= [FAILED] Took 108.47 seconds =========================
=== [ERROR] /config/esphome/lilygo-weather-display.yaml ===

`

(of note, I had previously made some changes in the YAML for my own purposes; using my own backyard weather station as the basis for the display of the current temperature - so line 246 is actually line 236 in the original YAML). These changes had no bearing on this issue.

Regardless, the fix for the issue described above is as follows:

line 236 in the original YAML which reads:

      Image *image = NULL;

needs to be changed to:

     image::Image *image = NULL;

Once done, it compiles and updates ok.

Hope this helps, and thanks again for this project!

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.