You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gcormier's Megadesk-Companion has finally reached my hands, and much to my surprise getting the plastic top off was not the hardest issue for me at least. I am currently trying to get the Megadesk-Companion into my WIFI so I can integrate it into HA.
At first I thought they were pre flashed, and I see the WIFI Hotspot of the ESP but when connecting I do not have a capture portal or a website via http://192.168.4.1 so I am not sure if I am already misunderstanding something?
My next thought was to flash it myself with the yaml example I found here and just add my WIFI details there.
This is my first project with a ESP. I am on macOS and used brew to install esphome (Version 2023.12.8) and esptool.py (4.7.0)
So I pressed the button and plugged in the USB-C cable.
When I do the following command
esptool.py chip_id
esptool.py v4.7.0 Found 3 serial ports Serial port /dev/cu.usbmodem32142202 Connecting...................................... /dev/cu.usbmodem32142202 failed to connect: Failed to connect to Espressif device: No serial data received. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html Serial port /dev/cu.usbmodem2101 Connecting... Detecting chip type... ESP32-C3 Chip is ESP32-C3 (QFN32) (revision v0.4) Features: WiFi, BLE, Embedded Flash 4MB (XMC) Crystal is 40MHz MAC: d4:f9:8d:09:fe:cc Uploading stub... Running stub... Stub running... Warning: ESP32-C3 has no Chip ID. Reading MAC instead. MAC: d4:f9:8d:09:fe:cc Hard resetting via RTS pin..
Then if I understand correctly, I need to compile the .yaml
I modified the following yaml I found on this git with my WIFI details and nothing else.
`# If you get errors compiling this with esphome, make sure you are on a recent version.
'esphome version' will output the version you are on.
If you want to compile in the Home Assistant esphome addon, you need to copy megadesk.h into your esphome folder
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello megadesk Tinkerers,
Gcormier's Megadesk-Companion has finally reached my hands, and much to my surprise getting the plastic top off was not the hardest issue for me at least. I am currently trying to get the Megadesk-Companion into my WIFI so I can integrate it into HA.
At first I thought they were pre flashed, and I see the WIFI Hotspot of the ESP but when connecting I do not have a capture portal or a website via http://192.168.4.1 so I am not sure if I am already misunderstanding something?
My next thought was to flash it myself with the yaml example I found here and just add my WIFI details there.
This is my first project with a ESP. I am on macOS and used brew to install esphome (Version 2023.12.8) and esptool.py (4.7.0)
So I pressed the button and plugged in the USB-C cable.
When I do the following command
esptool.py chip_id
esptool.py v4.7.0 Found 3 serial ports Serial port /dev/cu.usbmodem32142202 Connecting...................................... /dev/cu.usbmodem32142202 failed to connect: Failed to connect to Espressif device: No serial data received. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html Serial port /dev/cu.usbmodem2101 Connecting... Detecting chip type... ESP32-C3 Chip is ESP32-C3 (QFN32) (revision v0.4) Features: WiFi, BLE, Embedded Flash 4MB (XMC) Crystal is 40MHz MAC: d4:f9:8d:09:fe:cc Uploading stub... Running stub... Stub running... Warning: ESP32-C3 has no Chip ID. Reading MAC instead. MAC: d4:f9:8d:09:fe:cc Hard resetting via RTS pin..
Then if I understand correctly, I need to compile the .yaml
I modified the following yaml I found on this git with my WIFI details and nothing else.
`# If you get errors compiling this with esphome, make sure you are on a recent version.
'esphome version' will output the version you are on.
If you want to compile in the Home Assistant esphome addon, you need to copy megadesk.h into your esphome folder
on your Home Assistant platform.
esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf
version: recommended
esphome:
name: megadesk
comment: megadesk-companion
platformio_options:
board_build.flash_mode: dio # If you don't specify this using esp-idf framework, the device will boot-loop.
includes:
- megadesk.h
on_boot:
priority: -100
then:
- delay: 1s
- uart.write: "<C0.0."
- delay: 1s
- uart.write: "<R0.11."
- delay: 1s
- uart.write: "<R0.12."
You need to make sure tx_pin and rx_pin are set properly for your device.
For 5-pin Megadesks, this will not need changing.
If you have a 3-pin megadesk, try swapping them in case of a mixup on RX/TX
when you soldered the wires.
uart:
id: uart_desk
baud_rate: 115200
tx_pin: GPIO6
rx_pin: GPIO7
logger:
hardware_uart: USB_SERIAL_JTAG # Logging over the USB-C port (WiFi will always log as well)
api:
password: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "Companion Fallback"
password: "megadesk"
captive_portal:
web_server:
port: 80
sensor:
lambda: |-
auto megadesk = new Megadesk(id(uart_desk));
App.register_component(megadesk);
return { megadesk->raw_height, megadesk->min_height, megadesk->max_height };
sensors:
internal: true
on_value:
then:
- component.update: megadesk_height_inches
- component.update: megadesk_height_cm
- component.update: megadesk_height_raw
number:
name: "Megadesk Height (inches)"
id: megadesk_height_inches
min_value: 23
max_value: 47
step: 0.53
mode: slider
update_interval: never
unit_of_measurement: 'inches'
#NewValue = (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin
lambda: |-
return ((((id(megadesk_raw).state - 299) * (47 - 23)) / (6914 - 299)) + 23);
set_action:
id: megadesk_height_raw
value: !lambda "return int((((x - 23) * (6914 - 299)) / (47 - 23)) + 299);"
name: "Megadesk Height (cm)"
id: megadesk_height_cm
min_value: 58.42
max_value: 118.745
step: 0.53
mode: slider
update_interval: never
unit_of_measurement: 'cm'
#NewValue = (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin
lambda: |-
return ((((id(megadesk_raw).state - 299) * (119.38 - 58.42)) / (6914 - 299)) + 58.42);
set_action:
id: megadesk_height_raw
value: !lambda "return int((((x - 58.42) * (6640 - 299)) / (119.38 - 58.42)) + 299);"
name: "Megadesk Height (raw)"
id: megadesk_height_raw
internal: true
button:
name: "Desk Position 2"
on_press:
then:
- uart.write: "<L0,2."
name: "Desk Position 3"
on_press:
then:
- uart.write: "<L0,3."
name: "Desk Position 4"
on_press:
then:
- uart.write: "<L0,4."
name: "Desk Position 5"
on_press:
then:
- uart.write: "<L0,5."
name: "Toggle Minimum Desk Height"
on_press:
then:
- uart.write: "<L0,11."
- uart.write: "<R0,11."
name: "Toggle Maximum Desk Height"
on_press:
then:
- uart.write: "<L0,12."
- uart.write: "<R0,12."
name: "Recalibrate Desk"
on_press:
then:
- uart.write: "<L0,14."
name: "Reboot Megadesk"
on_press:
then:
- uart.write: "<L0,15."
name: "Toggle Audio feedback"
on_press:
then:
- uart.write: "<L0,17."
name: "Toggle both-button mode"
on_press:
then:
- uart.write: "<L0,18."
interval:
then:
But get the following message
`esphome compile megadesk-companion.yaml
INFO ESPHome 2023.12.8
INFO Reading configuration megadesk-companion.yaml...
ERROR Error while reading config: Invalid YAML syntax:
Error reading file secrets.yaml: [Errno 2] No such file or directory: 'secrets.yaml'`
If anybody could point me in the right direction or a guide with mega desk integrated in HA it would be very appreciated
Beta Was this translation helpful? Give feedback.
All reactions