WREN C5 1.00.03
Added more substitutions and travel time in preperation for the next phase. Trying to keep the controls generic as the WREN is more than a recliner controller and is being used in other area such as solar panel and vent controls.
This commit is contained in:
@@ -99,18 +99,27 @@ substitutions:
|
|||||||
# ======================== About ===========================
|
# ======================== About ===========================
|
||||||
|
|
||||||
author: "DitroniX - Dave Williams"
|
author: "DitroniX - Dave Williams"
|
||||||
firmware_version: "1.00.02"
|
firmware_version: "1.00.03"
|
||||||
release_date: "2026-06-21"
|
release_date: "2026-06-22"
|
||||||
board_name: "WREN C5"
|
board_name: "WREN C5"
|
||||||
board_mcu: "ESP32-C5"
|
board_mcu: "ESP32-C5"
|
||||||
board_rev: "1.2606.104"
|
board_rev: "1.2606.104"
|
||||||
|
|
||||||
# ======================== Config ===========================
|
# ======================== Config ===========================
|
||||||
|
|
||||||
board_location: "Lounge"
|
board_Initial_location: "Lounge"
|
||||||
|
|
||||||
voltage_low: 3.00
|
voltage_low: 3.00
|
||||||
voltage_high: 48.0
|
voltage_high: 48.0
|
||||||
|
|
||||||
|
travel_time_min: "1"
|
||||||
|
travel_time_max: "60"
|
||||||
|
travel_time_step: "1"
|
||||||
|
|
||||||
|
open_travel_time_default: "12"
|
||||||
|
preset_position_time_default: "6"
|
||||||
|
close_travel_time_default: "11"
|
||||||
|
|
||||||
################################## SETUP ##################################
|
################################## SETUP ##################################
|
||||||
|
|
||||||
# ========================== GPIO =============================
|
# ========================== GPIO =============================
|
||||||
@@ -146,109 +155,215 @@ output:
|
|||||||
pin: GPIO27
|
pin: GPIO27
|
||||||
id: blue_led
|
id: blue_led
|
||||||
|
|
||||||
################################## LIGHT ##################################
|
################################## LIGHT ######################################
|
||||||
light:
|
light:
|
||||||
- platform: binary
|
- platform: binary
|
||||||
id: heartbeat
|
id: heartbeat
|
||||||
output: blue_led
|
output: blue_led
|
||||||
|
|
||||||
|
################################## NUMBER ######################################
|
||||||
|
number:
|
||||||
|
- platform: template
|
||||||
|
id: open_travel_time
|
||||||
|
name: "Open Travel Time"
|
||||||
|
entity_category: config
|
||||||
|
icon: mdi:arrow-expand-horizontal
|
||||||
|
optimistic: true
|
||||||
|
restore_value: true
|
||||||
|
min_value: ${travel_time_min}
|
||||||
|
max_value: ${travel_time_max}
|
||||||
|
step: ${travel_time_step}
|
||||||
|
unit_of_measurement: "s"
|
||||||
|
initial_value: ${open_travel_time_default}
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
id: preset_position_time
|
||||||
|
name: "Preset Position Time"
|
||||||
|
entity_category: config
|
||||||
|
icon: mdi:seat-recline-extra
|
||||||
|
optimistic: true
|
||||||
|
restore_value: true
|
||||||
|
min_value: ${travel_time_min}
|
||||||
|
max_value: ${travel_time_max}
|
||||||
|
step: ${travel_time_step}
|
||||||
|
unit_of_measurement: "s"
|
||||||
|
initial_value: ${preset_position_time_default}
|
||||||
|
set_action:
|
||||||
|
- lambda: |-
|
||||||
|
id(preset_position_time).publish_state(x);
|
||||||
|
id(preset_position_time_diag).publish_state(x);
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
id: close_travel_time
|
||||||
|
name: "Close Travel Time"
|
||||||
|
entity_category: config
|
||||||
|
icon: mdi:arrow-collapse-horizontal
|
||||||
|
optimistic: true
|
||||||
|
restore_value: true
|
||||||
|
min_value: ${travel_time_min}
|
||||||
|
max_value: ${travel_time_max}
|
||||||
|
step: ${travel_time_step}
|
||||||
|
unit_of_measurement: "s"
|
||||||
|
initial_value: ${close_travel_time_default}
|
||||||
|
|
||||||
|
################################## BUTTON ######################################
|
||||||
|
button:
|
||||||
|
- platform: template
|
||||||
|
name: "Reset Travel Times"
|
||||||
|
id: reset_travel_times
|
||||||
|
entity_category: config
|
||||||
|
icon: mdi:restore
|
||||||
|
on_press:
|
||||||
|
- lambda: |-
|
||||||
|
id(open_travel_time).publish_state(${open_travel_time_default});
|
||||||
|
id(preset_position_time).publish_state(${preset_position_time_default});
|
||||||
|
id(close_travel_time).publish_state(${close_travel_time_default});
|
||||||
|
|
||||||
|
ESP_LOGI(
|
||||||
|
"CONFIG",
|
||||||
|
"Travel times restored to defaults."
|
||||||
|
);
|
||||||
|
|
||||||
|
################################## TEXT ######################################
|
||||||
|
text:
|
||||||
|
- platform: template
|
||||||
|
id: board_location
|
||||||
|
name: "Board Location"
|
||||||
|
mode: TEXT
|
||||||
|
max_length: 32
|
||||||
|
restore_value: true
|
||||||
|
optimistic: true
|
||||||
|
entity_category: config
|
||||||
|
icon: mdi:map-marker
|
||||||
|
|
||||||
|
initial_value: "${board_Initial_location}"
|
||||||
|
|
||||||
|
set_action:
|
||||||
|
- lambda: |-
|
||||||
|
id(board_location).publish_state(x);
|
||||||
|
|
||||||
################################## TEXT SENSOR ##################################
|
################################## TEXT SENSOR ##################################
|
||||||
|
|
||||||
text_sensor:
|
text_sensor:
|
||||||
# =====================================================
|
- platform: template
|
||||||
# WREN C5 FIRMWARE METADATA
|
id: board_location_diagnostic
|
||||||
# =====================================================
|
name: "Board Location"
|
||||||
|
entity_category: diagnostic
|
||||||
|
icon: mdi:map-marker
|
||||||
|
|
||||||
|
- platform: version
|
||||||
|
id: esphome_version
|
||||||
|
name: "ESPHome Version"
|
||||||
|
entity_category: diagnostic
|
||||||
|
icon: mdi:tag
|
||||||
|
hide_timestamp: true
|
||||||
|
hide_hash: true
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Author"
|
name: "Author"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:account
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${author}"};
|
return {"${author}"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Firmware Version"
|
name: "Firmware Version"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:application-cog
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${firmware_version}"};
|
return {"${firmware_version}"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Release Date"
|
name: "Release Date"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:calendar
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${release_date}"};
|
return {"${release_date}"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Board Name"
|
name: "Board Name"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:developer-board
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${board_name}"};
|
return {"${board_name}"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Board MCU"
|
name: "Board MCU"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:cpu-64-bit
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${board_mcu}"};
|
return {"${board_mcu}"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Board Build"
|
name: "Board Revision"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:memory
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"${board_rev}"};
|
return {"${board_rev}"};
|
||||||
|
|
||||||
- platform: template
|
|
||||||
name: "Board Location"
|
|
||||||
entity_category: diagnostic
|
|
||||||
icon: mdi:information
|
|
||||||
update_interval: 60s
|
|
||||||
lambda: |-
|
|
||||||
return {"${board_location}"};
|
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Product"
|
name: "Product"
|
||||||
icon: mdi:information
|
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
update_interval: 60s
|
icon: mdi:package-variant-closed
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"Professional Energy Monitor"};
|
return {"Professional Energy Monitor"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Hardware"
|
name: "Hardware"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
icon: mdi:information
|
icon: mdi:chip
|
||||||
update_interval: 60s
|
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return {"ESP32-C5 Dual ATM90E32"};
|
return {"ESP32-C5 Dual ATM90E32"};
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "WiFi Signal Quality"
|
|
||||||
id: wifi_signal_quality
|
id: wifi_signal_quality
|
||||||
|
name: "WiFi Signal Quality"
|
||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
|
icon: mdi:wifi
|
||||||
update_interval: 30s
|
update_interval: 30s
|
||||||
lambda: |-
|
lambda: |-
|
||||||
if (!id(wifi_signal_db).has_state()) {
|
if (!id(wifi_signal_db).has_state()) {
|
||||||
return {"No Signal"};
|
return {"No Signal"};
|
||||||
}
|
}
|
||||||
|
|
||||||
int rssi = abs((int)id(wifi_signal_db).state);
|
int rssi = abs((int) id(wifi_signal_db).state);
|
||||||
|
|
||||||
if (rssi <= 30) {
|
if (rssi <= 30) {
|
||||||
return {"Signal Very Strong"};
|
return {"Very Strong"};
|
||||||
} else if (rssi <= 50) {
|
} else if (rssi <= 50) {
|
||||||
return {"Signal Excellent"};
|
return {"Excellent"};
|
||||||
} else if (rssi <= 60) {
|
} else if (rssi <= 60) {
|
||||||
return {"Signal Healthy"};
|
return {"Healthy"};
|
||||||
} else if (rssi <= 70) {
|
} else if (rssi <= 70) {
|
||||||
return {"Signal Very Good"};
|
return {"Very Good"};
|
||||||
} else if (rssi <= 80) {
|
} else if (rssi <= 80) {
|
||||||
return {"Signal Good"};
|
return {"Good"};
|
||||||
} else if (rssi <= 90) {
|
} else if (rssi <= 90) {
|
||||||
return {"Signal Poor - Try Moving Position"};
|
return {"Poor - Reposition AP"};
|
||||||
} else if (rssi <= 100) {
|
} else if (rssi <= 100) {
|
||||||
return {"Signal Very Low - Move Position"};
|
return {"Very Low - Move AP"};
|
||||||
} else {
|
|
||||||
return {"No Signal"};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {"No Signal"};
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
name: "Travel Configuration"
|
||||||
|
entity_category: diagnostic
|
||||||
|
icon: mdi:clipboard-check
|
||||||
|
|
||||||
|
lambda: |-
|
||||||
|
float open = id(open_travel_time).state;
|
||||||
|
float preset = id(preset_position_time).state;
|
||||||
|
float close = id(close_travel_time).state;
|
||||||
|
|
||||||
|
if (preset > open)
|
||||||
|
return {"Invalid - Preset exceeds Open"};
|
||||||
|
|
||||||
|
if (preset < close)
|
||||||
|
return {"Invalid - Preset below Close"};
|
||||||
|
|
||||||
|
return {"Valid"};
|
||||||
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
# VOLTAGE STATUS AND LOG
|
# VOLTAGE STATUS AND LOG
|
||||||
# =====================================================
|
# =====================================================
|
||||||
@@ -380,6 +495,36 @@ binary_sensor:
|
|||||||
|
|
||||||
################################## SENSOR ##################################
|
################################## SENSOR ##################################
|
||||||
sensor:
|
sensor:
|
||||||
|
- platform: template
|
||||||
|
id: open_travel_time_diag
|
||||||
|
name: " Open Time"
|
||||||
|
entity_category: diagnostic
|
||||||
|
icon: mdi:arrow-expand-horizontal
|
||||||
|
unit_of_measurement: "s"
|
||||||
|
accuracy_decimals: 0
|
||||||
|
lambda: |-
|
||||||
|
return id(open_travel_time).state;
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
id: preset_position_time_diag
|
||||||
|
name: "Travel Preset Time"
|
||||||
|
entity_category: diagnostic
|
||||||
|
icon: mdi:seat-recline-extra
|
||||||
|
unit_of_measurement: "s"
|
||||||
|
accuracy_decimals: 0
|
||||||
|
lambda: |-
|
||||||
|
return id(preset_position_time).state;
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
id: close_travel_time_diag
|
||||||
|
name: "Travel Close Time"
|
||||||
|
entity_category: diagnostic
|
||||||
|
icon: mdi:arrow-collapse-horizontal
|
||||||
|
unit_of_measurement: "s"
|
||||||
|
accuracy_decimals: 0
|
||||||
|
lambda: |-
|
||||||
|
return id(close_travel_time).state;
|
||||||
|
|
||||||
- platform: adc
|
- platform: adc
|
||||||
id: supply_voltage
|
id: supply_voltage
|
||||||
pin: GPIO4
|
pin: GPIO4
|
||||||
|
|||||||
Reference in New Issue
Block a user