From ff8ab4f21e10fbb92375d95c958264eca36acf2f Mon Sep 17 00:00:00 2001 From: Sleeper85 Date: Sat, 25 Oct 2025 13:07:33 +0200 Subject: [PATCH] Added Shunt Modbus FAKE --- packages/shunt/shunt_combine_FAKE.yaml | 75 +-------------------- packages/shunt/shunt_modbus_FAKE.yaml | 22 +++++++ packages/shunt/shunt_sensors_FAKE.yaml | 90 ++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 72 deletions(-) create mode 100644 packages/shunt/shunt_modbus_FAKE.yaml create mode 100644 packages/shunt/shunt_sensors_FAKE.yaml diff --git a/packages/shunt/shunt_combine_FAKE.yaml b/packages/shunt/shunt_combine_FAKE.yaml index d6287a3..d330604 100644 --- a/packages/shunt/shunt_combine_FAKE.yaml +++ b/packages/shunt/shunt_combine_FAKE.yaml @@ -1,5 +1,5 @@ -# Updated : 2025.10.11 -# Version : 1.1.3 +# Updated : 2025.10.25 +# Version : 1.1.1 # GitHub : https://github.com/Sleeper85/esphome-yambms # YamBMS ( Yet another multi-BMS Merging Solution ) @@ -18,74 +18,5 @@ # along with this program. If not, see . packages: - shunt_base: !include shunt_base.yaml + shunt_sensors: !include shunt_sensors_FAKE.yaml shunt_combine: !include shunt_combine.yaml - -binary_sensor: - # Required sensors cannot be retrieved from Shunt - # online_status - - platform: template - id: shunt${shunt_id}_online_status - name: "${name} ${shunt_name} Online Status" - lambda: |- - if (id(shunt${shunt_id}_voltage).state > 0) - return true; - else - return false; - -sensor: - # total_voltage - - platform: template - id: shunt${shunt_id}_voltage - name: "${name} ${shunt_name} Voltage" - update_interval: ${shunt_update_interval} - accuracy_decimals: 2 - unit_of_measurement: V - device_class: voltage - filters: - - or: - - throttle: 10s - - delta: 0.01 - lambda: return ${shunt_voltage}; - - # current - - platform: template - id: shunt${shunt_id}_current - name: "${name} ${shunt_name} Current" - update_interval: ${shunt_update_interval} - accuracy_decimals: 1 - unit_of_measurement: A - device_class: current - filters: - - or: - - throttle: 10s - - delta: 0.1 - lambda: return ${shunt_current}; - - # power - - platform: template - id: shunt${shunt_id}_power - name: "${name} ${shunt_name} Power" - update_interval: ${shunt_update_interval} - accuracy_decimals: 0 - unit_of_measurement: W - device_class: power - filters: - - or: - - throttle: 10s - - delta: 1 - lambda: return ${shunt_power}; - - # state_of_charge - - platform: template - id: shunt${shunt_id}_soc - name: "${name} ${shunt_name} State of Charge" - update_interval: ${shunt_update_interval} - accuracy_decimals: 0 - unit_of_measurement: '%' - device_class: battery - filters: - - or: - - throttle: 10s - - delta: 1 - lambda: return ${shunt_soc}; diff --git a/packages/shunt/shunt_modbus_FAKE.yaml b/packages/shunt/shunt_modbus_FAKE.yaml new file mode 100644 index 0000000..daea7dd --- /dev/null +++ b/packages/shunt/shunt_modbus_FAKE.yaml @@ -0,0 +1,22 @@ +# Updated : 2025.10.25 +# Version : 1.1.1 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +packages: + shunt_sensors: !include shunt_sensors_FAKE.yaml + shunt_combine: !include shunt_modbus_server.yaml diff --git a/packages/shunt/shunt_sensors_FAKE.yaml b/packages/shunt/shunt_sensors_FAKE.yaml new file mode 100644 index 0000000..afd8c8e --- /dev/null +++ b/packages/shunt/shunt_sensors_FAKE.yaml @@ -0,0 +1,90 @@ +# Updated : 2025.10.25 +# Version : 1.1.4 +# GitHub : https://github.com/Sleeper85/esphome-yambms + +# YamBMS ( Yet another multi-BMS Merging Solution ) + +# This YAML is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation, either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +packages: + shunt_base: !include shunt_base.yaml + +binary_sensor: + # Required sensors cannot be retrieved from Shunt + # online_status + - platform: template + id: shunt${shunt_id}_online_status + name: "${name} ${shunt_name} Online Status" + lambda: |- + if (id(shunt${shunt_id}_voltage).state > 0) + return true; + else + return false; + +sensor: + # total_voltage + - platform: template + id: shunt${shunt_id}_voltage + name: "${name} ${shunt_name} Voltage" + update_interval: ${shunt_update_interval} + accuracy_decimals: 2 + unit_of_measurement: V + device_class: voltage + filters: + - or: + - throttle: 10s + - delta: 0.01 + lambda: return ${shunt_voltage}; + + # current + - platform: template + id: shunt${shunt_id}_current + name: "${name} ${shunt_name} Current" + update_interval: ${shunt_update_interval} + accuracy_decimals: 1 + unit_of_measurement: A + device_class: current + filters: + - or: + - throttle: 10s + - delta: 0.1 + lambda: return ${shunt_current}; + + # power + - platform: template + id: shunt${shunt_id}_power + name: "${name} ${shunt_name} Power" + update_interval: ${shunt_update_interval} + accuracy_decimals: 0 + unit_of_measurement: W + device_class: power + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${shunt_power}; + + # state_of_charge + - platform: template + id: shunt${shunt_id}_soc + name: "${name} ${shunt_name} State of Charge" + update_interval: ${shunt_update_interval} + accuracy_decimals: 0 + unit_of_measurement: '%' + device_class: battery + filters: + - or: + - throttle: 10s + - delta: 1 + lambda: return ${shunt_soc};