Skip to content

[WIP] ESPHome firmware - #57

Draft
DSpeichert wants to merge 2 commits into
smeisner:mainfrom
DSpeichert:esphome
Draft

[WIP] ESPHome firmware#57
DSpeichert wants to merge 2 commits into
smeisner:mainfrom
DSpeichert:esphome

Conversation

@DSpeichert

Copy link
Copy Markdown
Contributor

The PCB can happily be operated via ESPHome firmware, which is native to Home Assistant (official ESPHome plugin is needed instead of MQTT server/bridge) thanks to its wide array of supported modules - in fact all of the ones used by this project.

This YAML currently includes support for:

  • Relays - to control HVAC mapped as outputs
  • Thermostat controller - the logic is executed locally, i.e. does not need Home Assistant to be online to operate, fully depends on AHT20 sensor for temperature
  • OTA updates of firmware (HA/ESPHome native)
  • Time sync - SNTP
  • Piezzo buzzer - not used
  • LD2410 motion/presence sensor via UART - currently not tweaked/tuned great but is used to light up the screen (like in original firmware)
  • AHT20 via i2c - temperature and humidity - calibration is key and offsets can be significant, I've made them configurable in the HA UI via settings
  • ADC light sensor - very crude but works for adjusting brightness (motion is for on/off, ADC is for brightness)
  • Touchscreen - displays info, touch currently only wakes up screen but is calibrated and operational
  • Serial improv - requires USB connection
  • Logging onto secondary UART or ESPHome log (can't do both)

What I tried that didn't work:

  • BLE-based improv protocol - takes too much RAM to operate BLE stack together with touchscreen

TODO before merging:

  • Making the package work (or abandon the idea and simplify the YAML)
  • Touchscreen buttons/menu
  • Stability issues (sometimes loses connectivity to HA -> is it memory/firmware or just my HA?)
  • Actions pipeline should build firmware without keys or WiFi password -> ready to be initialized via serial improv

@smeisner

smeisner commented Oct 3, 2024

Copy link
Copy Markdown
Owner

@DSpeichert Please encapsulate any code changes in the firmware with "#ifdef ESPHOME" as is already done with MATTER and MQTT.

@DSpeichert

Copy link
Copy Markdown
Contributor Author

@DSpeichert Please encapsulate any code changes in the firmware with "#ifdef ESPHOME" as is already done with MATTER and MQTT.

There will be no changes to the firmware in app/ in this project. The ESPHome firmware is effectively generated with just the YAML I provided here by the esphome tool/project. Therefore, those two are completely independent in this repository.

@smeisner

smeisner commented Oct 3, 2024

Copy link
Copy Markdown
Owner

Yeah, makes sense ... I should've gave it some thought first!! :P

- "\uE6C3" # on_hub_device

display:
- id: display1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to include:
invert_colors: false

Comment thread esphome/README.md
4. Clean configuration if you're having issues rebuilding (`esphome clean ...`)


You can achieve the above with the following snippet:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this in a clean directory (ie, not a git cloned area) and it failed as the ../app/default_16mb.csv file was missing. After supplying that (and making the to the device yaml file mentioned below), it worked and reprogrammed the device.

@smeisner

Copy link
Copy Markdown
Owner

So far, I can verify the display works (but not necessarily the touch screen) and the motion sensor. I do not see any way to exercise the other areas that are believed to be supported though (like the touch screen, status LED, light sensor, the piezo or the relays).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants