Erlaubte Attachments hier im Forum

Hier im Forum geht es oft auch um die softwareseitige Anbindung von Akkus etc.pp. an zb. ioBroker, Home Assistant usw. Man kann in diesem Forum nicht mal einfache TXT Dateien anhängen sondern muß zb. seine YAML Konfigurationen als PDF anhängen. Das ist maximal aufwändig für den Poster und den Leser der Postings. Solche YAMLs sind ja empfindliche Biester bei denen jede Einrückung entscheidend ist, die oft sehr groß und komplex sind. Der Leser ist meistens unerfahren und soll nun aus einer PDF Datei heraus diese Daten weiter verarbeiten.

Desweiteren ging das mit den TXT Dateien früher schon. Das erkenne ich an meinen alten Postings. Nun sind daraus Leichen geworden.

Aus meiner Sicht macht das Posting solcher wichtigen Dateien hier in diesem Forum keinerlei Sinn mehr. Daraus folgt für mich: ich würde gerne Anderen helfen aber so kann ich das nicht sinnvoll in meiner knapp bemessenen Freizeit. Und das hätte zur Konsequenz das ich hier nicht mehr helfen werde.

Moin,

evtl. reicht es wenn man die YAML in code-tags schmeißt? Ich weiß jetzt allerdings nicht wie viele Zeilen die code-tags maximal erlauben...

Die YAML könnte hier stehen und würde dann korrekt formatiert kopierbar bleiben

Möchtest du ein Posting lesen das 850 Zeilen lang ist ?
Nee, das ist keine Lösung.

ich denke die Sache ist doch vergleichbar zu meiner EMail Software und Windoof. Man deaktiviert alles weil man Schadsoftware nicht sauber separieren kann und ein Angreifer so Zugang zum eigenen System erlangen kann. Dann ist das eigentliche Problem in der Foren-Sofwtare die anfällig für solche Angriffe ist.

Es sollte überhaupt kein Problem darstellen beliebige Attachments anhängen zu können wenn sie sauber in Datenbanken separiert vom eigentlichen WEB Server Code sind.

Jetzt 850 Textzeilen nach PDF zu portieren kostet deutlich mehr Resourcen in der Datenbank, beim erstellen dieser und beim Lesen und weiterveenden für die eigenen Projekte,

Wie gesagt, die Sache ist für mich im Grunde einfach. Ich supporte Foren die mir das Helfen erleichtern und nicht verkomplizieren, punkt.

Mal ein Beispiel:

