Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- globals:
- - id: sensor_height
- type: float
- restore_value: yes
- initial_value: '1.73'
- - id: top_level
- type: float
- restore_value: yes
- initial_value: '0.15'
- i2c:
- - id: bus_a
- sda: 4
- scl: 5
- scan: True
- sensor:
- - platform: vl53l0x
- i2c_id: bus_a
- name: "Level Percent"
- address: 0x29
- update_interval: 60s
- long_range: true
- unit_of_measurement: "%"
- accuracy_decimals: 1
- filters:
- - lambda: |-
- if (x > id(sensor_height)) return 0;
- else return (id(sensor_height)-x)*(100/(id(sensor_height) - id(top_level)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement