topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday October 3, 2024, 11:38 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: NANY 2021: Zever2TFT - Display solar production on TFT or eInk display (IoT)  (Read 4398 times)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,626
    • View Profile
    • Donate to Member
NANY 2021 Entry Information

Application Name Zever2TFT
Version 0.9
Short Description Display Zevercloud solar day-production on a TFT or eInk display
Supported OSes Script: Any OS Supporting Python 3.x, ESPEasy (TFT/eInk/IoT)
Web Page This page (for now)
Download Link (Soon to be) Attached
System Requirements
  • OS Supporting Python 3.x (Windows, Linux/Raspberry Pi, Mac, ...)
  • Additional Python modules: pytz, requests
  • ESP8266 or ESP32 IoT controller unit (Wemos D1, NodeMCU, ESP32 DevkitC, etc.)
  • TFT Display: ILI9341 based tft display (SPI connected)
  • eInk display: IL3897 based e-paper display (SPI connected)
  • Some wires and light soldering skills to connect stuff together
  • (Hardware can be obtained from your local supplier, eBay, Aliexpress, Banggood, etc.)
  • ESPEasy software from https://github.com/letscontrolit/ESPEasy
  • A PC (Windows/Linux/Mac) with USB port to flash the firmware onto the ESP controller (I'm using Windows)
Version History
  • v0.9.0: Dec. 2020: Rework to use changed Zevercloud API :(
  • v0.1.0: Aug. 2020: Initial version
Author Link to Author's Profile page


Description
Having installed a solar systems a few years back, using a ZeverSolar inverter and connected to Zevercloud for easy overview of generated power, and an interest in IoT, I found ESPEasy, and the rather affordable ESP controllers, I thought it would be nice to combine these.
The availability of very affordable TFT display (I bought a 4.3", 65k colors unit), and the requirement for the Zevercloud web interface to re-login every 30 minutes or so to be able to view the current production graph, I searched for, and found, an API to retrieve the graph data in json format.
Now to turn that data into a nice graph... enter: Python :tellme:
I've only sniffed a little at python a few years back, but never actually done anything serious with that, so I took this as an challenge opportunity to learn a few things:
- Python programming
- Turning a bunch of data into a graph
Hence this script was crafted :)

NB: Some assembly required! And command-line skills required! (that should fit with the average audience here 8) :P)

Features
Fetch data from the Zevercloud API
Present that on a TFT (or ePaper) display, connected to an ESP controller
Scale the graph, based on the max available value, so the display is nicely filled

Planned Features
Fix the login issue with the revamped API (No thanks, Zevercloud >:()
Support other Solar power aggregation platforms
Any interesting features I, or other potential users, might think of
A, probably 3D printed, housing for the device

Screenshots

IMG_20200913_184040.jpgNANY 2021: Zever2TFT - Display solar production on TFT or eInk display (IoT)
Result of a nice day of solar production

Usage
Installation: Hardware
See next post

Installation: Script
  • Install Python 3
  • Install required python modules: pip install pytz requests
  • Unpack the script and run it once, this will fail, but create an initial settings file: zever2tft.json
  • Retrieve the API key, APP Key and APP Secret values (more details are in the script documentation)
  • Add the values to the settings file, and set up other, display related, settings like size etc. (more details in the script documentation)
  • Run the script, and it should draw the graph of today, or provide a yyyy-mm-dd date as first argument for displaying the graph for that day
  • When all settings are filled, a second run of the script will only update the extra data, not yet sent to the display, unless the scale has to be adjusted

Using the Application
Run the script on a regular basis, f.e. using a scheduler, like cron on Linux (Raspberry Pi?) or Task Scheduler on Windows.

Uninstallation
Stop the scheduler if set
Remove the script
Option ally remove the Python install if no longer needed

Tips
Set the scheduler to run every 5 minutes for a regular update
Setup a display timeout and add a button to wake the display, to extend the display's life expectation
As ESPEasy now also supports the XPT2046 touchscreen, mounted on the TFT unit, this can be configured to wake the display on touch (example to be added here)
Best to get an ESP controller unit that supports micro-usb for power supply and has 4 MB of flash memory, so a) it's easy to connect, and b) ESPEasy can be updated OTA (over the air) from it's web interface

Known Issues
Unfortunately, because of the recently changed API url and lacking any documentation, the login for the new API is not fully tested yet, as the new APP key and APP Secret are yet undefined how to fill (to be resolved asap)

Download will be attached ASAP!
« Last Edit: December 31, 2020, 09:38 AM by Ath »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,626
    • View Profile
    • Donate to Member
Installation: Hardware
  • Obtain the ESP controller
  • Connect it to the computer, you may need drivers for the USB to Serial bridge installed on the ESP...
  • Download ESPEasy software from https://github.com/l...lit/ESPEasy/releases (pick the desired download from the Assets expander, ESP32 or ESP82xx)
  • Unpack the zip file to an empty folder
  • When on Windows:
  • Run ESP.Easy.Flasher (yes, it requires admin privileges because of using the COM port directly)
  • Select a bin with 'display' in the name (available since 20201227 release) and matching with the flash size (4M1M for ESP8266 or 4M316k for ESP32) For ESP32 pick the one with 'factory' in the name for initial upload, for later OTA updates use the one without 'factory'
  • Flash to the device (ESP8266 will be set to flash-mode by the flasher, ESP32 must be set to flash-mode by holding the BOOT button, short press EN, then release BOOT)
  • After flashing is complete: Connect to the ESPEasy accesspoint it provides, log in using password configesp it/when asked, and connect it to the desired Wifi accesspoint. Then the unit will reboot. It should display the obtained ip-address after connection, where you can point your browser at
  • There are a lot of settings to be made, give it an appropriate name and unit number (Config tab), to have the current time by enabling NTP (Tools/Advanced, no time server needs to be set) it will fetch from the standard pool, based on the geo-location and DST set.
  • Connect the display to the ESP, and optionally also the touchscreen when available
    DisplayESP8266/ESP32
    VCC3V3
    GNDGND
    CSD0 (gpio-16)
    ResetD4 (gpio-2)
    DCD8 (gpio-15)
    SDI/MOSID7 (gpio-13)
    SCKD5 (gpio-14)
    SDO/MISOD6 (gpio-12)
    Special:.
    LEDVCC or D2 (gpio-4)
    Touchscreen:.
    T_CLKD5 (gpio-14)
    T_CSD3 (gpio-0)
    T_DIND7 (gpio-13)
    T_DOD6 (gpio-12)
    T_IRQn/c
  • Add on the Devices tab a Display - TFT 2.4 inches ILI9341... or Display - eInk with Lolin ePaper screen...
    Screenshot - 31_12_2020 , 15_32_29.pngNANY 2021: Zever2TFT - Display solar production on TFT or eInk display (IoT)
    (I do not own an eInk display, so no example)
  • Enable the display and set up according to hardware connections
  • Optional: Add on the Devices tab a Touch - XPT2046 on a TFT Display... (Documentation for setting up can be found here)
  • Optional: Add on the Devices tab a Generic - Dummy Device and set up like this:
    Screenshot - 31_12_2020 , 17_12_53.pngNANY 2021: Zever2TFT - Display solar production on TFT or eInk display (IoT)
  • When the Dummy Device is setup, these names should be set in the zever2tft.json file: "espeasy_task": "Variables" and "espeasy_var": "LastTime", the script will save here the date of the data that is displayed
« Last Edit: December 31, 2020, 11:25 AM by Ath »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,626
    • View Profile
    • Donate to Member
(Reserved 2)

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,963
    • View Profile
    • Donate to Member
Looks great Ath :up:
Tom