No, I finally put it on the to do list for another time.
Ah, those are in my main configuration.yaml
- sensor:
- name: "Tray 1 Remaining Filament Percentage"
unique_id: "tray_1_remain_percent"
unit_of_measurement: "%"
state: >
{% set total_capacity = 100 %}
{{ (state_attr('sensor.p1s_01p00c470401372_ams_1_tray_1', 'remain') / total_capacity) * 100 | round(1) }}
- name: "Tray 2 Remaining Filament Percentage"
unique_id: "tray_2_remain_percent"
unit_of_measurement: "%"
state: >
{% set total_capacity = 100 %}
{{ (state_attr('sensor.p1s_01p00c470401372_ams_1_tray_2', 'remain') / total_capacity) * 100 | round(1) }}
- name: "Tray 3 Remaining Filament Percentage"
unique_id: "tray_3_remain_percent"
unit_of_measurement: "%"
state: >
{% set total_capacity = 100 %}
{{ (state_attr('sensor.p1s_01p00c470401372_ams_1_tray_3', 'remain') / total_capacity) * 100 | round(1) }}
- name: "Tray 4 Remaining Filament Percentage"
unique_id: "tray_4_remain_percent"
unit_of_measurement: "%"
state: >
{% set total_capacity = 100 %}
{{ (state_attr('sensor.p1s_01p00c470401372_ams_1_tray_4', 'remain') / total_capacity) * 100 | round(1) }}