Apparently nothing is wrong with the OP, maybe I configured something wrong, now it works. I also set up the utility meter to your suggestion and its great:
Now I did some manual testing, is there a way to reset the daily rainfall and delete its recordings?
I changed one small thing in the original post, maybe that was the cause
Actually I was testing yesterday as well and I found out it’s pretty hard to reset this daily sensor. What I did was remove the states from the states table with SQL, for both the binary sensor and the daily sensor.
To reset the utility meters, use the utility_meter.reset service.
When I do that that manually configured utility_meters dont show up?! I go into yaml mode and enter their entity_ID manually but that doesnt reset them either…
OK I used the service to calibrate the utility_meters and set them to 0, so that worked. Also a good way to maybe manually subtract a certain amount of mm if you one did some manual testing
Thanks so much @parrel for sharing this project! I’ve been subscribed to it for a long time until I got some free time to work on it.
Since I don’t have an issue to have a device inside my home and put the cable throught the wall out to the device on the roof, I chose not to go with battery-powered device but rather ESP8266 running ESPHome.
The installation was simple - I’ve connected the red cable from the device to D7 and green to GND and I’ve configured the device like below.
substitutions:
device_name: rainfall-sensor
friendly_name: Rainfall sensor
esphome:
name: "${device_name}"
platform: ESP8266
board: d1_mini
wifi:
ssid: !secret wifi_not_ssid
password: !secret wifi_not_password
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "${friendly_name} AP"
password: !secret wifi_not_password
status_led:
pin:
number: GPIO2 #D4 #BUILTIN_LED
inverted: True
captive_portal:
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
password: !secret api_ota_password
ota:
password: !secret api_ota_password
time:
# Sync RTC time with HA
- platform: homeassistant
id: homeassistant_time
binary_sensor:
# HA sensor showing if device is connected
- platform: status
device_class: connectivity
name: "${friendly_name} Status"
- platform: gpio
name: "${friendly_name} Raindrops sensor"
pin:
number: D7
inverted: true
mode: INPUT_PULLUP
sensor:
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
update_interval: 60s
# Reports how long the device has been powered (in seconds) since last reboot
- platform: uptime
id: sensor_uptime
name: "${friendly_name} Uptime Seconds"
icon: mdi:clock-outline
update_interval: 60s
- platform: uptime
name: "${friendly_name} Uptime Sensor"
id: uptime_sensor
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
text_sensor:
# Sensor with esphome version and fw build time
- platform: version
name: "${friendly_name} Version"
# Extra wifi info from device
- platform: wifi_info
ip_address:
name: "${friendly_name} IP"
ssid:
name: "${friendly_name} SSID"
bssid:
name: "${friendly_name} BSSID"
# Uptime text sensor which is updated by the sensor id: uptime_sensor
- platform: template
name: "${friendly_name} Uptime"
id: uptime_human
icon: mdi:clock-start
entity_category: diagnostic
button:
- platform: restart
name: "${friendly_name} Restart"
Then in the HA I’ve followed your guideline and created the counting and trend sensors. I’ve just added also the intensity sensor. I’m looking forward for the first rain!
This is brilliant! However I cant get my aqara door sensors to work reliable wirh my tasmota flashed sonoff zigbee bridge and HA i get them connected but they become unresponsive after a whole, so I doubt this will be working for me
As long as the binary sensor works properly, it should work the same as the aqara sensor.
If it doesn’t, you’re probably able to tweak it with all the settings that EPSHome provides
It seems this happens for all zigbee sensors. They go to unavailable, then back to the last state. As a result, my automations run after a restart, same as with the rain sensor. There must be a more elegant solution then having to create inverted triggers for all (don’t get me wrong, great solution, but not sure i want to create one for every zigbee sensor.
Maybe for regular automations one would trigger on a state but not unavailable, and for something like this an inverted sensor would be the solution.