☔ DIY Zigbee rain gauge

After reading this

and im having a 1/2 knee replacement i have build the knee strength up with no weight

DOC said I have ride a stationary bike

thinking on one of the bike rides " could i do the rain gauge to this.

and my the battery going flat on mine Zigbee Bed occupancy sensor

so tape it to the bike wheel and get a count bugger it worked ok

image

now the maths (im just winging it )

i walk the bike one turn which came to 2.2 mtr

base on the above maths I did

#=======================================================================
#
#=======================================================================

- platform: history_stats
  name: bike turns
  entity_id: binary_sensor.bike_contact
  state: 'off'
  type: count
  start: "{{ now().replace(hour=0, minute=0, second=0) }}"
  end: "{{ now() }}"

- platform: template
  sensors:
    bike_today:
      friendly_name: Bike  Today
      unit_of_measurement: km
      value_template: >-
        {% set count = states('sensor.bike_turns') | int %}
        {% set mm_per_pulse = 2200 %}
        {% set mm = (count * mm_per_pulse) %}
        {% set KM = mm / 1000000 %}
        {{ KM|round(2, 'floor') }}

will add lovelace screen after tomorrow bike ride

here is the lovelace look

image

after some more thinking

3 Likes