SolarWS icon indicating copy to clipboard operation
SolarWS copied to clipboard

Raining when deep_sleep

Open qnixAVA opened this issue 2 years ago • 5 comments

Hello I'm building my solar weather station, but i'm stuck. I wanted to know if anyone got an idea to wake up the esp32 when the rain bucket works. I manage to wake up my ESP every time I switch on my rain gauge, but the wake-up time is too long for the precipitation to be added to my rain_meter. When my esp woke up, the rain meter already gone high

If anyone got solution..

Thanks a lot

qnixAVA avatar Jan 07 '24 15:01 qnixAVA

I'm sure you have solved it by now but if you haven't... As the board will be asleep you could do several things based on Home Assistant and the deep sleep timer:

  • Wake it up more often to quickly check and wait say 30 sec or 1 min for the bucket to tip. If the bucket tips then turn off deep sleep bool.
  • Use a third party weather provider in Home Assistant and if it is raining then turn off deep sleep.

If it is mission critical that the board is awake ASAP then maybe use the bucket pin to wake it up: Youtube

teamsuperpanda avatar Mar 09 '24 21:03 teamsuperpanda

Hello, thank you for your reply, I did indeed succeed, although it's not extremely precise. I use the GPIO of my rain gauge as an alarm clock, with a binary sensor with delayed_on 10m. In the event of heavy rain, the esp will be woken by the rain gauge and as long as the binary sensor remains on, deep_sleep is prevented. This solution works in the event of heavy rain, but the 0.3mm of rain on waking will never be counted in the counter... Thanks for your answer.

Translated with DeepL.com (free version)

qnixAVA avatar Mar 10 '24 09:03 qnixAVA

I'd be curious to have a look at the code if you have it handy

teamsuperpanda avatar Mar 10 '24 22:03 teamsuperpanda

script:

  • id: consider_deep_sleep mode: queued then:
    • delay: 30s
    • if: condition: or: - binary_sensor.is_on: prevent_deep_sleep - binary_sensor.is_on: GPIO13_rain then: - logger.log: 'Skipping sleep, per prevent_deep_sleep' - deep_sleep.prevent: deep_sleep_control else: - deep_sleep.enter: deep_sleep_control
    • script.execute: consider_deep_sleep

binary_sensor:

  • platform: status name: "esp32stationmeteo_status"

  • platform: homeassistant id: prevent_deep_sleep name: "Prevent Deep Sleep" entity_id: input_boolean.prevent_deep_sleep

  • platform: gpio id: GPIO13_rain pin: number: GPIO13 mode: INPUT_PULLUP inverted: True name: "Rain Meter GPIO13" filters:

    • delayed_off: 10min

deep_sleep: id: deep_sleep_control run_duration: default: 30s gpio_wakeup_reason: 30s sleep_duration: 120s wakeup_pin: number: GPIO13 inverted: true mode: input: true pullup: true

qnixAVA avatar Mar 11 '24 12:03 qnixAVA

@qnixAVA : Are you happy with the solution? I'm considering ordering the MS-WH-SP-RG (I don't need the other things). Here I primary thinks about the deep-sleep logics you've implemented.

Another solution would be to have another chip counting the "pulses", with extreme low power consumption, and just reading the output of that, instead.

exetico avatar Aug 11 '24 09:08 exetico