Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensor:
- - platform: pulse_counter
- pin: D7
- name: "Watering plants (flow)"
- id: water_flow1
- update_interval: 60s # slow counter, will be overriden
- filters:
- - filter_out: nan
- - lambda: return (x / 450.0) * 60.0;
- unit_of_measurement: "L/hr"
- icon: mdi:water
- switch:
- - platform: gpio
- name: "Watering plants valve (transistor, 12V)"
- pin: D6
- id: water_valve1
- restore_mode: ALWAYS_OFF
- icon: mdi:water-pump
- interval:
- - interval: 5sec
- then:
- if: # fast flow updates if valve is on OR if flow is detected at sensor interval
- condition:
- or:
- - switch.is_on: water_valve1
- - lambda: return id(water_flow1).state > 0.0;
- then:
- - component.update: water_flow1
Add Comment
Please, Sign In to add comment