Not long ago the old JamBox sitting in one of my office display case’s caught my eye.
After picking it up I noticed it used an ESP32 development board, so I had to flash it for ESPHome. I downloaded the PixelOperator8 font and uploaded it to my esphome/fonts folder in Home Assistant. Then I figured out the following YAML to get the buttons, potentiometers (knobs), and LED Matrix working.
After installing the YAML and installing the device to Home Assistant, here are the sensors in the device UI.
Screenshot
The device has a ton of inputs with the eight buttons and five knobs and the 8×32 LED Matrix can display text or maybe a simple graph. I haven’t thought of a good use for it though. Do you have any ideas?
ESP32 G -> CAN Board G -> RJ45 Pin 8 -> Capacitor stripe side
ESP32 3.3 -> CAN Board 3.3 -> Capacitor non-stripe side
ESP32 Pin 4 -> CAN Board TX
ESP32 Pin 5 -> CAN Board RX
CAN Board CANH -> RJ45 Pin 5
CAN Board CANL -> RJ45 Pin 4
Start with this YAML for your ESPHome device:
# Add your standard esphome, ota, api, and wifi sections here at the top
logger:
level: DEBUG
esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf
canbus:
- platform: esp32_can
id: can
tx_pin: GPIO4
rx_pin: GPIO5
bit_rate: 125KBPS
can_id: 0x05
use_extended_id: false
on_frame:
- can_id: 0x000
can_id_mask: 0x000 # This catches EVERYTHING
then:
- lambda: |-
std::string res = "";
for (int i = 0; i < x.size(); i++) {
char buf[5];
sprintf(buf, "%02X ", x[i]);
res += buf;
}
ESP_LOGD("ALORAIR_FINDER", "Received ID: 0x%03X, Data: %s", can_id, res.c_str());
# ====== Periodic Polling to Request Status ======
interval:
- interval: 10s
then:
- canbus.send:
can_id: 0x123
use_extended_id: false
data: [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
This will test sending and receiving. After you flash the device and have it connected to the dehumidifier, open the ESPHome device log and look for lines like below.
If you see errors after the send or don’t receive messages back, try changing the bit_rate from 125 to 50, install, and recheck the logs.
If you do receive messages back, make note of the value after Received ID, which is 0x123 above. Then open up the ESPHome device’s YAML again and replace everything below type: esp-idf with the following.
If your ID was different than 0x123 (0x3b0 seems common), change the can_id under on_frame. Update mobile_app_YOUR_PHONE for your phone. Install this new code to the device. Go to Settings -> Devices & services -> ESPHome. If your device isn’t already listed, add it, and click through to see the entities. Hopefully you see the Controls and Sensors with data.
Try to toggle the power and change the setpoint. If it’s working, the dehumidifier should respond. Good luck! If all is working, I suggest adjusting your logging level to WARN. There is some stuff in the YAML to alert if the unit sends data that isn’t recognized, because there might be flags or statuses not implemented.
If you install the stack-in-card via HACS, here’s some YAML for your dashboard. Make sure to update the entity names to match what you have.