JohnMcLear / AstraDash

Arduino code to directly bitbang an Astra GTE Dashboard display.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ESP32 Astra GTE Dash

Arduino code to use a ESP32 to control an Astra GTE Dashboard display.

Initial wiring

  1. Disconnect the blue connector from the main control board to the display board Disconnecting the blue connector on the Astra GTE Dials

  2. Connect Dupont wires from pins 3,4,5,6,7 to ESP32 as per "Wiring" instructions Connecting the ESP32 to the Astra GTE Dials (Astra Dials View)

Connecting the ESP32 to the Astra GTE Dials (ESP view)

Wiring: GTE Dials pin to Arduino

3 VCC <> Direct from USB 5v feed

4 GND <> Direct from Ground

5 CLK <> SCK 18

6 MOSI/DATA <> MOSI 23

Installation

  1. Clone the repo: git clone https://github.com/JohnMcLear/AstraDash.git && cd AstraDash
  2. curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
  3. bin/arduino-cli config init
  4. bin/arduino-cli core update-index --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
  5. bin/arduino-cli core update-index && bin/arduino-cli board listall && bin/arduino-cli core install esp32:esp32

Configure WiFi and MQQT

Create AstraDashHomeAssistant/arduino_secrets.h and paste the below in editing the values accordingly:

#define SECRET_SSID "YourSSIDHere"
#define SECRET_PASS "YourPassHere"
#define SECRET_BROKER "YourMQQTBrokerHostnameHere"
#define SECRET_BROKERUSER "YourMQQTBrokerUsernameHere"
#define SECRET_BROKERPASS "YourMQQTBrokerPasswordHere"

Compile

bin/arduino-cli compile --fqbn esp32:esp32:nodemcu-32s AstraDashHomeAssistant

Run

Note: Change ttyUSB1 to whatever port you are targeting. sudo dmesg | grep tty to discover port.

bin/arduino-cli upload -p /dev/ttyUSB1 --fqbn esp32:esp32:nodemcu-32s AstraDashHomeAssistant

Or for those who will make lots of changes...

Compile and Run (assumes /dev/ttyUSB0)

./test.sh

Testing the Display

./testDisplay.sh

Configuring Home Assistant

Create the automation with the following Yaml

alias: Every second Publish to Astra GTE Dials
description: ""
trigger:
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - service: mqtt.publish
    data:
      qos: 0
      retain: false
      topic: AstraGTEDials
      payload: >-
        { oilTemp:"{{ states('sensor.outdoor_temperature') }}",
        battery:"{{states('sensor.solarbattery') }}",
        coolantTemp:"{{state_attr('climate.house', 'current_temperature') }}",
        fuelLevel:"{{states('sensor.leaf1ljpi_charge')}}",
        rpm:"{{states('sensor.solargeneration')}}",
        speedo:"{{states('input_number.active_todoist_jobs_today')}}" }
mode: single

Notes

  1. The following are NOT supported: Hazards, Lights, Indicators, Choke, Parking Brake .. Basically anything on the bottom row. These could however be supported with additional relay control board.

TODO

  • Second Digit on speedo

Output Designation

  • Oil Temp > Outdoor Temp Degrees C (-5 > 40)
  • Oil Temp Warning > Outdoor Temp < 0
  • Battery Level > Home Storage Battery level %
  • Battery Level Warning > Battery Level < 10%
  • Coolant Temp > Indoor temp C (-5 > 40)
  • Coolant Temp Warning > Indoor Temp < 15 degs
  • Fuel Level > Electric car charge %
  • Fuel Level warning > Electric car charge < 20%
  • Speedo > How many tasks I have to do today (see input_number.active_todoist_jobs_today)
  • RPM > Solar generation 0 > 7000

About

Arduino code to directly bitbang an Astra GTE Dashboard display.


Languages

Language:C++ 99.0%Language:C 0.8%Language:Shell 0.2%