From 0f8dbc34c3c934125df07ab433f6b4ae96e73900 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sun, 5 Feb 2023 16:36:56 +0100 Subject: [PATCH] BREAKING: Rename `operation_mode` to `operation_status` (Closes: #47) (#100) --- README.md | 8 ++-- components/soyosource_inverter/sensor.py | 10 ++--- .../soyosource_inverter.cpp | 26 ++++++------- .../soyosource_inverter/soyosource_inverter.h | 12 +++--- components/soyosource_inverter/text_sensor.py | 10 ++--- .../soyosource_virtual_meter/__init__.py | 12 +++--- .../soyosource_virtual_meter.cpp | 4 +- .../soyosource_virtual_meter.h | 6 +-- esp32-example.yaml | 20 +++++----- esp32-multiple-uarts-example.yaml | 38 +++++++++---------- esp8266-display-example.yaml | 10 ++--- esp8266-example.yaml | 20 +++++----- esp8266-wifi-dongle-example-web-only.yaml | 2 +- esp8266-wifi-dongle-example.yaml | 2 +- esp8266-wifi-dongle-limiter-example.yaml | 10 ++--- lovelace-entities-card.yaml | 17 --------- tests/esp8266-fake-display.yaml | 2 +- tests/esp8266-inverter-emulator.yaml | 2 +- 18 files changed, 98 insertions(+), 113 deletions(-) delete mode 100644 lovelace-entities-card.yaml diff --git a/README.md b/README.md index 8b7f170..08e6dac 100644 --- a/README.md +++ b/README.md @@ -146,8 +146,8 @@ sensor: name: "${name} power demand" - platform: soyosource_inverter - operation_mode_id: - name: "${name} operation mode id" + operation_status_id: + name: "${name} operation status id" battery_voltage: name: "${name} battery voltage" battery_current: @@ -180,8 +180,8 @@ sensor: text_sensor: - platform: soyosource_inverter - operation_mode: - name: "${name} operation mode" + operation_status: + name: "${name} operation status" ``` For a more advanced setup take a look at the [esp32-multiple-uarts-example.yaml](esp32-multiple-uarts-example.yaml). diff --git a/components/soyosource_inverter/sensor.py b/components/soyosource_inverter/sensor.py index c5075c7..cd77474 100644 --- a/components/soyosource_inverter/sensor.py +++ b/components/soyosource_inverter/sensor.py @@ -30,9 +30,9 @@ CONF_BATTERY_POWER = "battery_power" CONF_AC_VOLTAGE = "ac_voltage" CONF_AC_FREQUENCY = "ac_frequency" -CONF_OPERATION_MODE_ID = "operation_mode_id" +CONF_OPERATION_STATUS_ID = "operation_status_id" -ICON_OPERATION_MODE = "mdi:heart-pulse" +ICON_OPERATION_STATUS = "mdi:heart-pulse" SENSORS = [ CONF_BATTERY_VOLTAGE, @@ -41,16 +41,16 @@ CONF_AC_VOLTAGE, CONF_AC_FREQUENCY, CONF_TEMPERATURE, - CONF_OPERATION_MODE_ID, + CONF_OPERATION_STATUS_ID, ] # pylint: disable=too-many-function-args CONFIG_SCHEMA = cv.Schema( { cv.GenerateID(CONF_SOYOSOURCE_INVERTER_ID): cv.use_id(SoyosourceInverter), - cv.Optional(CONF_OPERATION_MODE_ID): sensor.sensor_schema( + cv.Optional(CONF_OPERATION_STATUS_ID): sensor.sensor_schema( unit_of_measurement=UNIT_EMPTY, - icon=ICON_OPERATION_MODE, + icon=ICON_OPERATION_STATUS, accuracy_decimals=0, device_class=DEVICE_CLASS_EMPTY, state_class=STATE_CLASS_MEASUREMENT, diff --git a/components/soyosource_inverter/soyosource_inverter.cpp b/components/soyosource_inverter/soyosource_inverter.cpp index 66bea0c..3c95748 100644 --- a/components/soyosource_inverter/soyosource_inverter.cpp +++ b/components/soyosource_inverter/soyosource_inverter.cpp @@ -6,8 +6,8 @@ namespace soyosource_inverter { static const char *const TAG = "soyosource_inverter"; -static const uint8_t OPERATION_MODES_SIZE = 13; -static const char *const OPERATION_MODES[OPERATION_MODES_SIZE] = { +static const uint8_t OPERATION_STATUS_SIZE = 13; +static const char *const OPERATION_STATUS[OPERATION_STATUS_SIZE] = { "Normal", // 0x00 "Startup", // 0x01 "Standby", // 0x02 @@ -35,8 +35,8 @@ void SoyosourceInverter::on_soyosource_modbus_data(const std::vector &d return (uint16_t(data[i + 0]) << 8) | (uint16_t(data[i + 1]) << 0); }; - uint8_t raw_operation_mode = data[0]; - float operation_mode_id = (float) raw_operation_mode; + uint8_t raw_operation_status = data[0]; + float operation_status_id = (float) raw_operation_status; uint16_t raw_battery_voltage = soyosource_get_16bit(1); float battery_voltage = raw_battery_voltage * 0.1f; @@ -69,14 +69,14 @@ void SoyosourceInverter::on_soyosource_modbus_data(const std::vector &d // Data bytes: 0 1 2 3 4 5 6 7 8 9 CRC // // - // Data byte 0: 0x04 (Operation mode) 0x00 (Normal), 0x01 (Startup), 0x02 (Standby), + // Data byte 0: 0x04 (Operation status) 0x00 (Normal), 0x01 (Startup), 0x02 (Standby), // 0x03 (Startup aborted?), 0x04 (Error or battery mode?) // Data byte 1...2: 0x01 0xDB (Battery voltage) // Data byte 3...4: 0x00 0xA1 (Battery current) // Data byte 5...6: 0x00 0xDD (AC voltage) // Data byte 7: 0x64 (AC frequency / 2) // Data byte 8...9: 0x02 0xCA (Temperature / 10.0 + 2 * 10) - this->publish_state_(this->operation_mode_id_sensor_, operation_mode_id); + this->publish_state_(this->operation_status_id_sensor_, operation_status_id); this->publish_state_(this->battery_voltage_sensor_, battery_voltage); this->publish_state_(this->battery_current_sensor_, battery_current); this->publish_state_(this->battery_power_sensor_, battery_power); @@ -85,17 +85,17 @@ void SoyosourceInverter::on_soyosource_modbus_data(const std::vector &d this->publish_state_(this->temperature_sensor_, temperature); this->publish_state_(this->fan_running_binary_sensor_, (bool) (temperature >= 45.0)); - if (raw_operation_mode < OPERATION_MODES_SIZE) { - this->publish_state_(this->operation_mode_text_sensor_, OPERATION_MODES[raw_operation_mode]); + if (raw_operation_status < OPERATION_STATUS_SIZE) { + this->publish_state_(this->operation_status_text_sensor_, OPERATION_STATUS[raw_operation_status]); } else { - this->publish_state_(this->operation_mode_text_sensor_, "Unknown"); + this->publish_state_(this->operation_status_text_sensor_, "Unknown"); } this->no_response_count_ = 0; } void SoyosourceInverter::publish_device_offline_() { - this->publish_state_(this->operation_mode_id_sensor_, -1); + this->publish_state_(this->operation_status_id_sensor_, -1); this->publish_state_(this->battery_voltage_sensor_, NAN); this->publish_state_(this->battery_current_sensor_, NAN); this->publish_state_(this->battery_power_sensor_, NAN); @@ -104,7 +104,7 @@ void SoyosourceInverter::publish_device_offline_() { this->publish_state_(this->temperature_sensor_, NAN); // this->publish_state_(this->fan_running_binary_sensor_, NAN); - this->publish_state_(this->operation_mode_text_sensor_, "Offline"); + this->publish_state_(this->operation_status_text_sensor_, "Offline"); } void SoyosourceInverter::update() { @@ -143,8 +143,8 @@ void SoyosourceInverter::publish_state_(text_sensor::TextSensor *text_sensor, co void SoyosourceInverter::dump_config() { ESP_LOGCONFIG(TAG, "SoyosourceInverter:"); ESP_LOGCONFIG(TAG, " Address: 0x%02X", this->address_); - LOG_SENSOR("", "Operation Mode ID", this->operation_mode_id_sensor_); - LOG_TEXT_SENSOR("", "Operation Mode", this->operation_mode_text_sensor_); + LOG_SENSOR("", "Operation Status ID", this->operation_status_id_sensor_); + LOG_TEXT_SENSOR("", "Operation Status", this->operation_status_text_sensor_); LOG_SENSOR("", "Battery Voltage", this->battery_voltage_sensor_); LOG_SENSOR("", "Battery Current", this->battery_current_sensor_); LOG_SENSOR("", "Battery Power", this->battery_power_sensor_); diff --git a/components/soyosource_inverter/soyosource_inverter.h b/components/soyosource_inverter/soyosource_inverter.h index 0030874..0a98c68 100644 --- a/components/soyosource_inverter/soyosource_inverter.h +++ b/components/soyosource_inverter/soyosource_inverter.h @@ -17,8 +17,8 @@ class SoyosourceInverter : public PollingComponent, public soyosource_modbus::So fan_running_binary_sensor_ = fan_running_binary_sensor; } - void set_operation_mode_id_sensor(sensor::Sensor *operation_mode_id_sensor) { - operation_mode_id_sensor_ = operation_mode_id_sensor; + void set_operation_status_id_sensor(sensor::Sensor *operation_status_id_sensor) { + operation_status_id_sensor_ = operation_status_id_sensor; } void set_battery_voltage_sensor(sensor::Sensor *battery_voltage_sensor) { battery_voltage_sensor_ = battery_voltage_sensor; @@ -31,8 +31,8 @@ class SoyosourceInverter : public PollingComponent, public soyosource_modbus::So void set_ac_frequency_sensor(sensor::Sensor *ac_frequency_sensor) { ac_frequency_sensor_ = ac_frequency_sensor; } void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; } - void set_operation_mode_text_sensor(text_sensor::TextSensor *operation_mode_text_sensor) { - operation_mode_text_sensor_ = operation_mode_text_sensor; + void set_operation_status_text_sensor(text_sensor::TextSensor *operation_status_text_sensor) { + operation_status_text_sensor_ = operation_status_text_sensor; } void update() override; @@ -44,7 +44,7 @@ class SoyosourceInverter : public PollingComponent, public soyosource_modbus::So protected: binary_sensor::BinarySensor *fan_running_binary_sensor_; - sensor::Sensor *operation_mode_id_sensor_; + sensor::Sensor *operation_status_id_sensor_; sensor::Sensor *battery_voltage_sensor_; sensor::Sensor *battery_current_sensor_; sensor::Sensor *battery_power_sensor_; @@ -52,7 +52,7 @@ class SoyosourceInverter : public PollingComponent, public soyosource_modbus::So sensor::Sensor *ac_frequency_sensor_; sensor::Sensor *temperature_sensor_; - text_sensor::TextSensor *operation_mode_text_sensor_; + text_sensor::TextSensor *operation_status_text_sensor_; uint8_t no_response_count_ = 0; diff --git a/components/soyosource_inverter/text_sensor.py b/components/soyosource_inverter/text_sensor.py index 1384d6d..5f0cbba 100644 --- a/components/soyosource_inverter/text_sensor.py +++ b/components/soyosource_inverter/text_sensor.py @@ -8,21 +8,21 @@ CODEOWNERS = ["@syssi"] -CONF_OPERATION_MODE = "operation_mode" +CONF_OPERATION_STATUS = "operation_status" -ICON_OPERATION_MODE = "mdi:heart-pulse" +ICON_OPERATION_STATUS = "mdi:heart-pulse" TEXT_SENSORS = [ - CONF_OPERATION_MODE, + CONF_OPERATION_STATUS, ] CONFIG_SCHEMA = cv.Schema( { cv.GenerateID(CONF_SOYOSOURCE_INVERTER_ID): cv.use_id(SoyosourceInverter), - cv.Optional(CONF_OPERATION_MODE): text_sensor.TEXT_SENSOR_SCHEMA.extend( + cv.Optional(CONF_OPERATION_STATUS): text_sensor.TEXT_SENSOR_SCHEMA.extend( { cv.GenerateID(): cv.declare_id(text_sensor.TextSensor), - cv.Optional(CONF_ICON, default=ICON_OPERATION_MODE): cv.icon, + cv.Optional(CONF_ICON, default=ICON_OPERATION_STATUS): cv.icon, } ), } diff --git a/components/soyosource_virtual_meter/__init__.py b/components/soyosource_virtual_meter/__init__.py index c11df90..0511877 100644 --- a/components/soyosource_virtual_meter/__init__.py +++ b/components/soyosource_virtual_meter/__init__.py @@ -15,7 +15,7 @@ CONF_MAX_POWER_DEMAND = "max_power_demand" CONF_BUFFER = "buffer" CONF_POWER_DEMAND_DIVIDER = "power_demand_divider" -CONF_OPERATION_MODE_ID = "operation_mode_id" +CONF_OPERATION_STATUS_ID = "operation_status_id" DEFAULT_BUFFER = 0 DEFAULT_MIN_POWER_DEMAND = 0 @@ -56,7 +56,7 @@ def validate_min_max(config): CONF_POWER_DEMAND_CALCULATION, default="DUMB_OEM_BEHAVIOR" ): cv.enum(POWER_DEMAND_CALCULATION_OPTIONS, upper=True), cv.Required(CONF_POWER_ID): cv.use_id(sensor.Sensor), - cv.Optional(CONF_OPERATION_MODE_ID): cv.use_id(sensor.Sensor), + cv.Optional(CONF_OPERATION_STATUS_ID): cv.use_id(sensor.Sensor), cv.Optional( CONF_POWER_SENSOR_INACTIVITY_TIMEOUT, default="20s" ): cv.positive_time_period_seconds, @@ -99,6 +99,8 @@ async def to_code(config): ) cg.add(var.set_power_demand_calculation(config[CONF_POWER_DEMAND_CALCULATION])) - if CONF_OPERATION_MODE_ID in config: - operation_mode_sensor = await cg.get_variable(config[CONF_OPERATION_MODE_ID]) - cg.add(var.set_operation_mode_sensor(operation_mode_sensor)) + if CONF_OPERATION_STATUS_ID in config: + operation_status_sensor = await cg.get_variable( + config[CONF_OPERATION_STATUS_ID] + ) + cg.add(var.set_operation_status_sensor(operation_status_sensor)) diff --git a/components/soyosource_virtual_meter/soyosource_virtual_meter.cpp b/components/soyosource_virtual_meter/soyosource_virtual_meter.cpp index 7b65a75..aa7b5e1 100644 --- a/components/soyosource_virtual_meter/soyosource_virtual_meter.cpp +++ b/components/soyosource_virtual_meter/soyosource_virtual_meter.cpp @@ -53,8 +53,8 @@ void SoyosourceVirtualMeter::update() { } } - // Override power demand and operation mode if the operation mode of the inverter isn't "normal" (optional!) - if (this->operation_mode_sensor_ != nullptr && this->operation_mode_sensor_->state != 0x0) { + // Override power demand and operation mode if the operation status of the inverter isn't "normal" (optional!) + if (this->operation_status_sensor_ != nullptr && this->operation_status_sensor_->state != 0x0) { power_demand = 0; operation_mode = "Standby"; ESP_LOGD(TAG, "'%s': The operation mode of the inverter isn't 0x0 (normal). Suspending the limiter", diff --git a/components/soyosource_virtual_meter/soyosource_virtual_meter.h b/components/soyosource_virtual_meter/soyosource_virtual_meter.h index 744b8da..b93cd8d 100644 --- a/components/soyosource_virtual_meter/soyosource_virtual_meter.h +++ b/components/soyosource_virtual_meter/soyosource_virtual_meter.h @@ -19,8 +19,8 @@ enum PowerDemandCalculation { class SoyosourceVirtualMeter : public PollingComponent, public soyosource_modbus::SoyosourceModbusDevice { public: void set_power_sensor(sensor::Sensor *power_sensor) { power_sensor_ = power_sensor; } - void set_operation_mode_sensor(sensor::Sensor *operation_mode_sensor) { - operation_mode_sensor_ = operation_mode_sensor; + void set_operation_status_sensor(sensor::Sensor *operation_status_sensor) { + operation_status_sensor_ = operation_status_sensor; } void set_power_demand_sensor(sensor::Sensor *power_demand_sensor) { power_demand_sensor_ = power_demand_sensor; } void set_buffer(int16_t buffer) { this->buffer_ = buffer; } @@ -66,7 +66,7 @@ class SoyosourceVirtualMeter : public PollingComponent, public soyosource_modbus number::Number *max_power_demand_number_; sensor::Sensor *power_sensor_; - sensor::Sensor *operation_mode_sensor_; + sensor::Sensor *operation_status_sensor_; sensor::Sensor *power_demand_sensor_; switch_::Switch *manual_mode_switch_; diff --git a/esp32-example.yaml b/esp32-example.yaml index b5fb70f..2bddc57 100644 --- a/esp32-example.yaml +++ b/esp32-example.yaml @@ -10,7 +10,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp32: board: esp-wrover-kit @@ -71,9 +71,9 @@ soyosource_virtual_meter: # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts) # A negative buffer value (-10) exports power to the grid (demand + 10 watts) buffer: 10 - # The operation_mode_id sensor is expected here. Passing the operation_mode won't work - # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal) - # operation_mode_id: operation_mode_id0 + # The operation_status_id sensor is expected here. Passing the operation_status won't work + # The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal) + # operation_status_id: operation_status_id0 # The update interval is important and defaults to 3 seconds. If the demand is sent too frequently # or rarely the interverter stops. TODO: Identify and validate the lower and upper update limit @@ -109,9 +109,9 @@ sensor: - platform: soyosource_inverter soyosource_inverter_id: inverter0 - operation_mode_id: - name: "${name} operation mode id" - id: operation_mode_id0 + operation_status_id: + name: "${name} operation status id" + id: operation_status_id0 battery_voltage: name: "${name} battery voltage" battery_current: @@ -159,10 +159,10 @@ switch: text_sensor: - platform: soyosource_inverter soyosource_inverter_id: inverter0 - operation_mode: - name: "${name} operation mode" + operation_status: + name: "${name} operation status" - platform: soyosource_virtual_meter soyosource_virtual_meter_id: virtualmeter0 operation_mode: - name: "${name} operation mode" + name: "${name} limiter operation mode" diff --git a/esp32-multiple-uarts-example.yaml b/esp32-multiple-uarts-example.yaml index 55c5bd0..c7bc674 100644 --- a/esp32-multiple-uarts-example.yaml +++ b/esp32-multiple-uarts-example.yaml @@ -14,7 +14,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp32: board: esp-wrover-kit @@ -85,9 +85,9 @@ soyosource_virtual_meter: # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts) # A negative buffer value (-10) exports power to the grid (demand + 10 watts) buffer: 10 - # The operation_mode_id sensor is expected here. Passing the operation_mode won't work - # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal) - # operation_mode_id: operation_mode_id0 + # The operation_status_id sensor is expected here. Passing the operation_status won't work + # The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal) + # operation_status_id: operation_status_id0 - id: virtualmeter1 soyosource_modbus_id: modbus1 @@ -101,9 +101,9 @@ soyosource_virtual_meter: # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts) # A negative buffer value (-10) exports power to the grid (demand + 10 watts) buffer: 10 - # The operation_mode_id sensor is expected here. Passing the operation_mode won't work - # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal) - # operation_mode_id: operation_mode_id1 + # The operation_status_id sensor is expected here. Passing the operation_status won't work + # The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal) + # operation_status_id: operation_status_id1 binary_sensor: - platform: soyosource_inverter @@ -150,9 +150,9 @@ sensor: - platform: soyosource_inverter soyosource_inverter_id: inverter0 - operation_mode_id: - name: "${device0} operation mode id" - id: operation_mode_id0 + operation_status_id: + name: "${device0} operation status id" + id: operation_status_id0 battery_voltage: name: "${device0} battery voltage" battery_current: @@ -167,9 +167,9 @@ sensor: name: "${device0} temperature" - platform: soyosource_inverter soyosource_inverter_id: inverter1 - operation_mode_id: - name: "${device1} operation mode id" - id: operation_mode_id1 + operation_status_id: + name: "${device1} operation status id" + id: operation_status_id1 battery_voltage: name: "${device1} battery voltage" battery_current: @@ -231,18 +231,18 @@ switch: text_sensor: - platform: soyosource_inverter soyosource_inverter_id: inverter0 - operation_mode: - name: "${device0} operation mode" + operation_status: + name: "${device0} operation status" - platform: soyosource_inverter soyosource_inverter_id: inverter1 - operation_mode: - name: "${device1} operation mode" + operation_status: + name: "${device1} operation status" - platform: soyosource_virtual_meter soyosource_virtual_meter_id: virtualmeter0 operation_mode: - name: "${device0} operation mode" + name: "${device0} limiter operation mode" - platform: soyosource_virtual_meter soyosource_virtual_meter_id: virtualmeter1 operation_mode: - name: "${device1} operation mode" + name: "${device1} limiter operation mode" diff --git a/esp8266-display-example.yaml b/esp8266-display-example.yaml index d292472..0722d9e 100644 --- a/esp8266-display-example.yaml +++ b/esp8266-display-example.yaml @@ -12,7 +12,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: d1_mini @@ -72,9 +72,9 @@ soyosource_virtual_meter: # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts) # A negative buffer value (-10) exports power to the grid (demand + 10 watts) buffer: 10 - # The operation_mode_id sensor is expected here. Passing the operation_mode won't work - # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal) - operation_mode_id: operation_status_id0 + # The operation_status_id sensor is expected here. Passing the operation_status won't work + # The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal) + operation_status_id: operation_status_id0 # The update interval is important and defaults to 3 seconds. If the demand is sent too frequently # or rarely the interverter stops. TODO: Identify and validate the lower and upper update limit @@ -194,7 +194,7 @@ text_sensor: - platform: soyosource_virtual_meter soyosource_virtual_meter_id: virtualmeter0 operation_mode: - name: "${name} operation mode" + name: "${name} limiter operation mode" - platform: soyosource_display errors: diff --git a/esp8266-example.yaml b/esp8266-example.yaml index a33d01a..1d634e2 100644 --- a/esp8266-example.yaml +++ b/esp8266-example.yaml @@ -10,7 +10,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: d1_mini @@ -71,9 +71,9 @@ soyosource_virtual_meter: # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts) # A negative buffer value (-10) exports power to the grid (demand + 10 watts) buffer: 10 - # The operation_mode_id sensor is expected here. Passing the operation_mode won't work - # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal) - # operation_mode_id: operation_mode_id0 + # The operation_status_id sensor is expected here. Passing the operation_status won't work + # The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal) + # operation_status_id: operation_status_id0 # The update interval is important and defaults to 3 seconds. If the demand is sent too frequently # or rarely the interverter stops. TODO: Identify and validate the lower and upper update limit @@ -97,9 +97,9 @@ sensor: - platform: soyosource_inverter soyosource_inverter_id: inverter0 - operation_mode_id: - name: "${name} operation mode id" - id: operation_mode_id0 + operation_status_id: + name: "${name} operation status id" + id: operation_status_id0 battery_voltage: name: "${name} battery voltage" battery_current: @@ -160,9 +160,9 @@ text_sensor: - platform: soyosource_virtual_meter soyosource_virtual_meter_id: virtualmeter0 operation_mode: - name: "${name} operation mode" + name: "${name} limiter operation mode" - platform: soyosource_inverter soyosource_inverter_id: inverter0 - operation_mode: - name: "${name} operation mode" + operation_status: + name: "${name} operation status" diff --git a/esp8266-wifi-dongle-example-web-only.yaml b/esp8266-wifi-dongle-example-web-only.yaml index 33ca5f9..a5b5ff6 100644 --- a/esp8266-wifi-dongle-example-web-only.yaml +++ b/esp8266-wifi-dongle-example-web-only.yaml @@ -8,7 +8,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: esp12e diff --git a/esp8266-wifi-dongle-example.yaml b/esp8266-wifi-dongle-example.yaml index 4d6b756..0642144 100644 --- a/esp8266-wifi-dongle-example.yaml +++ b/esp8266-wifi-dongle-example.yaml @@ -8,7 +8,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: esp12e diff --git a/esp8266-wifi-dongle-limiter-example.yaml b/esp8266-wifi-dongle-limiter-example.yaml index 9e211cf..04cd2bc 100644 --- a/esp8266-wifi-dongle-limiter-example.yaml +++ b/esp8266-wifi-dongle-limiter-example.yaml @@ -10,7 +10,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: esp12e @@ -75,9 +75,9 @@ soyosource_virtual_meter: # A positive buffer value (10) tries to avoid exporting power to the grid (demand - 10 watts) # A negative buffer value (-10) exports power to the grid (demand + 10 watts) buffer: 10 - # The operation_mode_id sensor is expected here. Passing the operation_mode won't work - # The state is used to suspend the limiter if the operation mode of the inverter isn't 0x0 (normal) - operation_mode_id: operation_status_id0 + # The operation_status_id sensor is expected here. Passing the operation_status won't work + # The state is used to suspend the limiter if the operation status of the inverter isn't 0x0 (normal) + operation_status_id: operation_status_id0 # The update interval is important and defaults to 3 seconds. If the demand is sent too frequently # or rarely the interverter stops. TODO: Identify and validate the lower and upper update limit @@ -199,7 +199,7 @@ text_sensor: - platform: soyosource_virtual_meter soyosource_virtual_meter_id: virtualmeter0 operation_mode: - name: "${name} operation mode" + name: "${name} limiter operation mode" - platform: soyosource_display errors: diff --git a/lovelace-entities-card.yaml b/lovelace-entities-card.yaml deleted file mode 100644 index 1fa1489..0000000 --- a/lovelace-entities-card.yaml +++ /dev/null @@ -1,17 +0,0 @@ -type: entities -entities: - - entity: sensor.soyosource_gtn_virtual_meter_limiter_operation_mode - - entity: switch.soyosource_gtn_virtual_meter_manual_mode - - entity: number.soyosource_gtn_virtual_meter_manual_power_demand - - entity: sensor.firstfloor_power_demand - - entity: sensor.soyosource_gtn_virtual_meter_ac_frequency - - entity: sensor.soyosource_gtn_virtual_meter_ac_voltage - - entity: sensor.soyosource_gtn_virtual_meter_battery_current - - entity: sensor.soyosource_gtn_virtual_meter_battery_power - - entity: sensor.soyosource_gtn_virtual_meter_battery_voltage - - entity: binary_sensor.soyosource_gtn_virtual_meter_fan_running - - entity: sensor.soyosource_gtn_virtual_meter_operation_mode - - entity: sensor.soyosource_gtn_virtual_meter_operation_mode_id - - entity: sensor.soyosource_gtn_virtual_meter_temperature - - entity: switch.soyosource_gtn_virtual_meter_emergency_power_off - - entity: number.soyosource_gtn_virtual_meter_max_power_demand diff --git a/tests/esp8266-fake-display.yaml b/tests/esp8266-fake-display.yaml index da1404d..4c4a532 100644 --- a/tests/esp8266-fake-display.yaml +++ b/tests/esp8266-fake-display.yaml @@ -9,7 +9,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: d1_mini diff --git a/tests/esp8266-inverter-emulator.yaml b/tests/esp8266-inverter-emulator.yaml index 5cab218..77f6795 100644 --- a/tests/esp8266-inverter-emulator.yaml +++ b/tests/esp8266-inverter-emulator.yaml @@ -10,7 +10,7 @@ esphome: comment: ${device_description} project: name: "syssi.esphome-soyosource-gtn-virtual-meter" - version: 1.2.0 + version: 2.0.0 esp8266: board: d1_mini