10 Commits

Author SHA1 Message Date
TJ Horner
fd16478c5a Enforce min ESPHome version 2023.5.1 2023-05-18 08:41:43 -07:00
TJ Horner
ce9cb8b003 Version 1.0.1 2023-05-18 08:38:44 -07:00
TJ Horner
274ec9ac94 Fix runtime config addon for ESPHome 2023.5 2023-05-18 08:35:58 -07:00
TJ Horner
0567307595 Update package_import_url 2023-03-12 14:40:59 -07:00
TJ Horner
7a881dc1ee Firmware 1.0.0 2023-03-12 14:38:22 -07:00
TJ Horner
148b9cd379 Add runtime config button to re-detect decoder 2023-03-12 00:58:14 -08:00
TJ Horner
655cb303d3 Auto detection beta 2023-03-11 22:13:24 -08:00
TJ Horner
f4d61cdb36 Add Bluetooth Proxy support to stock firmware 2023-03-11 19:07:36 -08:00
TJ Horner
1986a79782 More tools docs 2023-03-01 10:04:22 -08:00
TJ Horner
a0602c1201 Add flashing script 2023-02-26 13:10:26 -08:00
8 changed files with 48 additions and 20 deletions

View File

@@ -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

View File

@@ -0,0 +1,4 @@
esp32_ble_tracker:
bluetooth_proxy:
active: true

View File

@@ -1,17 +1,4 @@
select:
- platform: template
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: "Height Units"
entity_category: "config"
@@ -24,8 +11,19 @@ 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

View File

@@ -3,6 +3,7 @@ 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
@@ -11,7 +12,7 @@ esphome:
data: [ 0x0 ]
project:
name: tj_horner.upsy_desky
version: "0.4.0"
version: "1.0.1"
uart:
id: handset_tx
@@ -32,7 +33,6 @@ 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"
@@ -46,10 +46,11 @@ 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

View File

@@ -23,4 +23,4 @@ ota:
password: ""
dashboard_import:
package_import_url: github://tjhorner/upsy-desky/firmware/stock.yaml@v0.4.0
package_import_url: github://tjhorner/upsy-desky/firmware/stock.yaml@v1.0.1

9
tools/README.md Normal file
View 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
View 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
View File

@@ -0,0 +1,2 @@
#!/bin/bash
platformio run -d ../test-firmware --target upload --environment test_target