diy solar

diy solar

YamBMS JK-BMS-CAN with new Cut-Off Charging Logic (open-source)

And possibly I completely misunderstood what you meant by "_total" (I assumed _total being the sum of all BMS Currents), because that's what a "Total" means to me at least.

Global variables are either counters, or are prefixed with total_ min_ or max_

So you understood it correctly, total_ is the sum of all BMS values. Depending on the sensors this could become an average or remain a total value.

It is very simple :

C:
id(${yambms_id}_total_xyz)
is a global variable to process

C:
id(${yambms_id}_xyz).state
is a sensor published with information that has been processed.

If I take the example of power, it goes without saying that the published value is a sum of all the BMS that can be combined.

C:
id(${yambms_id}_power).publish_state(id(${yambms_id}_total_power));

YAML:
  # power SUM
  - platform: template
    id: ${yambms_id}_power
    name: "${name} ${yambms_name} Power (Σ)"
    update_interval: ${yambms_update_interval}
    accuracy_decimals: 0
    unit_of_measurement: W
    device_class: power
    filters:
      - or:
        - throttle: 10s
        - delta: 1

A sensor prefixed with ${yambms_id} is a YamBMS sensor so it is clear that it is a value of what you can put in the "Control / Regulation by ESP32" category.

I don't see the point of adding "esp32_controller" at the end of the sensor name.

All new YamBMS sensors have the same id name as JK-BMS sensors but are prefixed with ${yambms_id}.

I hope this information is helpful because I feel like I'm wasting my time explaining all this.
 
As you can see the sensors declaration is very clear that it is a sum.

YAML:
  # power SUM
  - platform: template
    id: ${yambms_id}_power
    name: "${name} ${yambms_name} Power (Σ)"
    update_interval: ${yambms_update_interval}
    accuracy_decimals: 0
    unit_of_measurement: W
    device_class: power
    filters:
      - or:
        - throttle: 10s
        - delta: 1
 
As you can see the sensors declaration is very clear that it is a sum.

YAML:
  # power SUM
  - platform: template
    id: ${yambms_id}_power
    name: "${name} ${yambms_name} Power (Σ)"
    update_interval: ${yambms_update_interval}
    accuracy_decimals: 0
    unit_of_measurement: W
    device_class: power
    filters:
      - or:
        - throttle: 10s
        - delta: 1
Yes, in the Comment and Name it's clear (y) . I just personally find it easier if it's also in the Variable Name (`id` since we are talking about ESPHome). That's just what I am used to do. Anyways, I don't want to anger you on this one :(.
 

diy solar

diy solar
Back
Top