5 Commits

Author SHA1 Message Date
TJ Horner
7b82f71386 Debug firmware 2022-09-30 19:45:45 -07:00
TJ Horner
66c7e07592 Fix #10 2022-09-19 11:56:21 -07:00
TJ Horner
849b4d8896 readme update 2022-08-30 09:01:01 -07:00
TJ Horner
347db97405 update readme 2022-08-29 12:03:33 -07:00
TJ Horner
b9e4a9cb33 Runtime configuration variables for firmware 2022-08-28 19:06:59 -07:00
7 changed files with 161 additions and 94 deletions

View File

@@ -7,11 +7,6 @@ jobs:
build:
name: Build Firmware
runs-on: ubuntu-latest
strategy:
matrix:
desk_brand:
- uplift_v2
- fully_jarvis
steps:
- uses: actions/checkout@v2
@@ -22,13 +17,22 @@ jobs:
- name: Install ESPHome
run: pip install --user esphome
- name: Compile Firmware
- name: Compile Release Firmware
working-directory: firmware
run: |
esphome compile ${{ matrix.desk_brand }}.yaml
esphome compile config.yaml
mkdir -p bin
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware-factory.bin bin/firmware-factory-${{ matrix.desk_brand }}.bin
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.bin bin/firmware-${{ matrix.desk_brand }}.bin
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware-factory.bin bin/firmware-factory.bin
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.bin bin/firmware.bin
- name: Compile Debug Firmware
working-directory: firmware
run: |
rm -rf .esphome/build/upsy-desky
esphome compile debug.yaml
mkdir -p bin
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware-factory.bin bin/debug-firmware-factory.bin
cp .esphome/build/upsy-desky/.pioenvs/upsy-desky/firmware.bin bin/debug-firmware.bin
- name: Upload Firmware
uses: skx/github-action-publish-binaries@release-1.3

View File

