Last active
April 26, 2024 08:47
-
-
Save Nizzle/6971c2cc066e6412740487bcc3b2c62a to your computer and use it in GitHub Desktop.
ESPhome config for SHA2017 badge (https://wiki.sha2017.org/w/Projects:Badge)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: shabadge | |
esp32: | |
board: esp32-pro | |
logger: | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_pass | |
ota: | |
password: !secret ota_pass | |
api: | |
id: hassapi | |
password: !secret api_pass | |
i2c: | |
sda: 26 | |
scl: 27 | |
scan: True | |
mpr121: | |
id: mpr121_component | |
address: 0x5A | |
touch_debounce: 1 | |
release_debounce: 1 | |
touch_threshold: 12 | |
release_threshold: 6 | |
binary_sensor: | |
- platform: mpr121 | |
id: touch_buttonA | |
channel: 0 | |
name: "Touch Button A" | |
- platform: mpr121 | |
id: touch_buttonB | |
channel: 1 | |
name: "Touch Button B" | |
- platform: mpr121 | |
id: touch_buttonStart | |
channel: 2 | |
name: "Touch Button Start" | |
- platform: mpr121 | |
id: touch_buttonSelect | |
channel: 3 | |
name: "Touch Button Select" | |
- platform: mpr121 | |
id: touch_buttonDown | |
channel: 4 | |
name: "Touch Button Down" | |
- platform: mpr121 | |
id: touch_buttonRight | |
channel: 5 | |
name: "Touch Button Right" | |
- platform: mpr121 | |
id: touch_buttonUp | |
channel: 6 | |
name: "Touch Button Up" | |
- platform: mpr121 | |
id: touch_buttonLeft | |
channel: 7 | |
name: "Touch Button Left" | |
- platform: mpr121 | |
id: charging_status | |
channel: 9 | |
name: "Charging Status" | |
- platform: gpio | |
name: "Flash Button" | |
pin: 0 | |
filters: | |
- invert: | |
sensor: | |
- platform: adc | |
pin: 34 | |
attenuation: 6db | |
filters: | |
- multiply: 2.91 | |
name: "USB Voltage" | |
update_interval: 20s | |
accuracy_decimals: 1 | |
- platform: adc | |
pin: 35 | |
attenuation: 6db | |
#attenuation: 2.5db | |
filters: | |
- multiply: 2.91 | |
#- multiply: 1.95 | |
name: "Battery Voltage" | |
update_interval: 20s | |
accuracy_decimals: 1 | |
- platform: uptime | |
name: Uptime Sensor | |
id: uptime_sensor | |
update_interval: 1s | |
on_raw_value: | |
then: | |
- text_sensor.template.publish: | |
id: uptime_human | |
state: !lambda |- | |
int seconds = round(id(uptime_sensor).raw_state); | |
int days = seconds / (24 * 3600); | |
seconds = seconds % (24 * 3600); | |
int hours = seconds / 3600; | |
seconds = seconds % 3600; | |
int minutes = seconds / 60; | |
seconds = seconds % 60; | |
return ( | |
(days ? to_string(days) + "d " : "") + | |
(hours ? to_string(hours) + "h " : "") + | |
(minutes ? to_string(minutes) + "m " : "") + | |
(to_string(seconds) + "s") | |
).c_str(); | |
spi: | |
clk_pin: 18 | |
mosi_pin: 5 | |
text_sensor: | |
- platform: version | |
id: ver | |
hide_timestamp: true | |
- platform: template | |
name: Uptime Human Readable | |
id: uptime_human | |
icon: mdi:clock-start | |
display: | |
- platform: waveshare_epaper | |
cs_pin: 19 | |
dc_pin: 21 | |
busy_pin: 22 | |
reset_pin: 23 | |
model: 2.90in-dke | |
#Partial not working yet so full only | |
full_update_every: 1 | |
update_interval: 5s | |
lambda: |- | |
it.printf(0, 0, id(font40), "%s", id(ver).state.c_str()); | |
it.printf(0, 40, id(font40), "%s", id(uptime_human).state.c_str()); | |
rotation: 270 | |
external_components: | |
- source: | |
type: git | |
url: https://github.com/Nizzle/esphome | |
ref: dke2.9-epaper | |
components: [ waveshare_epaper ] | |
font: | |
- file: "Fonts/Comfortaa-Regular.ttf" | |
id: font40 | |
size: 40 |
Hi,
My last builds were a while ago.
I can't test against current versions at the moment, but @polyfloyd is working to mainline the code, see esphome/esphome#6492<https://github.com/esphome/esphome/pull/6492>
Maybe this is of interest to you.
…________________________________
From: morris2009 ***@***.***>
Sent: 19 April 2024 16:11
To: morris2009 ***@***.***>
Cc: Author ***@***.***>
Subject: Re: Nizzle/shabadge.yaml
@morris2009 commented on this gist.
________________________________
Very nice to see someone create a use for this badge. I just found mine in old shoebox and wanted to try the above, but can't get the newer versions of ESPhome to build it with the config above.
Did you manage to have the latest ESPhome version running on it?
—
Reply to this email directly, view it on GitHub<https://gist.github.com/Nizzle/6971c2cc066e6412740487bcc3b2c62a#gistcomment-5029983> or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABJCU6TIM5LDPCOSUEYLGC3Y6E6ZLBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTANJYGE3DMNRQU52HE2LHM5SXFJTDOJSWC5DF>.
You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
Hi, I'm still waiting for someone from the esphome project to review the code. But in the meantime you could use the rebased patch in my fork
Oki, support for the SHA badge display is now upstream
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very nice to see someone create a use for this badge. I just found mine in old shoebox and wanted to try the above, but can't get the newer versions of ESPhome to build it with the config above.
Did you manage to have the latest ESPhome version running on it?