mirror of
https://github.com/tjhorner/upsy-desky.git
synced 2026-01-11 08:18:02 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd16478c5a | ||
|
|
ce9cb8b003 | ||
|
|
274ec9ac94 | ||
|
|
0567307595 | ||
|
|
7a881dc1ee | ||
|
|
148b9cd379 | ||
|
|
655cb303d3 | ||
|
|
f4d61cdb36 | ||
|
|
1986a79782 | ||
|
|
a0602c1201 | ||
|
|
4f3b5acf58 |
@@ -13,4 +13,6 @@ It is organized like so:
|
||||
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)
|
||||
- `runtime-config.yaml`: Adds support for runtime configuration options (you might want to remove this if you are configuring everything via ESPHome yaml)
|
||||
- `bluetooth-proxy.yaml`: Contains the necessary configuration to use the Upsy Desky as a [Bluetooth Proxy](https://esphome.io/components/bluetooth_proxy.html)
|
||||
- `stable-ids.yaml`: Contains configuration necessary to keep some entity IDs stable via the HTTP API
|
||||
4
firmware/addons/bluetooth-proxy.yaml
Normal file
4
firmware/addons/bluetooth-proxy.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
esp32_ble_tracker:
|
||||
|
||||
bluetooth_proxy:
|
||||
active: true
|
||||
@@ -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,19 +1,6 @@
|
||||
select:
|
||||
- platform: template
|
||||
name: "${friendly_name} Height Decoder Variant"
|
||||
entity_category: "config"
|
||||
optimistic: true
|
||||
restore_value: true
|
||||
options:
|
||||
- uplift
|
||||
- jarvis
|
||||
- omnidesk
|
||||
initial_option: ${standing_desk_variant}
|
||||
on_value:
|
||||
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
|
||||
@@ -24,12 +11,23 @@ select:
|
||||
on_value:
|
||||
then:
|
||||
lambda: |
|
||||
id(desk_height)->set_unit_of_measurement(x);
|
||||
id(target_desk_height)->traits.set_unit_of_measurement(x);
|
||||
id(desk_height)->set_unit_of_measurement(x.c_str());
|
||||
id(target_desk_height)->traits.set_unit_of_measurement(x.c_str());
|
||||
|
||||
button:
|
||||
- platform: template
|
||||
name: "Re-Detect Decoder"
|
||||
entity_category: "config"
|
||||
icon: "mdi:cog-refresh"
|
||||
on_press:
|
||||
- uart.write:
|
||||
id: handset_tx
|
||||
data: [ 0x0 ]
|
||||
- standing_desk_height.detect_decoder: desk_height
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
name: "${friendly_name} Min Target Height"
|
||||
name: "Min Target Height"
|
||||
entity_category: "config"
|
||||
min_value: 0
|
||||
max_value: 150
|
||||
@@ -42,7 +40,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
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# Essential ESPHome config options
|
||||
esphome:
|
||||
name: "${name}"
|
||||
friendly_name: "${friendly_name}"
|
||||
name_add_mac_suffix: true
|
||||
min_version: "2023.5.1"
|
||||
on_boot:
|
||||
then:
|
||||
# Wakes up the desk and reports height
|
||||
@@ -10,7 +12,7 @@ esphome:
|
||||
data: [ 0x0 ]
|
||||
project:
|
||||
name: tj_horner.upsy_desky
|
||||
version: "0.3.1"
|
||||
version: "1.0.1"
|
||||
|
||||
uart:
|
||||
id: handset_tx
|
||||
@@ -24,14 +26,13 @@ esp32:
|
||||
substitutions:
|
||||
name: "upsy-desky"
|
||||
friendly_name: "Upsy Desky"
|
||||
desk_height_name: "${friendly_name} Desk Height"
|
||||
target_desk_height_name: "${friendly_name} Target Desk Height"
|
||||
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"
|
||||
|
||||
@@ -45,18 +46,19 @@ substitutions:
|
||||
default_height_units: "in" # Must be "in" or "cm"
|
||||
|
||||
packages:
|
||||
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml@master
|
||||
standing_desk: github://tjhorner/esphome-standing-desk/configs/template.yaml
|
||||
addon_presets: !include addons/presets.yaml
|
||||
addon_stable_ids: !include addons/stable-ids.yaml
|
||||
addon_runtime_config: !include addons/runtime-config.yaml
|
||||
addon_bluetooth_proxy: !include addons/bluetooth-proxy.yaml
|
||||
|
||||
button:
|
||||
- platform: restart
|
||||
name: "${friendly_name} Restart"
|
||||
name: "Restart"
|
||||
|
||||
light:
|
||||
- platform: status_led
|
||||
id: upsy_desky_status_led
|
||||
name: "${friendly_name} Status LED"
|
||||
name: "Status LED"
|
||||
pin: GPIO23
|
||||
restore_mode: RESTORE_DEFAULT_ON
|
||||
|
||||
@@ -10,4 +10,4 @@ debug:
|
||||
text_sensor:
|
||||
- platform: debug
|
||||
device:
|
||||
name: "${friendly_name} Device Info"
|
||||
name: "Device Info"
|
||||
@@ -23,4 +23,4 @@ ota:
|
||||
password: ""
|
||||
|
||||
dashboard_import:
|
||||
package_import_url: github://tjhorner/upsy-desky/firmware/stock.yaml@v0.3.1
|
||||
package_import_url: github://tjhorner/upsy-desky/firmware/stock.yaml@v1.0.1
|
||||
|
||||
9
tools/README.md
Normal file
9
tools/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Tools
|
||||
|
||||
## `oem-flash.sh`
|
||||
|
||||
This script is used before shipment to flash the Upsy Desky with the stock firmware, and to reprogram the CP2102 USB-to-serial chip with the correct name and serial (based on MAC address).
|
||||
|
||||
## `test-flash.sh`
|
||||
|
||||
Flashes the test firmware with PlatformIO (see `../test-firmware`).
|
||||
12
tools/oem-flash.sh
Executable file
12
tools/oem-flash.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
MAC_ADDR=$(esptool.py --chip esp32 read_mac | sed -En "s/MAC: (.*)/\1/p" | uniq | sed 's/://g')
|
||||
esphome upload --device /dev/cu.usbserial* ../firmware/stock.yaml
|
||||
|
||||
if ! command -v cp210x-cfg &> /dev/null
|
||||
then
|
||||
# Get cp210x-cfg from https://github.com/DiUS/cp210x-cfg
|
||||
echo "cp210x-cfg was not found; CP2102 will not be serialized or renamed"
|
||||
else
|
||||
cp210x-cfg -N "Upsy Desky" -S $MAC_ADDR
|
||||
fi
|
||||
2
tools/test-flash.sh
Executable file
2
tools/test-flash.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
platformio run -d ../test-firmware --target upload --environment test_target
|
||||
Reference in New Issue
Block a user