modbus:
  - name: JKBMS1
    type: serial
    method: rtu
    port: /dev/ttyACM2
    baudrate: 115200
    stopbits: 1
    bytesize: 8
    parity: N
    message_wait_milliseconds: 30
    sensors:
      - name: "Battery 1 charge enable"
        unique_id: "battery_1_charge_enable"
        slave: 0
        address: 0x1070
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 discharge enable"
        unique_id: "battery_1_discharge_enable"
        slave: 0
        address: 0x1074
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 balance enable"
        unique_id: "battery_1_balance_enable"
        slave: 0
        address: 0x1078
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 flags"
        unique_id: "battery_1_flags"
        slave: 0
        address: 0x1114
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 cell voltages"
        unique_id: "battery_1_cell_voltages"
        slave: 0
        address: 0x1200
        input_type: holding
        data_type: custom
        count: 16
        structure: ">16H"
        scan_interval: 15
      - name: "Battery 1 cell average voltage"
        unique_id: "battery_1_cell_average_voltage"
        slave: 0
        address: 0x1244
        input_type: holding
        data_type: uint16
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        scale: 0.001
        precision: 3
        scan_interval: 5
      - name: "Battery 1 cell differential voltage"
        unique_id: "battery_1_cell_differential_voltage"
        slave: 0
        address: 0x1246
        input_type: holding
        data_type: uint16
        state_class: measurement
        device_class: voltage
        unit_of_measurement: mV
        scale: 1
        precision: 0
        scan_interval: 5
      - name: "Battery 1 cell index"
        unique_id: "battery_1_cell_index"
        slave: 0
        address: 0x1248
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 MOSFET temperature"
        unique_id: "battery_1_mosfet_temperature"
        slave: 0
        address: 0x128A
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 voltage"
        unique_id: "battery_1_voltage"
        slave: 0
        address: 0x1290
        input_type: holding
        data_type: uint32
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        scale: 0.001
        precision: 2
        scan_interval: 5
      - name: "Battery 1 current"
        unique_id: "battery_1_current"
        slave: 0
        address: 0x1298
        input_type: holding
        data_type: int32
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        scale: -0.001
        precision: 2
        scan_interval: 5
      - name: "Battery 1 temperature T1"
        unique_id: "battery_1_temperature_t1"
        slave: 0
        address: 0x129C
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 temperature T2"
        unique_id: "battery_1_temperature_t2"
        slave: 0
        address: 0x129E
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 fault code"
        unique_id: "battery_1_fault_code"
        slave: 0
        address: 0x12A0
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 balance current"
        unique_id: "battery_1_balance_current"
        slave: 0
        address: 0x12A4
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        scale: 0.001
        precision: 3
        scan_interval: 5
      - name: "Battery 1 0x12A6"
        unique_id: "battery_1_0x12A6"
        slave: 0
        address: 0x12A6
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 remaining capacity"
        unique_id: "battery_1_remaining_capacity"
        slave: 0
        address: 0x12A8
        input_type: holding
        data_type: int32
        state_class: measurement
        unit_of_measurement: Ah
        scale: 0.001
        precision: 1
        scan_interval: 5
      - name: "Battery 1 capacity"
        unique_id: "battery_1_capacity"
        slave: 0
        address: 0x12AC
        input_type: holding
        data_type: uint32
        state_class: measurement
        unit_of_measurement: Ah
        scale: 0.001
        precision: 1
        scan_interval: 5
      - name: "Battery 1 cycle count"
        unique_id: "battery_1_cycle_count"
        slave: 0
        address: 0x12B0
        input_type: holding
        data_type: uint32
        state_class: measurement
        scan_interval: 5
      - name: "Battery 1 total cycle capacity"
        unique_id: "battery_1_total_cycle_capacity"
        slave: 0
        address: 0x12B4
        input_type: holding
        data_type: uint32
        state_class: measurement
        unit_of_measurement: Ah
        scale: 0.001
        precision: 1
        scan_interval: 5
      - name: "Battery 1 0x12C0"
        unique_id: "battery_1_0x12C0"
        slave: 0
        address: 0x12C0
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 temperature T3"
        unique_id: "battery_1_temperature_t3"
        slave: 0
        address: 0x12F8
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 temperature T4"
        unique_id: "battery_1_temperature_t4"
        slave: 0
        address: 0x12FA
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 temperature T5"
        unique_id: "battery_1_temperature_t5"
        slave: 0
        address: 0x12FC
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 modell"
        unique_id: "battery_1_modell"
        slave: 0
        address: 0x1400
        input_type: holding
        data_type: string
        count: 8
        scan_interval: 3600
      - name: "Battery 1 hardware version"
        unique_id: "battery_1_hardware_version"
        slave: 0
        address: 0x1410
        input_type: holding
        data_type: string
        count: 4
        scan_interval: 3600
      - name: "Battery 1 software version"
        unique_id: "battery_1_software_version"
        slave: 0
        address: 0x1418
        input_type: holding
        data_type: string
        count: 4
        scan_interval: 3600
      - name: "Battery 1 password"
        unique_id: "battery_1_password"
        slave: 0
        address: 0x1436
        input_type: holding
        data_type: string
        count: 8
        scan_interval: 3600
      - name: "Battery 1 serial number"
        unique_id: "battery_1_serial_number"
        slave: 0
        address: 0x144E
        input_type: holding
        data_type: string
        count: 7
        scan_interval: 3600

input_boolean:
  battery_1_show_more:
    name: "Battery 1 show more"

switch:
  - platform: template
    switches:
      battery_1_charge_enable:
        friendly_name: "Battery 1 charge enable"
        unique_id: "battery_1_charge_enable"
        value_template: "{{ int(states('sensor.battery_1_charge_enable'), 0) == 1 }}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_charge_enable'), 0) == 1 %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1070
            value: [0, 1]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1070
            value: [0, 0]

      battery_1_discharge_enable:
        friendly_name: "Battery 1 discharge enable"
        unique_id: "battery_1_discharge_enable"
        value_template: "{{ int(states('sensor.battery_1_discharge_enable'), 0) == 1 }}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_discharge_enable'), 0) == 1 %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1074
            value: [0, 1]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1074
            value: [0, 0]

      battery_1_balance_enable:
        friendly_name: "Battery 1 balance enable"
        unique_id: "battery_1_balance_enable"
        value_template: "{{ int(states('sensor.battery_1_balance_enable'), 0) == 1 }}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_balance_enable'), 0) == 1 %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1078
            value: [0, 1]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1078
            value: [0, 0]

      battery_1_float_mode_enable:
        friendly_name: "Battery 1 float mode enable"
        unique_id: "battery_1_float_mode_enable"
        value_template: "{{ int(states('sensor.battery_1_flags'), 0) | int | bitwise_and(512) != 0}}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_flags'), 0) | int | bitwise_and(512) != 0  %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1114
            value:
              [
                "{{ int(states('sensor.battery_1_flags'), 0) | bitwise_or(512) }}",
              ]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1114
            value:
              [
                "{{ int(states('sensor.battery_1_flags'), 0) | bitwise_and(0xfdff) }}",
              ]

