mirror of
https://github.com/syssi/esphome-votronic.git
synced 2025-07-23 04:23:02 +02:00
Improve triple charger support (#44)
This commit is contained in:
committed by
GitHub
parent
467af8f150
commit
afada45065
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@@ -172,6 +172,7 @@ jobs:
|
||||
esphome -s external_components_source components config esp8266-charger-example-faker.yaml
|
||||
esphome -s external_components_source components config esp8266-charging-converter-example-faker.yaml
|
||||
esphome -s external_components_source components config esp8266-smart-shunt-example-faker.yaml
|
||||
esphome -s external_components_source components config esp8266-triple-charger-example-faker.yaml
|
||||
- run: |
|
||||
esphome -s external_components_source ../components config tests/esp8266-fake-charger.yaml
|
||||
esphome -s external_components_source ../components config tests/esp8266-fake-charging-converter.yaml
|
||||
@@ -219,3 +220,4 @@ jobs:
|
||||
esphome -s external_components_source components compile esp8266-charger-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-charging-converter-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-smart-shunt-example-faker.yaml
|
||||
esphome -s external_components_source components compile esp8266-triple-charger-example-faker.yaml
|
||||
|
@@ -14,12 +14,18 @@ CONF_DISCHARGING = "discharging"
|
||||
CONF_CONTROLLER_ACTIVE = "controller_active"
|
||||
CONF_CURRENT_REDUCTION = "current_reduction"
|
||||
CONF_AES_ACTIVE = "aes_active"
|
||||
CONF_PV_CONTROLLER_ACTIVE = "pv_controller_active"
|
||||
CONF_PV_CURRENT_REDUCTION = "pv_current_reduction"
|
||||
CONF_PV_AES_ACTIVE = "pv_aes_active"
|
||||
|
||||
ICON_CHARGING = "mdi:battery-charging"
|
||||
ICON_DISCHARGING = "mdi:power-plug"
|
||||
ICON_CONTROLLER_ACTIVE = "mdi:power"
|
||||
ICON_CURRENT_REDUCTION = "mdi:car-speed-limiter"
|
||||
ICON_AES_ACTIVE = "mdi:export"
|
||||
ICON_PV_CONTROLLER_ACTIVE = "mdi:power"
|
||||
ICON_PV_CURRENT_REDUCTION = "mdi:car-speed-limiter"
|
||||
ICON_PV_AES_ACTIVE = "mdi:export"
|
||||
|
||||
BINARY_SENSORS = [
|
||||
CONF_CHARGING,
|
||||
@@ -27,6 +33,9 @@ BINARY_SENSORS = [
|
||||
CONF_CONTROLLER_ACTIVE,
|
||||
CONF_CURRENT_REDUCTION,
|
||||
CONF_AES_ACTIVE,
|
||||
CONF_PV_CONTROLLER_ACTIVE,
|
||||
CONF_PV_CURRENT_REDUCTION,
|
||||
CONF_PV_AES_ACTIVE,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
@@ -62,6 +71,28 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
cv.Optional(CONF_ICON, default=ICON_AES_ACTIVE): cv.icon,
|
||||
}
|
||||
),
|
||||
cv.Optional(
|
||||
CONF_PV_CONTROLLER_ACTIVE
|
||||
): binary_sensor.BINARY_SENSOR_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(binary_sensor.BinarySensor),
|
||||
cv.Optional(CONF_ICON, default=ICON_PV_CONTROLLER_ACTIVE): cv.icon,
|
||||
}
|
||||
),
|
||||
cv.Optional(
|
||||
CONF_PV_CURRENT_REDUCTION
|
||||
): binary_sensor.BINARY_SENSOR_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(binary_sensor.BinarySensor),
|
||||
cv.Optional(CONF_ICON, default=ICON_PV_CURRENT_REDUCTION): cv.icon,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_PV_AES_ACTIVE): binary_sensor.BINARY_SENSOR_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(binary_sensor.BinarySensor),
|
||||
cv.Optional(CONF_ICON, default=ICON_PV_AES_ACTIVE): cv.icon,
|
||||
}
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
@@ -36,6 +36,7 @@ CONF_BATTERY_NOMINAL_CAPACITY = "battery_nominal_capacity"
|
||||
CONF_PV_VOLTAGE = "pv_voltage"
|
||||
CONF_PV_CURRENT = "pv_current"
|
||||
CONF_BATTERY_STATUS_BITMASK = "battery_status_bitmask"
|
||||
CONF_PV_BATTERY_STATUS_BITMASK = "pv_battery_status_bitmask"
|
||||
CONF_CHARGING_CONTROLLER_STATUS_BITMASK = "charging_controller_status_bitmask"
|
||||
CONF_PV_CONTROLLER_STATUS_BITMASK = "pv_controller_status_bitmask"
|
||||
CONF_CHARGED_CAPACITY = "charged_capacity"
|
||||
@@ -43,6 +44,7 @@ CONF_CHARGED_ENERGY = "charged_energy"
|
||||
CONF_PV_POWER = "pv_power"
|
||||
CONF_CHARGING_MODE_SETTING_ID = "charging_mode_setting_id"
|
||||
CONF_CONTROLLER_TEMPERATURE = "controller_temperature"
|
||||
CONF_PV_CONTROLLER_TEMPERATURE = "pv_controller_temperature"
|
||||
|
||||
ICON_BATTERY_CAPACITY_REMAINING = "mdi:battery-50"
|
||||
ICON_STATE_OF_CHARGE = "mdi:battery-50"
|
||||
@@ -50,6 +52,7 @@ ICON_CURRENT_DC = "mdi:current-dc"
|
||||
ICON_BATTERY_NOMINAL_CAPACITY = "mdi:battery"
|
||||
|
||||
ICON_BATTERY_STATUS_BITMASK = "mdi:alert-circle-outline"
|
||||
ICON_PV_BATTERY_STATUS_BITMASK = "mdi:alert-circle-outline"
|
||||
ICON_CHARGING_CONTROLLER_STATUS_BITMASK = "mdi:alert-circle-outline"
|
||||
ICON_PV_CONTROLLER_STATUS_BITMASK = "mdi:alert-circle-outline"
|
||||
ICON_CHARGING_MODE_SETTING_ID = "mdi:car-battery"
|
||||
@@ -68,10 +71,12 @@ SENSORS = [
|
||||
CONF_PV_CURRENT,
|
||||
CONF_PV_POWER,
|
||||
CONF_BATTERY_STATUS_BITMASK,
|
||||
CONF_PV_BATTERY_STATUS_BITMASK,
|
||||
CONF_CHARGING_CONTROLLER_STATUS_BITMASK,
|
||||
CONF_PV_CONTROLLER_STATUS_BITMASK,
|
||||
CONF_CHARGING_MODE_SETTING_ID,
|
||||
CONF_CONTROLLER_TEMPERATURE,
|
||||
CONF_PV_CONTROLLER_TEMPERATURE,
|
||||
]
|
||||
|
||||
CONFIG_SCHEMA = cv.Schema(
|
||||
@@ -155,6 +160,14 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
cv.Optional(CONF_PV_BATTERY_STATUS_BITMASK): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_EMPTY,
|
||||
icon=ICON_PV_BATTERY_STATUS_BITMASK,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_EMPTY,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
cv.Optional(CONF_CHARGING_CONTROLLER_STATUS_BITMASK): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_EMPTY,
|
||||
icon=ICON_CHARGING_CONTROLLER_STATUS_BITMASK,
|
||||
@@ -187,6 +200,14 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
cv.Optional(CONF_PV_CONTROLLER_TEMPERATURE): sensor.sensor_schema(
|
||||
unit_of_measurement=UNIT_CELSIUS,
|
||||
icon=ICON_EMPTY,
|
||||
accuracy_decimals=0,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
state_class=STATE_CLASS_MEASUREMENT,
|
||||
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
|
@@ -10,17 +10,20 @@ DEPENDENCIES = ["votronic"]
|
||||
CODEOWNERS = ["@syssi"]
|
||||
|
||||
CONF_BATTERY_STATUS = "battery_status"
|
||||
CONF_PV_BATTERY_STATUS = "pv_battery_status"
|
||||
CONF_CHARGING_CONTROLLER_STATUS = "charging_controller_status"
|
||||
CONF_PV_CONTROLLER_STATUS = "pv_controller_status"
|
||||
CONF_CHARGING_MODE_SETTING = "charging_mode_setting"
|
||||
|
||||
ICON_BATTERY_STATUS = "mdi:alert-circle-outline"
|
||||
ICON_PV_BATTERY_STATUS = "mdi:alert-circle-outline"
|
||||
ICON_CHARGING_CONTROLLER_STATUS = "mdi:heart-pulse"
|
||||
ICON_PV_CONTROLLER_STATUS = "mdi:heart-pulse"
|
||||
ICON_CHARGING_MODE_SETTING = "mdi:car-battery"
|
||||
|
||||
TEXT_SENSORS = [
|
||||
CONF_BATTERY_STATUS,
|
||||
CONF_PV_BATTERY_STATUS,
|
||||
CONF_CHARGING_CONTROLLER_STATUS,
|
||||
CONF_PV_CONTROLLER_STATUS,
|
||||
CONF_CHARGING_MODE_SETTING,
|
||||
@@ -35,6 +38,12 @@ CONFIG_SCHEMA = cv.Schema(
|
||||
cv.Optional(CONF_ICON, default=ICON_BATTERY_STATUS): cv.icon,
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_PV_BATTERY_STATUS): text_sensor.TEXT_SENSOR_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(text_sensor.TextSensor),
|
||||
cv.Optional(CONF_ICON, default=ICON_PV_BATTERY_STATUS): cv.icon,
|
||||
}
|
||||
),
|
||||
cv.Optional(
|
||||
CONF_CHARGING_CONTROLLER_STATUS
|
||||
): text_sensor.TEXT_SENSOR_SCHEMA.extend(
|
||||
|
@@ -189,20 +189,20 @@ void Votronic::decode_solar_charger_data_(const std::vector<uint8_t> &data) {
|
||||
// 9 1 0x00 Reserved
|
||||
// 10 1 0xA0 Reserved
|
||||
// 11 1 0x15 Reserved
|
||||
this->publish_state_(this->controller_temperature_sensor_, (float) data[11]);
|
||||
this->publish_state_(this->pv_controller_temperature_sensor_, (float) data[11]);
|
||||
// 12 1 0x03 Charging mode setting (dip switches)
|
||||
this->publish_state_(this->charging_mode_setting_id_sensor_, data[12]);
|
||||
this->publish_state_(this->charging_mode_setting_text_sensor_, this->charging_mode_setting_to_string_(data[12]));
|
||||
// 13 1 0x00 Battery Controller Status Bitmask
|
||||
this->publish_state_(this->battery_status_bitmask_sensor_, data[13]);
|
||||
this->publish_state_(this->battery_status_text_sensor_, this->battery_status_bitmask_to_string_(data[13]));
|
||||
this->publish_state_(this->pv_battery_status_bitmask_sensor_, data[13]);
|
||||
this->publish_state_(this->pv_battery_status_text_sensor_, this->battery_status_bitmask_to_string_(data[13]));
|
||||
// 14 1 0x00 PV Controller Status Bitmask
|
||||
this->publish_state_(this->pv_controller_status_bitmask_sensor_, data[14]);
|
||||
this->publish_state_(this->pv_controller_status_text_sensor_,
|
||||
this->solar_charger_status_bitmask_to_string_(data[14]));
|
||||
this->publish_state_(this->controller_active_binary_sensor_, (data[14] & (1 << 3)));
|
||||
this->publish_state_(this->current_reduction_binary_sensor_, (data[14] & (1 << 4)));
|
||||
this->publish_state_(this->aes_active_binary_sensor_, (data[14] & (1 << 5)));
|
||||
this->publish_state_(this->pv_controller_active_binary_sensor_, (data[14] & (1 << 3)));
|
||||
this->publish_state_(this->pv_current_reduction_binary_sensor_, (data[14] & (1 << 4)));
|
||||
this->publish_state_(this->pv_aes_active_binary_sensor_, (data[14] & (1 << 5)));
|
||||
}
|
||||
|
||||
void Votronic::decode_charger_data_(const uint8_t &frame_type, const std::vector<uint8_t> &data) {
|
||||
@@ -406,6 +406,9 @@ void Votronic::dump_config() {
|
||||
LOG_BINARY_SENSOR("", "Controller active", this->controller_active_binary_sensor_);
|
||||
LOG_BINARY_SENSOR("", "Current reduction", this->current_reduction_binary_sensor_);
|
||||
LOG_BINARY_SENSOR("", "AES active", this->aes_active_binary_sensor_);
|
||||
LOG_BINARY_SENSOR("", "PV controller active", this->pv_controller_active_binary_sensor_);
|
||||
LOG_BINARY_SENSOR("", "PV current reduction", this->pv_current_reduction_binary_sensor_);
|
||||
LOG_BINARY_SENSOR("", "PV AES active", this->pv_aes_active_binary_sensor_);
|
||||
|
||||
LOG_SENSOR("", "Battery voltage", this->battery_voltage_sensor_);
|
||||
LOG_SENSOR("", "Secondary battery voltage", this->secondary_battery_voltage_sensor_);
|
||||
@@ -418,12 +421,15 @@ void Votronic::dump_config() {
|
||||
LOG_SENSOR("", "PV current", this->pv_current_sensor_);
|
||||
LOG_SENSOR("", "PV power", this->pv_power_sensor_);
|
||||
LOG_SENSOR("", "Battery status bitmask", this->battery_status_bitmask_sensor_);
|
||||
LOG_SENSOR("", "PV battery status bitmask", this->pv_battery_status_bitmask_sensor_);
|
||||
LOG_SENSOR("", "Charging Controller status bitmask", this->charging_controller_status_bitmask_sensor_);
|
||||
LOG_SENSOR("", "PV Controller status bitmask", this->pv_controller_status_bitmask_sensor_);
|
||||
LOG_SENSOR("", "Charging mode setting ID", this->charging_mode_setting_id_sensor_);
|
||||
LOG_SENSOR("", "Controller Temperature", this->controller_temperature_sensor_);
|
||||
LOG_SENSOR("", "Controller temperature", this->controller_temperature_sensor_);
|
||||
LOG_SENSOR("", "PV controller temperature", this->pv_controller_temperature_sensor_);
|
||||
|
||||
LOG_TEXT_SENSOR("", "Battery status", this->battery_status_text_sensor_);
|
||||
LOG_TEXT_SENSOR("", "PV battery status", this->pv_battery_status_text_sensor_);
|
||||
LOG_TEXT_SENSOR("", "Charging controller status", this->charging_controller_status_text_sensor_);
|
||||
LOG_TEXT_SENSOR("", "PV controller status", this->pv_controller_status_text_sensor_);
|
||||
LOG_TEXT_SENSOR("", "Charging mode setting", this->charging_mode_setting_text_sensor_);
|
||||
|
@@ -31,6 +31,15 @@ class Votronic : public uart::UARTDevice, public PollingComponent {
|
||||
void set_current_reduction_binary_sensor(binary_sensor::BinarySensor *current_reduction_binary_sensor) {
|
||||
current_reduction_binary_sensor_ = current_reduction_binary_sensor;
|
||||
}
|
||||
void set_pv_controller_active_binary_sensor(binary_sensor::BinarySensor *pv_controller_active_binary_sensor) {
|
||||
pv_controller_active_binary_sensor_ = pv_controller_active_binary_sensor;
|
||||
}
|
||||
void set_pv_aes_active_binary_sensor(binary_sensor::BinarySensor *pv_aes_active_binary_sensor) {
|
||||
pv_aes_active_binary_sensor_ = pv_aes_active_binary_sensor;
|
||||
}
|
||||
void set_pv_current_reduction_binary_sensor(binary_sensor::BinarySensor *pv_current_reduction_binary_sensor) {
|
||||
pv_current_reduction_binary_sensor_ = pv_current_reduction_binary_sensor;
|
||||
}
|
||||
|
||||
void set_battery_voltage_sensor(sensor::Sensor *battery_voltage_sensor) {
|
||||
battery_voltage_sensor_ = battery_voltage_sensor;
|
||||
@@ -49,6 +58,9 @@ class Votronic : public uart::UARTDevice, public PollingComponent {
|
||||
void set_battery_status_bitmask_sensor(sensor::Sensor *battery_status_bitmask_sensor) {
|
||||
battery_status_bitmask_sensor_ = battery_status_bitmask_sensor;
|
||||
}
|
||||
void set_pv_battery_status_bitmask_sensor(sensor::Sensor *pv_battery_status_bitmask_sensor) {
|
||||
pv_battery_status_bitmask_sensor_ = pv_battery_status_bitmask_sensor;
|
||||
}
|
||||
void set_charging_controller_status_bitmask_sensor(sensor::Sensor *charging_controller_status_bitmask_sensor) {
|
||||
charging_controller_status_bitmask_sensor_ = charging_controller_status_bitmask_sensor;
|
||||
}
|
||||
@@ -61,6 +73,9 @@ class Votronic : public uart::UARTDevice, public PollingComponent {
|
||||
void set_controller_temperature_sensor(sensor::Sensor *controller_temperature_sensor) {
|
||||
controller_temperature_sensor_ = controller_temperature_sensor;
|
||||
}
|
||||
void set_pv_controller_temperature_sensor(sensor::Sensor *pv_controller_temperature_sensor) {
|
||||
pv_controller_temperature_sensor_ = pv_controller_temperature_sensor;
|
||||
}
|
||||
void set_battery_capacity_remaining_sensor(sensor::Sensor *battery_capacity_remaining_sensor) {
|
||||
battery_capacity_remaining_sensor_ = battery_capacity_remaining_sensor;
|
||||
}
|
||||
@@ -71,6 +86,9 @@ class Votronic : public uart::UARTDevice, public PollingComponent {
|
||||
void set_battery_status_text_sensor(text_sensor::TextSensor *battery_status_text_sensor) {
|
||||
battery_status_text_sensor_ = battery_status_text_sensor;
|
||||
}
|
||||
void set_pv_battery_status_text_sensor(text_sensor::TextSensor *pv_battery_status_text_sensor) {
|
||||
pv_battery_status_text_sensor_ = pv_battery_status_text_sensor;
|
||||
}
|
||||
void set_charging_controller_status_text_sensor(text_sensor::TextSensor *charging_controller_status_text_sensor) {
|
||||
charging_controller_status_text_sensor_ = charging_controller_status_text_sensor;
|
||||
}
|
||||
@@ -91,6 +109,9 @@ class Votronic : public uart::UARTDevice, public PollingComponent {
|
||||
binary_sensor::BinarySensor *controller_active_binary_sensor_;
|
||||
binary_sensor::BinarySensor *aes_active_binary_sensor_;
|
||||
binary_sensor::BinarySensor *current_reduction_binary_sensor_;
|
||||
binary_sensor::BinarySensor *pv_controller_active_binary_sensor_;
|
||||
binary_sensor::BinarySensor *pv_aes_active_binary_sensor_;
|
||||
binary_sensor::BinarySensor *pv_current_reduction_binary_sensor_;
|
||||
|
||||
sensor::Sensor *battery_voltage_sensor_;
|
||||
sensor::Sensor *secondary_battery_voltage_sensor_;
|
||||
@@ -101,14 +122,17 @@ class Votronic : public uart::UARTDevice, public PollingComponent {
|
||||
sensor::Sensor *pv_current_sensor_;
|
||||
sensor::Sensor *pv_power_sensor_;
|
||||
sensor::Sensor *battery_status_bitmask_sensor_;
|
||||
sensor::Sensor *pv_battery_status_bitmask_sensor_;
|
||||
sensor::Sensor *charging_controller_status_bitmask_sensor_;
|
||||
sensor::Sensor *pv_controller_status_bitmask_sensor_;
|
||||
sensor::Sensor *charging_mode_setting_id_sensor_;
|
||||
sensor::Sensor *controller_temperature_sensor_;
|
||||
sensor::Sensor *pv_controller_temperature_sensor_;
|
||||
sensor::Sensor *battery_capacity_remaining_sensor_;
|
||||
sensor::Sensor *battery_nominal_capacity_sensor_;
|
||||
|
||||
text_sensor::TextSensor *battery_status_text_sensor_;
|
||||
text_sensor::TextSensor *pv_battery_status_text_sensor_;
|
||||
text_sensor::TextSensor *charging_controller_status_text_sensor_;
|
||||
text_sensor::TextSensor *pv_controller_status_text_sensor_;
|
||||
text_sensor::TextSensor *charging_mode_setting_text_sensor_;
|
||||
|
@@ -9,7 +9,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp32:
|
||||
board: wemos_d1_mini32
|
||||
|
@@ -7,7 +7,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp32:
|
||||
board: wemos_d1_mini32
|
||||
|
@@ -11,7 +11,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
@@ -11,7 +11,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
@@ -11,7 +11,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
@@ -11,7 +11,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
@@ -58,12 +58,12 @@ binary_sensor:
|
||||
name: "${name} charging"
|
||||
discharging:
|
||||
name: "${name} discharging"
|
||||
controller_active:
|
||||
name: "${name} controller active"
|
||||
current_reduction:
|
||||
name: "${name} current reduction"
|
||||
aes_active:
|
||||
name: "${name} aes active"
|
||||
pv_controller_active:
|
||||
name: "${name} pv controller active"
|
||||
pv_current_reduction:
|
||||
name: "${name} pv current reduction"
|
||||
pv_aes_active:
|
||||
name: "${name} pv aes active"
|
||||
|
||||
sensor:
|
||||
- platform: votronic
|
||||
@@ -76,12 +76,12 @@ sensor:
|
||||
name: "${name} pv current"
|
||||
pv_power:
|
||||
name: "${name} pv power"
|
||||
controller_temperature:
|
||||
name: "${name} controller temperature"
|
||||
pv_controller_temperature:
|
||||
name: "${name} pv controller temperature"
|
||||
charging_mode_setting_id:
|
||||
name: "${name} charging mode setting id"
|
||||
battery_status_bitmask:
|
||||
name: "${name} battery status bitmask"
|
||||
pv_battery_status_bitmask:
|
||||
name: "${name} pv battery status bitmask"
|
||||
pv_controller_status_bitmask:
|
||||
name: "${name} pv controller status bitmask"
|
||||
|
||||
@@ -90,7 +90,7 @@ text_sensor:
|
||||
votronic_id: votronic0
|
||||
charging_mode_setting:
|
||||
name: "${name} charging mode setting"
|
||||
battery_status:
|
||||
name: "${name} battery status"
|
||||
pv_battery_status:
|
||||
name: "${name} pv battery status"
|
||||
pv_controller_status:
|
||||
name: "${name} pv controller status"
|
||||
|
27
esp8266-triple-charger-example-debug.yaml
Normal file
27
esp8266-triple-charger-example-debug.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
<<: !include esp8266-solar-charger-example.yaml
|
||||
|
||||
logger:
|
||||
level: VERY_VERBOSE
|
||||
logs:
|
||||
votronic: VERY_VERBOSE
|
||||
component: DEBUG
|
||||
scheduler: INFO
|
||||
binary_sensor: DEBUG
|
||||
sensor: DEBUG
|
||||
text_sensor: DEBUG
|
||||
mqtt: INFO
|
||||
mqtt.idf: INFO
|
||||
mqtt.component: INFO
|
||||
mqtt.sensor: INFO
|
||||
mqtt.switch: INFO
|
||||
api.service: INFO
|
||||
api: INFO
|
||||
|
||||
uart:
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
debug:
|
||||
direction: BOTH
|
||||
dummy_receiver: false
|
32
esp8266-triple-charger-example-faker.yaml
Normal file
32
esp8266-triple-charger-example-faker.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
<<: !include esp8266-solar-charger-example-debug.yaml
|
||||
|
||||
interval:
|
||||
- interval: 6s
|
||||
then:
|
||||
- lambda: |-
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x1A, 0x2F, 0x05, 0xC1, 0x06, 0x00, 0x00, 0x00, 0xE0, 0xA5, 0x18, 0x56, 0x20, 0x01, 0xDD
|
||||
});
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4A
|
||||
});
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x3A, 0x2E, 0x05, 0xD5, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0xA3, 0x56, 0x28, 0x00, 0x1C
|
||||
});
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x7A, 0x2E, 0x05, 0xD5, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA3, 0x56, 0x28, 0x00, 0x5D
|
||||
});
|
||||
- delay: 2s
|
||||
- lambda: |-
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x1A, 0x2F, 0x05, 0xBF, 0x06, 0x00, 0x00, 0x00, 0xE0, 0xA2, 0x19, 0x56, 0x20, 0x01, 0xA5
|
||||
});
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4A
|
||||
});
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x3A, 0x2F, 0x05, 0xD5, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0xA2, 0x56, 0x28, 0x00, 0x1C
|
||||
});
|
||||
id(votronic0).on_votronic_data({
|
||||
0xAA, 0x7A, 0x2F, 0x05, 0xD5, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2, 0x56, 0x28, 0x00, 0x5D
|
||||
});
|
108
esp8266-triple-charger-example.yaml
Normal file
108
esp8266-triple-charger-example.yaml
Normal file
@@ -0,0 +1,108 @@
|
||||
substitutions:
|
||||
name: votronic-solar-charger
|
||||
device_description: "Monitor a Votronic Solar Charger via the display link port (UART)"
|
||||
external_components_source: github://syssi/esphome-votronic@main
|
||||
tx_pin: GPIO4
|
||||
rx_pin: GPIO5
|
||||
rx_timeout: 150ms
|
||||
|
||||
esphome:
|
||||
name: ${name}
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
||||
external_components:
|
||||
- source: ${external_components_source}
|
||||
refresh: 0s
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
ota:
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
# If you use Home Assistant please remove this `mqtt` section and uncomment the `api` component!
|
||||
# The native API has many advantages over MQTT: https://esphome.io/components/api.html#advantages-over-mqtt
|
||||
mqtt:
|
||||
broker: !secret mqtt_host
|
||||
username: !secret mqtt_username
|
||||
password: !secret mqtt_password
|
||||
id: mqtt_client
|
||||
|
||||
# api:
|
||||
|
||||
uart:
|
||||
- id: uart_0
|
||||
baud_rate: 1000
|
||||
tx_pin: ${tx_pin}
|
||||
rx_pin: ${rx_pin}
|
||||
|
||||
votronic:
|
||||
- id: votronic0
|
||||
uart_id: uart_0
|
||||
rx_timeout: ${rx_timeout}
|
||||
throttle: 2s
|
||||
|
||||
binary_sensor:
|
||||
- platform: votronic
|
||||
votronic_id: votronic0
|
||||
charging:
|
||||
name: "${name} charging"
|
||||
discharging:
|
||||
name: "${name} discharging"
|
||||
controller_active:
|
||||
name: "${name} controller active"
|
||||
current_reduction:
|
||||
name: "${name} current reduction"
|
||||
aes_active:
|
||||
name: "${name} aes active"
|
||||
pv_controller_active:
|
||||
name: "${name} pv controller active"
|
||||
pv_current_reduction:
|
||||
name: "${name} pv current reduction"
|
||||
pv_aes_active:
|
||||
name: "${name} pv aes active"
|
||||
|
||||
sensor:
|
||||
- platform: votronic
|
||||
votronic_id: votronic0
|
||||
battery_voltage:
|
||||
name: "${name} battery voltage"
|
||||
pv_voltage:
|
||||
name: "${name} pv voltage"
|
||||
pv_current:
|
||||
name: "${name} pv current"
|
||||
pv_power:
|
||||
name: "${name} pv power"
|
||||
controller_temperature:
|
||||
name: "${name} controller temperature"
|
||||
charging_mode_setting_id:
|
||||
name: "${name} charging mode setting id"
|
||||
battery_status_bitmask:
|
||||
name: "${name} battery status bitmask"
|
||||
pv_controller_status_bitmask:
|
||||
name: "${name} pv controller status bitmask"
|
||||
pv_controller_temperature:
|
||||
name: "${name} pv controller temperature"
|
||||
pv_battery_status_bitmask:
|
||||
name: "${name} pv battery status bitmask"
|
||||
|
||||
text_sensor:
|
||||
- platform: votronic
|
||||
votronic_id: votronic0
|
||||
charging_mode_setting:
|
||||
name: "${name} charging mode setting"
|
||||
battery_status:
|
||||
name: "${name} battery status"
|
||||
pv_controller_status:
|
||||
name: "${name} pv controller status"
|
||||
pv_battery_status:
|
||||
name: "${name} pv battery status"
|
@@ -12,7 +12,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
@@ -9,7 +9,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
@@ -9,7 +9,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
@@ -9,7 +9,7 @@ esphome:
|
||||
comment: ${device_description}
|
||||
project:
|
||||
name: "syssi.esphome-votronic"
|
||||
version: 2.0.0
|
||||
version: 3.0.0
|
||||
|
||||
esp8266:
|
||||
board: d1_mini
|
||||
|
Reference in New Issue
Block a user