Hi There, I started this project off a couple of months ago testing with a 10kg weight (10kg is 100% full, 0kg is 0% full) and had it all in my head, now coming back to this with a real gas bottle I need a bit of assistance to get the right calculation… in other words my head is going WTF
Full Gas Bottle: 80kg
Empty Gas Bottle: 35kg
rockgas_bottle_1_weight is currently reporting 53kg. Now I need help with rockgas_bottle_1_level please. How do I set 80kg is 100% full and 35kg (or less) is 0%?
- sensor:
- name: "Rockgas Bottle 1 Weight"
unique_id: rockgas_bottle_1_weight
unit_of_measurement: "g"
device_class: weight
state: >
{{ states('sensor.tasmota_hx711_weightraw') | float - 927 }}
- name: "Rockgas Bottle 1 Level"
unique_id: rockgas_bottle_1_level
unit_of_measurement: "%"
state: >
{{ ([(states('sensor.tasmota_hx711_weightraw') | float - 927) / 10000 * 100, 100]|sort)[0] }}