sensor:
  - platform: integration
    source: sensor.battery_1_charge_current
    name: "Battery 1 charge Ah"
    unique_id: "battery_1_charge_ah"
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      minutes: 1
  - platform: integration
    source: sensor.battery_1_discharge_current
    name: "Battery 1 discharge Ah"
    unique_id: "battery_1_discharge_ah"
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      minutes: 1
  - platform: integration
    source: sensor.battery_1_charge_power
    name: "Battery 1 charge energy total"
    unique_id: "battery_1_charge_energy_total"
    unit_prefix: k
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      seconds: 5
  - platform: integration
    source: sensor.battery_1_discharge_power
    name: "Battery 1 discharge energy total"
    unique_id: "battery_1_discharge_energy_total"
    unit_prefix: k
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      seconds: 5

utility_meter:
  battery_1_charge_energy_today:
    name: "Battery 1 charge energy today"
    unique_id: "battery_1_charge_energy_today"
    source: sensor.battery_1_charge_energy_total
    cycle: daily
  battery_1_discharge_energy_today:
    name: "Battery 1 discharge energy today"
    unique_id: "battery_1_discharge_energy_today"
    source: sensor.battery_1_discharge_energy_total
    cycle: daily

template:
  - sensor:
      - name: "Battery 1 power"
        unique_id: "battery_1_power"
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        state: >-
          {% set voltage = states('sensor.battery_1_voltage') %}
          {% set current = states('sensor.battery_1_current') %}
          {% if (voltage | is_number) and (current | is_number) %}
            {{ (float(voltage) * float(current)) | round(0) }}
          {% endif %}
      - name: "Battery 1 charge power"
        unique_id: "battery_1_charge_power"
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        state: >-
          {% set power = states('sensor.battery_1_power') %}
          {% if (power | is_number) and (float(power) < 0) %}
            {{ -float(power) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 discharge power"
        unique_id: "battery_1_discharge_power"
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        state: >-
          {% set power = states('sensor.battery_1_power') %}
          {% if (power | is_number) and (float(power) > 0) %}
            {{ float(power) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 charge current"
        unique_id: "battery_1_charge_current"
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        state: >-
          {% set current = states('sensor.battery_1_current') %}
          {% if (current | is_number) and (float(current) < 0) %}
            {{ -float(current) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 discharge current"
        unique_id: "battery_1_discharge_current"
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        state: >-
          {% set current = states('sensor.battery_1_current') %}
          {% if (current | is_number) and (float(current) > 0) %}
            {{ float(current) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 SOC"
        unique_id: "battery_1_soc"
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement
        state: >-
          {% set capacity = states('sensor.battery_1_capacity') %}
          {% set remaining = states('sensor.battery_1_remaining_capacity') %}
          {% if (capacity | is_number) and (remaining | is_number) %}
            {{ (float(remaining) / float(capacity) * 100.0) | round(1) }}
          {% endif %}
      - name: "Battery 1 balance state"
        unique_id: "battery_1_balance_state"
        state: "{{ (int(states('sensor.battery_1_0x12A6'), 0) | int / 256) | int }}"
      - name: "Battery 1 cell min index"
        unique_id: "battery_1_cell_min_index"
        state: "{{ (int(states('sensor.battery_1_cell_index'), 0) | int % 256) | int +1 }}"
      - name: "Battery 1 cell max index"
        unique_id: "battery_1_cell_max_index"
        state: "{{ (int(states('sensor.battery_1_cell_index'), 0) | int / 256) | int +1 }}"
      - name: "Battery 1 cell 01 voltage"
        unique_id: "battery_1_cell_01_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[0], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 1 -%} 
              cyan
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 1 -%} 
                red
              {%- else -%} 
                inherit
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 02 voltage"
        unique_id: "battery_1_cell_02_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[1], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 2 -%} 
              cyan
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 2 -%} 
                red  
              {%- else -%} 
                inherit
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 03 voltage"
        unique_id: "battery_1_cell_03_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[2], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 3 -%} 
              cyan
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 3 -%} 
                red  
              {%- else -%} 
                inherit
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 04 voltage"
        unique_id: "battery_1_cell_04_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[3], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 4 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 4 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 05 voltage"
        unique_id: "battery_1_cell_05_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[4], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 5 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 5 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 06 voltage"
        unique_id: "battery_1_cell_06_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[5], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 6 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 6 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 07 voltage"
        unique_id: "battery_1_cell_07_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[6], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 7 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 7 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 08 voltage"
        unique_id: "battery_1_cell_08_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[7], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 8 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 8 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 09 voltage"
        unique_id: "battery_1_cell_09_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[8], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 9 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 9 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 10 voltage"
        unique_id: "battery_1_cell_10_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[9], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 10 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 10 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 11 voltage"
        unique_id: "battery_1_cell_11_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[10], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 11 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 11 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 12 voltage"
        unique_id: "battery_1_cell_12_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[11], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 12 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 12 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 13 voltage"
        unique_id: "battery_1_cell_13_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[12], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 13 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 13 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 14 voltage"
        unique_id: "battery_1_cell_14_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[13], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 14 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 14 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 15 voltage"
        unique_id: "battery_1_cell_15_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[14], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 15 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 15 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 16 voltage"
        unique_id: "battery_1_cell_16_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[15], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 16 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 16 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}

  - binary_sensor:
      - name: "Battery 1 discharge state"
        unique_id: "battery_1_discharge_state"
        state: "{{ (int(states('sensor.battery_1_0x12C0'), 0) | int % 256) | int }}"
      - name: "Battery 1 charge state"
        unique_id: "battery_1_charge_state"
        state: "{{ (int(states('sensor.battery_1_0x12C0'), 0) | int / 256) | int }}"
        
recorder:
  exclude:
    entities:
      - sensor.battery_1_flags
      - sensor.battery_1_cell_voltages
      - sensor.battery_1_cell_index
      - sensor.battery_1_fault_code
      - sensor.battery_1_balance_current
      - sensor.battery_1_0x12A6
      - sensor.battery_1_capacity
      - sensor.battery_1_0x12C0
      - sensor.battery_1_modell
      - sensor.battery_1_hardware_version
      - sensor.battery_1_software_version
      - sensor.battery_1_password
      - sensor.battery_1_serial_number
      - sensor.battery_1_charge_power
      - sensor.battery_1_discharge_power
      - sensor.battery_1_charge_current
      - sensor.battery_1_discharge_current
      - sensor.battery_1_balance_state
      - sensor.battery_1_cell_min_index
      - sensor.battery_1_cell_max_index
      - input_boolean.battery_1_show_more
      - binary_sensor.battery_1_charge_state
      - binary_sensor.battery_1_discharge_state      

      - sensor.battery_1_cell_01_voltage
      - sensor.battery_1_cell_02_voltage
      - sensor.battery_1_cell_03_voltage
      - sensor.battery_1_cell_04_voltage
      - sensor.battery_1_cell_05_voltage
      - sensor.battery_1_cell_06_voltage
      - sensor.battery_1_cell_07_voltage
      - sensor.battery_1_cell_08_voltage
      - sensor.battery_1_cell_09_voltage
      - sensor.battery_1_cell_10_voltage
      - sensor.battery_1_cell_11_voltage
      - sensor.battery_1_cell_12_voltage
      - sensor.battery_1_cell_13_voltage
      - sensor.battery_1_cell_14_voltage
      - sensor.battery_1_cell_15_voltage
      - sensor.battery_1_cell_16_voltage

Ok, geht also nicht, sollte 859 Zeilen sein.

Edit: doch geht.

Joah, sieht doch gut aus. Man hat eine kleine Vorschau, alle Zeilen passen rein und sind sauber formatiert und zum Kopieren einfach das kleine "copy" symbol klicken. Eben so, wie man es seit jeher mit code-tags machen kann :sunglasses:

Naja, aber ich kann nicht jedesmal alle Dateien Öffnen, Copy&paste, in Codetags als Textboxen in einem Posting ablegen. Es gibt ja auch andere Formate die man einfach mal anhängen möchte. Zudem gehen die originalen Dateinamen verloren. So wichtig ist mir das aber nicht, meine Entscheidungen wie ich wo helfen kann richten sich eben nach dem Aufwand für mich. Aus meiner Sicht erledigt sich dieses Problem am Ende von selbst, da es viele Anlaufstellen im WEB gibt in denen man Hilfe geben kann :wink:

Du kannst auch den Typ der Datei dazu schreiben, dann wird der Code auch gehighlightet. In deinem Fall einfach yaml siehe Bild

modbus:
  - name: JKBMS1
    type: serial
    method: rtu
    port: /dev/ttyACM2
    baudrate: 115200
    stopbits: 1
    bytesize: 8
    parity: N
    message_wait_milliseconds: 30
    sensors:
      - name: "Battery 1 charge enable"
        unique_id: "battery_1_charge_enable"
        slave: 0
        address: 0x1070
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 discharge enable"
        unique_id: "battery_1_discharge_enable"
        slave: 0
        address: 0x1074
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 balance enable"
        unique_id: "battery_1_balance_enable"
        slave: 0
        address: 0x1078
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 flags"
        unique_id: "battery_1_flags"
        slave: 0
        address: 0x1114
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 cell voltages"
        unique_id: "battery_1_cell_voltages"
        slave: 0
        address: 0x1200
        input_type: holding
        data_type: custom
        count: 16
        structure: ">16H"
        scan_interval: 15
      - name: "Battery 1 cell average voltage"
        unique_id: "battery_1_cell_average_voltage"
        slave: 0
        address: 0x1244
        input_type: holding
        data_type: uint16
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        scale: 0.001
        precision: 3
        scan_interval: 5
      - name: "Battery 1 cell differential voltage"
        unique_id: "battery_1_cell_differential_voltage"
        slave: 0
        address: 0x1246
        input_type: holding
        data_type: uint16
        state_class: measurement
        device_class: voltage
        unit_of_measurement: mV
        scale: 1
        precision: 0
        scan_interval: 5
      - name: "Battery 1 cell index"
        unique_id: "battery_1_cell_index"
        slave: 0
        address: 0x1248
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 MOSFET temperature"
        unique_id: "battery_1_mosfet_temperature"
        slave: 0
        address: 0x128A
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 voltage"
        unique_id: "battery_1_voltage"
        slave: 0
        address: 0x1290
        input_type: holding
        data_type: uint32
        state_class: measurement
        device_class: voltage
        unit_of_measurement: V
        scale: 0.001
        precision: 2
        scan_interval: 5
      - name: "Battery 1 current"
        unique_id: "battery_1_current"
        slave: 0
        address: 0x1298
        input_type: holding
        data_type: int32
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        scale: -0.001
        precision: 2
        scan_interval: 5
      - name: "Battery 1 temperature T1"
        unique_id: "battery_1_temperature_t1"
        slave: 0
        address: 0x129C
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 temperature T2"
        unique_id: "battery_1_temperature_t2"
        slave: 0
        address: 0x129E
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 fault code"
        unique_id: "battery_1_fault_code"
        slave: 0
        address: 0x12A0
        input_type: holding
        data_type: uint32
        scan_interval: 5
      - name: "Battery 1 balance current"
        unique_id: "battery_1_balance_current"
        slave: 0
        address: 0x12A4
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: current
        unit_of_measurement: A
        scale: 0.001
        precision: 3
        scan_interval: 5
      - name: "Battery 1 0x12A6"
        unique_id: "battery_1_0x12A6"
        slave: 0
        address: 0x12A6
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 remaining capacity"
        unique_id: "battery_1_remaining_capacity"
        slave: 0
        address: 0x12A8
        input_type: holding
        data_type: int32
        state_class: measurement
        unit_of_measurement: Ah
        scale: 0.001
        precision: 1
        scan_interval: 5
      - name: "Battery 1 capacity"
        unique_id: "battery_1_capacity"
        slave: 0
        address: 0x12AC
        input_type: holding
        data_type: uint32
        state_class: measurement
        unit_of_measurement: Ah
        scale: 0.001
        precision: 1
        scan_interval: 5
      - name: "Battery 1 cycle count"
        unique_id: "battery_1_cycle_count"
        slave: 0
        address: 0x12B0
        input_type: holding
        data_type: uint32
        state_class: measurement
        scan_interval: 5
      - name: "Battery 1 total cycle capacity"
        unique_id: "battery_1_total_cycle_capacity"
        slave: 0
        address: 0x12B4
        input_type: holding
        data_type: uint32
        state_class: measurement
        unit_of_measurement: Ah
        scale: 0.001
        precision: 1
        scan_interval: 5
      - name: "Battery 1 0x12C0"
        unique_id: "battery_1_0x12C0"
        slave: 0
        address: 0x12C0
        input_type: holding
        data_type: uint16
        scan_interval: 5
      - name: "Battery 1 temperature T3"
        unique_id: "battery_1_temperature_t3"
        slave: 0
        address: 0x12F8
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 temperature T4"
        unique_id: "battery_1_temperature_t4"
        slave: 0
        address: 0x12FA
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 temperature T5"
        unique_id: "battery_1_temperature_t5"
        slave: 0
        address: 0x12FC
        input_type: holding
        data_type: int16
        state_class: measurement
        device_class: temperature
        unit_of_measurement: "°C"
        scale: 0.1
        precision: 1
        scan_interval: 5
      - name: "Battery 1 modell"
        unique_id: "battery_1_modell"
        slave: 0
        address: 0x1400
        input_type: holding
        data_type: string
        count: 8
        scan_interval: 3600
      - name: "Battery 1 hardware version"
        unique_id: "battery_1_hardware_version"
        slave: 0
        address: 0x1410
        input_type: holding
        data_type: string
        count: 4
        scan_interval: 3600
      - name: "Battery 1 software version"
        unique_id: "battery_1_software_version"
        slave: 0
        address: 0x1418
        input_type: holding
        data_type: string
        count: 4
        scan_interval: 3600
      - name: "Battery 1 password"
        unique_id: "battery_1_password"
        slave: 0
        address: 0x1436
        input_type: holding
        data_type: string
        count: 8
        scan_interval: 3600
      - name: "Battery 1 serial number"
        unique_id: "battery_1_serial_number"
        slave: 0
        address: 0x144E
        input_type: holding
        data_type: string
        count: 7
        scan_interval: 3600

input_boolean:
  battery_1_show_more:
    name: "Battery 1 show more"

switch:
  - platform: template
    switches:
      battery_1_charge_enable:
        friendly_name: "Battery 1 charge enable"
        unique_id: "battery_1_charge_enable"
        value_template: "{{ int(states('sensor.battery_1_charge_enable'), 0) == 1 }}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_charge_enable'), 0) == 1 %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1070
            value: [0, 1]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1070
            value: [0, 0]

      battery_1_discharge_enable:
        friendly_name: "Battery 1 discharge enable"
        unique_id: "battery_1_discharge_enable"
        value_template: "{{ int(states('sensor.battery_1_discharge_enable'), 0) == 1 }}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_discharge_enable'), 0) == 1 %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1074
            value: [0, 1]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1074
            value: [0, 0]

      battery_1_balance_enable:
        friendly_name: "Battery 1 balance enable"
        unique_id: "battery_1_balance_enable"
        value_template: "{{ int(states('sensor.battery_1_balance_enable'), 0) == 1 }}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_balance_enable'), 0) == 1 %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1078
            value: [0, 1]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1078
            value: [0, 0]

      battery_1_float_mode_enable:
        friendly_name: "Battery 1 float mode enable"
        unique_id: "battery_1_float_mode_enable"
        value_template: "{{ int(states('sensor.battery_1_flags'), 0) | int | bitwise_and(512) != 0}}"
        #        icon_template: >-
        #          {% if int(states('sensor.battery_1_flags'), 0) | int | bitwise_and(512) != 0  %}
        #            mdi:toggle-switch-off-outline
        #          {% else %}
        #            mdi:toggle-switch-outline
        #          {% endif %}
        turn_on:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1114
            value:
              [
                "{{ int(states('sensor.battery_1_flags'), 0) | bitwise_or(512) }}",
              ]
        turn_off:
          service: modbus.write_register
          data_template:
            hub: "JKBMS1"
            slave: 0
            address: 0x1114
            value:
              [
                "{{ int(states('sensor.battery_1_flags'), 0) | bitwise_and(0xfdff) }}",
              ]

sensor:
  - platform: integration
    source: sensor.battery_1_charge_current
    name: "Battery 1 charge Ah"
    unique_id: "battery_1_charge_ah"
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      minutes: 1
  - platform: integration
    source: sensor.battery_1_discharge_current
    name: "Battery 1 discharge Ah"
    unique_id: "battery_1_discharge_ah"
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      minutes: 1
  - platform: integration
    source: sensor.battery_1_charge_power
    name: "Battery 1 charge energy total"
    unique_id: "battery_1_charge_energy_total"
    unit_prefix: k
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      seconds: 5
  - platform: integration
    source: sensor.battery_1_discharge_power
    name: "Battery 1 discharge energy total"
    unique_id: "battery_1_discharge_energy_total"
    unit_prefix: k
    unit_time: h
    method: left
    round: 2
    max_sub_interval:
      seconds: 5

utility_meter:
  battery_1_charge_energy_today:
    name: "Battery 1 charge energy today"
    unique_id: "battery_1_charge_energy_today"
    source: sensor.battery_1_charge_energy_total
    cycle: daily
  battery_1_discharge_energy_today:
    name: "Battery 1 discharge energy today"
    unique_id: "battery_1_discharge_energy_today"
    source: sensor.battery_1_discharge_energy_total
    cycle: daily

template:
  - sensor:
      - name: "Battery 1 power"
        unique_id: "battery_1_power"
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        state: >-
          {% set voltage = states('sensor.battery_1_voltage') %}
          {% set current = states('sensor.battery_1_current') %}
          {% if (voltage | is_number) and (current | is_number) %}
            {{ (float(voltage) * float(current)) | round(0) }}
          {% endif %}
      - name: "Battery 1 charge power"
        unique_id: "battery_1_charge_power"
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        state: >-
          {% set power = states('sensor.battery_1_power') %}
          {% if (power | is_number) and (float(power) < 0) %}
            {{ -float(power) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 discharge power"
        unique_id: "battery_1_discharge_power"
        unit_of_measurement: W
        device_class: power
        state_class: measurement
        state: >-
          {% set power = states('sensor.battery_1_power') %}
          {% if (power | is_number) and (float(power) > 0) %}
            {{ float(power) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 charge current"
        unique_id: "battery_1_charge_current"
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        state: >-
          {% set current = states('sensor.battery_1_current') %}
          {% if (current | is_number) and (float(current) < 0) %}
            {{ -float(current) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 discharge current"
        unique_id: "battery_1_discharge_current"
        unit_of_measurement: A
        device_class: current
        state_class: measurement
        state: >-
          {% set current = states('sensor.battery_1_current') %}
          {% if (current | is_number) and (float(current) > 0) %}
            {{ float(current) | round(2) }}
          {% else %}
            0
          {% endif %}
      - name: "Battery 1 SOC"
        unique_id: "battery_1_soc"
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement
        state: >-
          {% set capacity = states('sensor.battery_1_capacity') %}
          {% set remaining = states('sensor.battery_1_remaining_capacity') %}
          {% if (capacity | is_number) and (remaining | is_number) %}
            {{ (float(remaining) / float(capacity) * 100.0) | round(1) }}
          {% endif %}
      - name: "Battery 1 balance state"
        unique_id: "battery_1_balance_state"
        state: "{{ (int(states('sensor.battery_1_0x12A6'), 0) | int / 256) | int }}"
      - name: "Battery 1 cell min index"
        unique_id: "battery_1_cell_min_index"
        state: "{{ (int(states('sensor.battery_1_cell_index'), 0) | int % 256) | int +1 }}"
      - name: "Battery 1 cell max index"
        unique_id: "battery_1_cell_max_index"
        state: "{{ (int(states('sensor.battery_1_cell_index'), 0) | int / 256) | int +1 }}"
      - name: "Battery 1 cell 01 voltage"
        unique_id: "battery_1_cell_01_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[0], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 1 -%} 
              cyan
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 1 -%} 
                red
              {%- else -%} 
                inherit
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 02 voltage"
        unique_id: "battery_1_cell_02_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[1], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 2 -%} 
              cyan
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 2 -%} 
                red  
              {%- else -%} 
                inherit
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 03 voltage"
        unique_id: "battery_1_cell_03_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[2], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 3 -%} 
              cyan
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 3 -%} 
                red  
              {%- else -%} 
                inherit
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 04 voltage"
        unique_id: "battery_1_cell_04_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[3], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 4 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 4 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 05 voltage"
        unique_id: "battery_1_cell_05_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[4], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 5 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 5 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 06 voltage"
        unique_id: "battery_1_cell_06_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[5], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 6 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 6 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 07 voltage"
        unique_id: "battery_1_cell_07_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[6], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 7 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 7 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 08 voltage"
        unique_id: "battery_1_cell_08_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[7], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 8 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 8 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 09 voltage"
        unique_id: "battery_1_cell_09_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[8], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 9 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 9 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 10 voltage"
        unique_id: "battery_1_cell_10_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[9], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 10 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 10 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 11 voltage"
        unique_id: "battery_1_cell_11_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[10], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 11 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 11 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 12 voltage"
        unique_id: "battery_1_cell_12_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[11], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 12 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 12 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 13 voltage"
        unique_id: "battery_1_cell_13_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[12], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 13 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 13 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 14 voltage"
        unique_id: "battery_1_cell_14_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[13], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 14 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 14 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 15 voltage"
        unique_id: "battery_1_cell_15_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[14], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 15 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 15 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}
      - name: "Battery 1 cell 16 voltage"
        unique_id: "battery_1_cell_16_voltage"
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        state: "{{ (float(states('sensor.battery_1_cell_voltages').split(',')[15], 0) * 0.001) | round(3) }}"
        attributes:
          color: >
            {% if int(states('sensor.battery_1_cell_min_index'), 0) == 16 -%} 
              cyan 
            {%- else -%}
              {% if int(states('sensor.battery_1_cell_max_index'), 0) == 16 -%} 
                red  
              {%- else -%} 
                inherit 
              {%- endif %} 
            {%- endif %}

  - binary_sensor:
      - name: "Battery 1 discharge state"
        unique_id: "battery_1_discharge_state"
        state: "{{ (int(states('sensor.battery_1_0x12C0'), 0) | int % 256) | int }}"
      - name: "Battery 1 charge state"
        unique_id: "battery_1_charge_state"
        state: "{{ (int(states('sensor.battery_1_0x12C0'), 0) | int / 256) | int }}"
        
recorder:
  exclude:
    entities:
      - sensor.battery_1_flags
      - sensor.battery_1_cell_voltages
      - sensor.battery_1_cell_index
      - sensor.battery_1_fault_code
      - sensor.battery_1_balance_current
      - sensor.battery_1_0x12A6
      - sensor.battery_1_capacity
      - sensor.battery_1_0x12C0
      - sensor.battery_1_modell
      - sensor.battery_1_hardware_version
      - sensor.battery_1_software_version
      - sensor.battery_1_password
      - sensor.battery_1_serial_number
      - sensor.battery_1_charge_power
      - sensor.battery_1_discharge_power
      - sensor.battery_1_charge_current
      - sensor.battery_1_discharge_current
      - sensor.battery_1_balance_state
      - sensor.battery_1_cell_min_index
      - sensor.battery_1_cell_max_index
      - input_boolean.battery_1_show_more
      - binary_sensor.battery_1_charge_state
      - binary_sensor.battery_1_discharge_state      

      - sensor.battery_1_cell_01_voltage
      - sensor.battery_1_cell_02_voltage
      - sensor.battery_1_cell_03_voltage
      - sensor.battery_1_cell_04_voltage
      - sensor.battery_1_cell_05_voltage
      - sensor.battery_1_cell_06_voltage
      - sensor.battery_1_cell_07_voltage
      - sensor.battery_1_cell_08_voltage
      - sensor.battery_1_cell_09_voltage
      - sensor.battery_1_cell_10_voltage
      - sensor.battery_1_cell_11_voltage
      - sensor.battery_1_cell_12_voltage
      - sensor.battery_1_cell_13_voltage
      - sensor.battery_1_cell_14_voltage
      - sensor.battery_1_cell_15_voltage
      - sensor.battery_1_cell_16_voltage

Das sind übrigens die Sprachen, die gehighlighted werden können

Hab *.txt mal hinzugefügt als möglicher Anhangstyp.

2024-11-21-test.txt (41 Bytes)

Test

1 „Gefällt mir“

Textdateien in älteren Postings gehen wieder oder sind die weg? Falls weg, kannst du mal ein Beispiel verlinken?

Was Code angeht: Ich denke auch, durch die gute Code-Integration sollten wir diese Möglichkeit auch nutzen. Anhänge sind da für viele umständlicher, aber es wird auch immer mal Gründe geben, eine Textdatei anzuhängen.

Im alten Forum hingegen war die Code-Integration oft unbenutzbar, deshalb hatte sich erst diese Sache mit den Anhängen entwickelt.

Danke sehr für deine Bemühungen.

Hm, und das sehe ich eben bischen anders. Ich möchte zb. eine umfangreiche Konfiguration posten. Im Grunde ist es aus Sicht des Hilfesuchenden nicht so wichtig was da drin steht, sondern wie er sie einfach anwenden kann. Download und Install in den Ordner vom Home Assistant, fertig. Dann erst beginnt man die lokalen Anpassungen an dieser Config zu machen.

Klar, das ginge alles auch über den Code direkt im Posting. Ich halte es eher so das ich die komplette Datei als Attachment poste und im Posting als Code nur die relevanten Stellen aufzeige wo man Änderungen machen muß.

Hat sich aber jetzt alles erledigt, ich kann anhängen und als code posten, gut ist.

Danke nochmal.

Super vielen Dank, weist du auch wie das beim [ code ] Tag geht? Gehöre der älteren Schule an :wink:

Edit: [ code = yaml ] ... [/ code] macht es, habs selbst mal getestet. (ohne Leerzeichen natürloich)

Bei facebuch hilft man sich mit pastebin um Code anzuhängen. Vielleicht wäre das hier auch ein Weg externe Dateien anzuhängen und der Leser wird nicht von endlosen Zeilen erschlagen.

Thema fehlende Textdateien-Anhänge bei der Migration schauen wir uns an...

Habe festgestellt, daß es beim Hochladen von großen JPG Fotos mit vielleicht 740kB Probleme gibt. Der Browser (Firefox unter Ubuntu) hängt sich bei mir mit einer typischen Meldung

Wird verarbeitet: DSCF7495.JPG …]()

einfach auf und es läuft eine Sanduhr bis zum Sanktnimmerleinstag.
Macht man die Datei kleiner, funktioniert das ohne Probleme. Normalerweise haben die Foren doch Funktionen welche ihnen vorgeworfene jpgs selbst auf ein vernünftiges Maß komprimieren sollten?

Zumindest könnte aber eine Fehlermeldung mit der zugelassenen Dateigröße erscheinen damit man weis was zu tun ist.

Das Limit liegt deutlich höher und dann bekommst du auch eine Fehlermeldung. Hat also nichts mit dem Forum selbst zu tun, vielleicht ein Timeout auf Webserver-Ebene.

Hast du eine sehr langsame Internetanbindung?

Ich schließe mich hier mal an. Seite heute Morgen hängt da irgendwas sobald ein jpeg mit in dem Post hochgeladen werden soll. Gleiches Verhalten wie beim @janvi

Nutze den Firefox 133.0

600/300 Mbit Glasfaser welche seit Ertüchtigung meiner Switches auch real erreicht werden. Könnte da mal aber in meinem Mikrotik Router reinschauen was der während der Übertragung sagt.

Ist bei mir auch reproduzierbar, auch Firefox, wobei ich glaube, dass es nichts mit dem Browser zu tun hat. Hat auch nichts mit den Limits zu tun, die wir hier im Forum gesetzt haben. 1,5 Megapixel mit 412 kB funktionierte noch problemlos.

Symptom: Eieruhr im Hochladen-Bereich unten rechts läuft dauerhaft, kommt nicht zum Ende.

@nick81 Könntest du mal bei Gelegenheit schauen? Limits im Forum sind unter max_image_size_kb und max_image_megapixels zu finden. Daran scheint es aber nicht zu liegen. Ich vermute Webserver, Proxy oder wo die Daten noch irgendwo durchlaufen. Also eher kein Discourse-Problem.

1 „Gefällt mir“