是的,您必须从起始卷和卷分配的卷计算它。我在configuration.yaml中制作了几个模板传感器来跟踪:
# Kegtron模板传感器kegerator_right_tap_name: friendly_name: "Kegerator Right Tap Name" value_template: "{{state_attr('sensor. state_attr ') . "kegerator_right_tap_volume_dispensed', '端口名称')}}" kegerator_right_tap_keg_type: friendly_name: "Kegerator Right Tap Keg Type" value_template: "{{state_attr('sensor. Keg ');kegerator_right_tap_volume_dispensed,桶的大小)}}“kegerator_right_tap_drinks_served: friendly_name:“星球大战正确利用饮料服务“value_template:“{{(州(sensor.kegerator_right_tap_volume_dispensed) |浮动/ 0.473)| |一轮int}}“icon_template: mdi: glass-mug-variant kegerator_right_tap_drinks_remaining: friendly_name:"Kegerator Right Tap Drinks Remaining" value_template: "{{((state_attr('sensor. "))kegerator_right_tap_volume_dispensed”、“卷”)开始|浮动——州(sensor.kegerator_right_tap_volume_dispensed) |浮动)/ 0.473)| |一轮int}}“icon_template: mdi: glass-mug-variant kegerator_right_tap_keg_remaining_percent: friendly_name:“星球大战正确的利用剩余百分比”value_template : "{{ ( ( ( state_attr(“传感器。Kegerator_right_tap_volume_dispensed ', 'volume start') | float - states('sensor. Kegerator_right_tap_volume_dispensed ') | float) / state_attr('sensor. Kegerator_right_tap_volume_dispensed ')Kegerator_right_tap_volume_dispensed ', 'volume start') | float) * 100) | round(1)}}" unit_of_measurement: "%"
我还制作了模板传感器,以便更容易地显示传感器的其他属性。
请注意,我只是假设饮料始终是美国品脱(0.473升),因为我用例工作。更强大的解决方案可能是使用ainput_select.
实体允许您选择要跟踪的服务大小的内容。
与此集成的其他酷炫的事情:当剩余10%以下时,我发出警报,因为它已经清除了超过2个月(这也是手动跟踪的)。我也将在卷分配的传感器恢复为零时添加“龙头”传感器中的“龙头”传感器。
我真的很想做的是将此与Untappd API集成,以显示符合折叠桶的utapd啤酒卡。Getting the data from untappd is pretty easy using the REST integration (and you could store the untappd beerid in the kegtron “beer name” field using the kegtron app), but I don’t have the lovelace custom-card skills to recreate this info card in lovelace:
......但希望我最终会弄明白。