@@ -2,11 +2,9 @@
This repository contains the source files for the Upsy Desky, a device which lets you connect your standing desk to any home automation system.
I will be selling them on Tindie, but if you're seeing this, it isn't available for purchase yet. You can sign up [here](https://forms.gle/285GffmpfHamryEu6) to get notified as soon as it is available. I anticipate starting sales sometime during the week of August 29th.
You can buy one on Tindie:
<!-- You can buy one on Tindie:
<a href="https://www.tindie.com/products/tjhorner/upsy-desky/?ref=offsite_badges&utm_source=sellers_tjhorner&utm_medium=badges&utm_campaign=badge_large"><img src="https://d2ss6ovg47m0r5.cloudfront.net/badges/tindie-larges.png" alt="I sell on Tindie" width="200" height="104"></a> -->
<a href="https://www.tindie.com/products/tjhorner/upsy-desky/?ref=offsite_badges&utm_source=sellers_tjhorner&utm_medium=badges&utm_campaign=badge_large"><img src="https://d2ss6ovg47m0r5.cloudfront.net/badges/tindie-larges.png" alt="I sell on Tindie" width="200" height="104"></a>
## Repository Structure
@@ -23,6 +21,7 @@ With these you can make your own Upsy Desky from scratch, or you can make change
This is the successor to the [WiFi Standing Desk Controller](https://github.com/tjhorner/wifi-desk-controller), packed with improvements and bug fixes — most notably:
- USB-C port for easy flashing (and because USB-C is cool 😎)
- Runtime firmware configuration -- no more manual flashing or compiling ESPHome to change stuff
- Improved enclosure design with a more snug fit and screw-mounted PCB, allowing for easier repairs and troubleshooting
- Replacing the D1 Mini with an ESP32-WROOM module, providing hardware UART for more reliable desk connection
- A catchier name, because "WiFi Standing Desk Controller" was a mouthful

View File

@@ -1,43 +0,0 @@
substitutions:
name: "upsy-desky"
esphome:
name: "${name}"
name_add_mac_suffix: true
project:
name: tj_horner.upsy_desky
version: "0.0.3"
esp32:
board: esp32dev
logger:
level: INFO
wifi:
ap:
password: "hunter2hunter2"
captive_portal:
improv_serial:
api:
password: ""
reboot_timeout: 0s
web_server:
port: 80
ota:
password: ""
packages:
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml
presets_addon: github://tjhorner/esphome-standing-desk/configs/addons/presets.yaml
light:
- platform: status_led
id: status
pin: GPIO23
restore_mode: ALWAYS_ON

132
firmware/config.yaml Normal file
View File

@@ -0,0 +1,132 @@
substitutions:
name: "upsy-desky"
friendly_name: "Upsy Desky"
# Defaults
standing_desk_uart_rx_pin: "17"
standing_desk_up_pin: "21"
standing_desk_down_pin: "22"
standing_desk_variant: "uplift"
standing_desk_min_height: "25.2"
standing_desk_max_height: "50.8"
# Presets
button_bit1_pin: "21"
button_bit2_pin: "22"
button_bit4_pin: "19"
button_m_pin: "18"
esphome:
name: "${name}"
name_add_mac_suffix: true
on_boot:
then:
# Wakes up the desk and reports height
- uart.write:
id: handset_tx
data: [ 0x0 ]
project:
name: tj_horner.upsy_desky
version: "0.1.0"
dashboard_import:
package_import_url: github://tjhorner/upsy-desky/firmware/config.yaml
uart:
id: handset_tx
tx_pin: 16
baud_rate: 9600
esp32:
board: esp32dev
logger:
level: INFO
wifi:
ap:
password: "hunter2hunter2"
captive_portal:
improv_serial:
api:
password: ""
reboot_timeout: 0s
web_server:
port: 80
ota:
password: ""
packages:
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml
presets_addon: github://tjhorner/esphome-standing-desk/configs/addons/presets.yaml
select:
- platform: template
name: "${friendly_name} Height Decoder Variant"
entity_category: "config"
optimistic: true
restore_value: true
options:
- uplift
- jarvis
initial_option: ${standing_desk_variant}
on_value:
then:
lambda: "id(desk_height)->set_decoder_variant(x);"
- platform: template
name: "${friendly_name} Height Units"
entity_category: "config"
optimistic: true
restore_value: true
options:
- in
- cm
initial_option: in
on_value:
then:
lambda: |
id(desk_height)->set_unit_of_measurement(x);
id(target_desk_height)->traits.set_unit_of_measurement(x);
number:
- platform: template
name: "${friendly_name} Min Target Height"
entity_category: "config"
min_value: 0
max_value: 150
step: 0.1
optimistic: true
restore_value: true
initial_value: ${standing_desk_min_height}
on_value:
then:
lambda: |
id(target_desk_height)->traits.set_min_value(x);
- platform: template
name: "${friendly_name} Max Target Height"
entity_category: "config"
min_value: 0
max_value: 150
step: 0.1
optimistic: true
restore_value: true
initial_value: ${standing_desk_max_height}
on_value:
then:
lambda: |
id(target_desk_height)->traits.set_max_value(x);
switch:
- platform: restart
name: "${friendly_name} Restart"
light:
- platform: status_led
id: upsy_desky_status_led
pin: GPIO23
restore_mode: ALWAYS_ON

13
firmware/debug.yaml Normal file
View File

@@ -0,0 +1,13 @@
packages:
base: !include config.yaml
logger:
level: DEBUG
debug:
update_interval: 5s
text_sensor:
- platform: debug
device:
name: "${friendly_name} Device Info"

View File

@@ -1,19 +0,0 @@
packages:
base_config: !include _base.yaml
dashboard_import:
package_import_url: github://tjhorner/upsy-desky/firmware/fully_jarvis.yaml
substitutions:
standing_desk_uart_rx_pin: "17"
standing_desk_up_pin: "21"
standing_desk_down_pin: "22"
standing_desk_variant: "jarvis"
standing_desk_min_height: "24.5"
standing_desk_max_height: "50.0"
# Presets
button_bit1_pin: "21"
button_bit2_pin: "22"
button_bit4_pin: "19"
button_m_pin: "18"

View File

@@ -1,19 +0,0 @@
packages:
base_config: !include _base.yaml
dashboard_import:
package_import_url: github://tjhorner/upsy-desky/firmware/uplift_v2.yaml
substitutions:
standing_desk_uart_rx_pin: "17"
standing_desk_up_pin: "21"
standing_desk_down_pin: "22"
standing_desk_variant: "uplift"
standing_desk_min_height: "25.2"
standing_desk_max_height: "50.8"
# Presets
button_bit1_pin: "21"
button_bit2_pin: "22"
button_bit4_pin: "19"
button_m_pin: "18"