├── README.md ├── images └── fullsizeoutput_2f49.jpeg └── weatherstation.yaml /README.md: -------------------------------------------------------------------------------- 1 | # esphomeweatherstation 2 | ESPHome based weatherstation station. Hardware from MakerLife Weather Station Kit Pi Zero W. 3 | Replaced Raspberry Pi Zero W with ESP8266. 4 | ESP8266 programmed using https://esphome.io 5 | 6 | - Wind gauge (m/s) 7 | - Rain gauge (mm rain per minute, mm rain daily) 8 | - Temperature sensor (degC) 9 | 10 | ![](images/fullsizeoutput_2f49.jpeg) 11 | -------------------------------------------------------------------------------- /images/fullsizeoutput_2f49.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkuoppa/esphomeweatherstation/7618e13c0fb47f8feaeea1c4222097c2b402f835/images/fullsizeoutput_2f49.jpeg -------------------------------------------------------------------------------- /weatherstation.yaml: -------------------------------------------------------------------------------- 1 | esphome: 2 | name: weatherstation 3 | platform: ESP8266 4 | board: d1_mini 5 | 6 | wifi: 7 | ssid: 8 | password: 9 | 10 | ap: 11 | ssid: "Fallback Hotspot" 12 | password: "xyz" 13 | 14 | captive_portal: 15 | 16 | web_server: 17 | port: 80 18 | 19 | api: 20 | password: 21 | 22 | ota: 23 | safe_mode: True 24 | password: 25 | 26 | logger: 27 | 28 | dallas: 29 | # pin D7 30 | - pin: GPIO13 31 | 32 | sensor: 33 | - platform: pulse_counter 34 | pin: 35 | # pin D5 36 | number: GPIO14 37 | mode: INPUT_PULLUP 38 | unit_of_measurement: 'm/s' 39 | name: 'Wind sensor' 40 | icon: 'mdi:weather-windy' 41 | id: my_wind 42 | count_mode: 43 | rising_edge: DISABLE 44 | falling_edge: INCREMENT 45 | internal_filter: 50us 46 | update_interval: 60s 47 | on_raw_value: 48 | then: 49 | - sensor.template.publish: 50 | id: template_sens 51 | state: !lambda "return x;" 52 | #rotations_per_sec = pulses/2/60 53 | #circ_m=0.09*2*3.14 = 0.5652 54 | #mps = 1.18*circ_m*rotations_per_sec 55 | #mps = 1.18*0.5652/2/60 =0,0055578 56 | accuracy_decimals: 2 57 | filters: 58 | - multiply: 0.0055578 59 | - sliding_window_moving_average: 60 | window_size: 2 61 | send_every: 1 62 | #send_first_at: 60 # can be used to prevent an unrealistic high value at startup (cannot be larger than send_every) 63 | 64 | - platform: template 65 | name: "Template Sensor" 66 | id: template_sens 67 | filters: 68 | # - multiply: 0.2794 69 | # - multiply: 60 (to get mm/h) 70 | - multiply: 16.764 71 | - sliding_window_moving_average: 72 | window_size: 60 73 | send_every: 1 74 | 75 | - platform: pulse_counter 76 | pin: 77 | # pin D6 78 | number: GPIO12 79 | mode: INPUT_PULLUP 80 | unit_of_measurement: 'mm/h' 81 | name: 'Rain gauge' 82 | icon: 'mdi:weather-rainy' 83 | id: my_rain 84 | count_mode: 85 | rising_edge: DISABLE 86 | falling_edge: INCREMENT 87 | internal_filter: 50us 88 | update_interval: 60s 89 | #buckets = pulses 90 | #mm_per_bucket=0.2794 91 | #rain = buckets*0.2794 92 | filters: 93 | # - multiply: 0.2794 94 | # - multiply: 60 (to get mm/h) 95 | - multiply: 16.764 96 | - sliding_window_moving_average: 97 | window_size: 60 98 | send_every: 1 99 | 100 | - platform: integration 101 | name: "Total Daily Rain" 102 | unit_of_measurement: 'mm' 103 | sensor: my_rain 104 | id: my_total_rain 105 | time_unit: h 106 | icon: 'mdi:weather-rainy' 107 | accuracy_decimals: 2 108 | # # x60 To convert to aggregated rain amount (was 60) 109 | #. # not needed if mm/h is the input 110 | # filters: 111 | # - multiply: 60 112 | 113 | - platform: dallas 114 | address: 0x750517B15C1CFF28 115 | name: 'Temperature air' 116 | 117 | binary_sensor: 118 | - platform: template 119 | device_class: moisture 120 | # rain detector 121 | name: "Rain detector" 122 | id: my_rain_detector 123 | filters: 124 | - delayed_off: 10min #wait 10min without rain before setting to off 125 | lambda: |- 126 | if (id(my_rain).state > 0.1) { 127 | //it is raining 128 | return true; 129 | } else { 130 | // no rain 131 | return false; 132 | } 133 | 134 | # Enable time component to reset energy at midnight 135 | time: 136 | # - platform: sntp 137 | # id: my_time 138 | - platform: homeassistant 139 | id: homeassistant_time 140 | on_time: 141 | - seconds: 0 142 | minutes: 0 143 | hours: 0 144 | then: 145 | - sensor.integration.reset: my_total_rain 146 | --------------------------------------------------------------------------------