mirror of
https://github.com/tjhorner/upsy-desky.git
synced 2026-01-11 08:18:02 -05:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f3b5acf58 | ||
|
|
b238eb40c3 | ||
|
|
eb54c2c405 | ||
|
|
c09fa97c77 | ||
|
|
273dd62d9a |
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Compile Release Firmware
|
||||
working-directory: firmware
|
||||
run: |
|
||||
esphome compile config.yaml
|
||||
esphome compile stock.yaml
|
||||
mkdir -p 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
|
||||
|
||||
16
firmware/README.md
Normal file
16
firmware/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Firmware Configs
|
||||
|
||||
This directory contains [ESPHome](https://esphome.io) config files for the Upsy Desky.
|
||||
|
||||
It is organized like so:
|
||||
|
||||
- `base.yaml`: The base essential configuration, which contains components for reading the desk height, preset buttons, etc.
|
||||
- `stock.yaml`: Inherits everything from `base.yaml` and adds components which are useful on stock firmware, such as the WiFi hotspot, web server, and Improv Serial
|
||||
- `debug.yaml`: Inherits everything from `stock.yaml` and adds components which are useful for debugging
|
||||
|
||||
## Addons
|
||||
|
||||
Major parts of the config are separated into "addons" so they can be easily included or excluded. The following addons are available:
|
||||
|
||||
- `presets.yaml`: Adds support for recalling and setting presets on the desk control box
|
||||
- `runtime-config.yaml`: Adds support for runtime configuration options (you might want to remove this if you are configuring everything via ESPHome yaml)
|
||||
@@ -23,7 +23,7 @@ button:
|
||||
# Recall Presets
|
||||
- platform: template
|
||||
id: recall_preset_1
|
||||
name: "${friendly_name} Preset 1"
|
||||
name: "Preset 1"
|
||||
icon: "mdi:numeric-1-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit1
|
||||
@@ -34,7 +34,7 @@ button:
|
||||
|
||||
- platform: template
|
||||
id: recall_preset_2
|
||||
name: "${friendly_name} Preset 2"
|
||||
name: "Preset 2"
|
||||
icon: "mdi:numeric-2-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit4
|
||||
@@ -43,7 +43,7 @@ button:
|
||||
|
||||
- platform: template
|
||||
id: recall_preset_3
|
||||
name: "${friendly_name} Preset 3"
|
||||
name: "Preset 3"
|
||||
icon: "mdi:numeric-3-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit2
|
||||
@@ -54,7 +54,7 @@ button:
|
||||
|
||||
- platform: template
|
||||
id: recall_preset_4
|
||||
name: "${friendly_name} Preset 4"
|
||||
name: "Preset 4"
|
||||
icon: "mdi:numeric-4-box"
|
||||
on_press:
|
||||
- output.turn_on: button_bit4
|
||||
@@ -65,7 +65,7 @@ button:
|
||||
|
||||
# Set Presets
|
||||
- platform: template
|
||||
name: "${friendly_name} Set Preset 1"
|
||||
name: "Set Preset 1"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-1-box-multiple"
|
||||
on_press:
|
||||
@@ -75,7 +75,7 @@ button:
|
||||
- button.press: recall_preset_1
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} Set Preset 2"
|
||||
name: "Set Preset 2"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-2-box-multiple"
|
||||
on_press:
|
||||
@@ -85,7 +85,7 @@ button:
|
||||
- button.press: recall_preset_2
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} Set Preset 3"
|
||||
name: "Set Preset 3"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-3-box-multiple"
|
||||
on_press:
|
||||
@@ -95,7 +95,7 @@ button:
|
||||
- button.press: recall_preset_3
|
||||
|
||||
- platform: template
|
||||
name: "${friendly_name} Set Preset 4"
|
||||
name: "Set Preset 4"
|
||||
entity_category: "config"
|
||||
icon: "mdi:numeric-4-box-multiple"
|
||||
on_press:
|
||||
@@ -1,6 +1,6 @@
|
||||
select:
|
||||
- platform: template
|
||||
name: "${friendly_name} Height Decoder Variant"
|
||||
name: "Height Decoder Variant"
|
||||
entity_category: "config"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
@@ -13,7 +13,7 @@ select:
|
||||
then:
|
||||
lambda: "id(desk_height)->set_decoder_variant(x);"
|
||||
- platform: template
|
||||
name: "${friendly_name} Height Units"
|
||||
name: "Height Units"
|
||||
entity_category: "config"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
@@ -29,7 +29,7 @@ select:
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: "${friendly_name} Min Target Height"
|
||||
name: "Min Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
@@ -42,7 +42,7 @@ number:
|
||||
lambda: |
|
||||
id(target_desk_height)->traits.set_min_value(x);
|
||||
- platform: template
|
||||
name: "${friendly_name} Max Target Height"
|
||||
name: "Max Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
35
firmware/addons/stable-ids.yaml
Normal file
35
firmware/addons/stable-ids.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
# This file provides stable entity IDs for various components, in order to be used in the HTTP API.
|
||||
|
||||
# ESPHome derives entity IDs (internally called "object IDs") from the component name, which is
|
||||
# used as the ID in the HTTP API endpoints. Unfortunately there is no way to control them so they
|
||||
# are set independently of the name, so this is a weird workaround for that.
|
||||
|
||||
sensor:
|
||||
- platform: copy
|
||||
source_id: desk_height
|
||||
internal: true
|
||||
name: "desk_height"
|
||||
|
||||
number:
|
||||
- platform: copy
|
||||
source_id: target_desk_height
|
||||
internal: true
|
||||
name: "target_desk_height"
|
||||
|
||||
button:
|
||||
- platform: copy
|
||||
source_id: recall_preset_1
|
||||
internal: true
|
||||
name: "desk_preset_1"
|
||||
- platform: copy
|
||||
source_id: recall_preset_2
|
||||
internal: true
|
||||
name: "desk_preset_2"
|
||||
- platform: copy
|
||||
source_id: recall_preset_3
|
||||
internal: true
|
||||
name: "desk_preset_3"
|
||||
- platform: copy
|
||||
source_id: recall_preset_4
|
||||
internal: true
|
||||
name: "desk_preset_4"
|
||||
63
firmware/base.yaml
Normal file
63
firmware/base.yaml
Normal file
@@ -0,0 +1,63 @@
|
||||
# Essential ESPHome config options
|
||||
esphome:
|
||||
name: "${name}"
|
||||
friendly_name: "${friendly_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.4.0"
|
||||
|
||||
uart:
|
||||
id: handset_tx
|
||||
tx_pin: 16
|
||||
baud_rate: 9600
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
|
||||
# Configurable options
|
||||
substitutions:
|
||||
name: "upsy-desky"
|
||||
friendly_name: "Upsy Desky"
|
||||
desk_height_name: "Desk Height"
|
||||
target_desk_height_name: "Target Desk Height"
|
||||
|
||||
# Standing Desk Component Config
|
||||
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 Addon Config
|
||||
button_bit1_pin: "21"
|
||||
button_bit2_pin: "22"
|
||||
button_bit4_pin: "19"
|
||||
button_m_pin: "18"
|
||||
|
||||
# Runtime Config Defaults
|
||||
default_height_units: "in" # Must be "in" or "cm"
|
||||
|
||||
packages:
|
||||
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml@master
|
||||
addon_presets: !include addons/presets.yaml
|
||||
addon_stable_ids: !include addons/stable-ids.yaml
|
||||
addon_runtime_config: !include addons/runtime-config.yaml
|
||||
|
||||
button:
|
||||
- platform: restart
|
||||
name: "Restart"
|
||||
|
||||
light:
|
||||
- platform: status_led
|
||||
id: upsy_desky_status_led
|
||||
name: "Status LED"
|
||||
pin: GPIO23
|
||||
restore_mode: RESTORE_DEFAULT_ON
|
||||
@@ -1,87 +1,8 @@
|
||||
# Essential ESPHome config options
|
||||
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.3.0"
|
||||
# This file is here for reverse compatibility. Older versions of the firmware
|
||||
# pointed to `config.yaml` instead of `base.yaml`. That file also included the
|
||||
# config found in `stock.yaml`, which is why it's being included here.
|
||||
|
||||
uart:
|
||||
id: handset_tx
|
||||
tx_pin: 16
|
||||
baud_rate: 9600
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
|
||||
# Configurable options
|
||||
substitutions:
|
||||
name: "upsy-desky"
|
||||
friendly_name: "Upsy Desky"
|
||||
desk_height_name: "${friendly_name} Desk Height"
|
||||
target_desk_height_name: "${friendly_name} Target Desk Height"
|
||||
|
||||
# Standing Desk Component Config
|
||||
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 Addon Config
|
||||
button_bit1_pin: "21"
|
||||
button_bit2_pin: "22"
|
||||
button_bit4_pin: "19"
|
||||
button_m_pin: "18"
|
||||
|
||||
# Runtime Config Defaults
|
||||
default_height_units: "in" # Must be "in" or "cm"
|
||||
# Please use `base.yaml` for new configurations and customizations.
|
||||
|
||||
packages:
|
||||
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml@master
|
||||
addon_presets: !include addons/presets.yml
|
||||
addon_runtime_config: !include addons/runtime-config.yml
|
||||
|
||||
button:
|
||||
- platform: restart
|
||||
name: "${friendly_name} Restart"
|
||||
|
||||
light:
|
||||
- platform: status_led
|
||||
id: upsy_desky_status_led
|
||||
name: "${friendly_name} Status LED"
|
||||
pin: GPIO23
|
||||
restore_mode: RESTORE_DEFAULT_ON
|
||||
|
||||
# Everything below this line is mostly for the benefit of the stock firmware
|
||||
# and the
|
||||
dashboard_import:
|
||||
package_import_url: github://tjhorner/upsy-desky/firmware/config.yaml
|
||||
|
||||
logger:
|
||||
level: INFO
|
||||
|
||||
wifi:
|
||||
ap:
|
||||
password: "hunter2hunter2"
|
||||
|
||||
captive_portal:
|
||||
|
||||
improv_serial:
|
||||
|
||||
api:
|
||||
password: ""
|
||||
reboot_timeout: 0s
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
ota:
|
||||
password: ""
|
||||
stock: !include stock.yaml
|
||||
@@ -1,5 +1,5 @@
|
||||
packages:
|
||||
base: !include config.yaml
|
||||
stock: !include stock.yaml
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
@@ -10,4 +10,4 @@ debug:
|
||||
text_sensor:
|
||||
- platform: debug
|
||||
device:
|
||||
name: "${friendly_name} Device Info"
|
||||
name: "Device Info"
|
||||
26
firmware/stock.yaml
Normal file
26
firmware/stock.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
packages:
|
||||
base: !include base.yaml
|
||||
|
||||
logger:
|
||||
level: INFO
|
||||
|
||||
wifi:
|
||||
ap:
|
||||
password: "hunter2hunter2"
|
||||
|
||||
captive_portal:
|
||||
|
||||
improv_serial:
|
||||
|
||||
api:
|
||||
password: ""
|
||||
reboot_timeout: 0s
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
ota:
|
||||
password: ""
|
||||
|
||||
dashboard_import:
|
||||
package_import_url: github://tjhorner/upsy-desky/firmware/stock.yaml@v0.4.0
|
||||
Reference in New Issue
Block a user