Arduino code to use a ESP32 to control an Astra GTE Dashboard display.
-
Disconnect the blue connector from the main control board to the display board
-
Connect Dupont wires from pins 3,4,5,6,7 to ESP32 as per "Wiring" instructions
3 VCC <> Direct from USB 5v feed
4 GND <> Direct from Ground
5 CLK <> SCK 18
6 MOSI/DATA <> MOSI 23
- Clone the repo:
git clone https://github.com/JohnMcLear/AstraDash.git && cd AstraDash
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
bin/arduino-cli config init
bin/arduino-cli core update-index --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
bin/arduino-cli core update-index && bin/arduino-cli board listall && bin/arduino-cli core install esp32:esp32
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"
bin/arduino-cli compile --fqbn esp32:esp32:nodemcu-32s AstraDashHomeAssistant
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...
./test.sh
./testDisplay.sh
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
- 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.
- Second Digit on speedo
- 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