Hydreon RG-15 rain sensor

Thanks for the answer! I have a sensitivity of 0.02mm but it sends this false positive value! And sometimes even more! Even so, when the sun is intense and there are no clouds, it reports this false positive

Hello @daniloortodontia yes I forgot the sensitivity levels are 0.2mm and 0.02mm. I suggest you investigate switching to 0.2mm and reposition the device.

In addition, if you are receiving a single “false positive” i.e. 0.02mm then I have noticed that the RG-15 does not create a rain event. I have also noticed that 0.02mm is so sensitive that if you are planning on automations set by the rain sensor intensity then I have created a template to filter out “noise/ dampness etc”

        
- sensor:
    - name: "Rain State"
      state: >
        {% if states('sensor.tub_pit_rain_intensity') | float > 0.1 %}
          Raining
        {%- else -%}
          Dry
        {%- endif %}

Thanks for the answer!
The RG-15 creates the rain-avoidance sensor! And also the false positive comes even in dry weather! no humidity! Already set it to 0.2mm, the false positive still comes!

I noticed here that when I disabled the “device_class: precipitation_intensity” code in the rain intensity sensor it no longer gave a false positive

I was tricked! LOL! Still having false positives on rain intensity!

need some advice on how to connect the sensor correctly. I read through so many pages now and am shure that the ESP32 → RG-15 is correct 
 but still can not connect to the sensor. so here is my table:

Pin1 → GND
Pin2 → 5V
Pin4 → RX
Pin5 → TX

Running ESPHome 2023.12.9
with config:

 # Example RG-15 entry

uart:
  rx_pin: GPIO16
  tx_pin: GPIO17
  baud_rate: 9600

sensor:
  - platform: hydreon_rgxx
    model: "RG_15"
    update_interval: 60s
    acc:
      name: "rain"
    event_acc:
      name: "rain event"
    total_acc:
      name: "rain total"
    r_int:
      name: "rain intensity"   

powering up the ESP32 the RG-15 LED flash 3 times green.

looking into the log I get either:

[18:44:33][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 3 times
[18:44:34][D][api:102]: Accepted 192.168.0.118
[18:44:34][D][api.connection:1121]: Home Assistant 2024.2.1 (192.168.0.118): Connected successfully
[18:44:38][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 4 times
[18:44:43][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 5 times
[18:44:43][E][hydreon_rgxx.sensor:142]: hydreon_rgxx can't boot, giving up
[18:44:43][D][sensor:094]: 'rain': Sending state nan mm with 2 decimals of accuracy
[18:44:43][D][sensor:094]: 'rain intensity': Sending state nan mm/h with 2 decimals of accuracy
[18:44:43][D][sensor:094]: 'rain event': Sending state nan mm with 2 decimals of accuracy
[18:44:43][D][sensor:094]: 'rain total': Sending state nan mm with 2 decimals of accuracy
[18:44:43][E][component:113]: Component hydreon_rgxx.sensor was marked as failed.

or:

[18:52:35][C][uart.arduino_esp32:138]:   TX Pin: GPIO17
[18:52:35][C][uart.arduino_esp32:139]:   RX Pin: GPIO16
[18:52:35][C][uart.arduino_esp32:141]:   RX Buffer Size: 256
[18:52:35][C][uart.arduino_esp32:143]:   Baud Rate: 9600 baud
[18:52:35][C][uart.arduino_esp32:144]:   Data Bits: 8
[18:52:35][C][uart.arduino_esp32:145]:   Parity: NONE
[18:52:35][C][uart.arduino_esp32:146]:   Stop bits: 1
[18:52:35][C][hydreon_rgxx.sensor:016]: hydreon_rgxx:
[18:52:35][E][hydreon_rgxx.sensor:018]: Connection with hydreon_rgxx failed!
[18:52:35][C][hydreon_rgxx.sensor:020]:   Update Interval: 60.0s
[18:52:35][C][hydreon_rgxx.sensor:027]:   "Acc " 'rain'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Device Class: 'precipitation'
[18:52:35][C][hydreon_rgxx.sensor:027]:     State Class: 'measurement'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Unit of Measurement: 'mm'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Accuracy Decimals: 2
[18:52:35][C][hydreon_rgxx.sensor:027]:   "RInt " 'rain intensity'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Device Class: 'precipitation_intensity'
[18:52:35][C][hydreon_rgxx.sensor:027]:     State Class: 'measurement'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Unit of Measurement: 'mm/h'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Accuracy Decimals: 2
[18:52:35][C][hydreon_rgxx.sensor:027]:   "EventAcc " 'rain event'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Device Class: 'precipitation'
[18:52:35][C][hydreon_rgxx.sensor:027]:     State Class: 'measurement'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Unit of Measurement: 'mm'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Accuracy Decimals: 2
[18:52:35][C][hydreon_rgxx.sensor:027]:   "TotalAcc " 'rain total'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Device Class: 'precipitation'
[18:52:35][C][hydreon_rgxx.sensor:027]:     State Class: 'total_increasing'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Unit of Measurement: 'mm'
[18:52:35][C][hydreon_rgxx.sensor:027]:     Accuracy Decimals: 2
[18:52:35][C][hydreon_rgxx.sensor:030]: disable_led: FALSE

any hint on what is wrong? and where do i find the firmware of the RG-15?

Hello I have the RG-15 with ESP32. Installed 6 months ago and worked flawlessly 
 lets see if I remember.

The RG-15 firmware is on the RG-15. It is not configurable other than the dip switches.

Your GPIO assignments are exactly the same as me and I have Pin2 powered from a GOOD power supply. GND and 5v are shared with the ESP32.

How about swapping rx and tx around. It is not clear which way around it is from the manual, and RX on one end is TX on the other!

1 Like

found one missmatch as i conneced the Pin4 / 5 to TXD/RXD marked pins on the ESP32 instead to GIPO16/17:
I used as well an external power supply for the RG-15 sensor.

output looks like this:

[21:58:40][I][hydreon_rgxx.sensor:277]: Got unknown line: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffrlm\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xff\xdf\xff\xff\xdb\xff\xff\xff\xff\xff\xff\xff\xdb\xff\xff\xff\xff\xff\xff
[21:58:40][D][api:102]: Accepted 192.168.0.118
[21:58:41][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 2 times
[21:58:41][I][hydreon_rgxx.sensor:277]: Got unknown line: \xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xfd\xdb\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\xebK\xfa\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff\xdb\xff\xff\xff\xff\xff\xfb\xff\xff\xff\xfb\xff
[21:58:46][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 3 times
[21:58:48][I][hydreon_rgxx.sensor:277]: Got unknown line: \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x97\xb0\xff\xff\xff\xff\xff\xff\xff\xff\xfferlﱜ\xdd\xf9\xeb)\xe1.\xeb\xeb\xffow
[21:58:51][D][hydreon_rgxx.sensor:169]: Received empty line
[21:58:51][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 4 times
[21:58:53][I][hydreon_rgxx.sensor:277]: Got unknown line: )\xe1\xeb\xeb)g
[21:58:56][W][hydreon_rgxx.sensor:137]: hydreon_rgxx failed to boot 5 times
[21:58:56][E][hydreon_rgxx.sensor:142]: hydreon_rgxx can't boot, giving up

I believe you need same GND for both devices. Otherwise the reference point (GND) is mismatched

1 Like

And swap tx and rx. At least error message has changed!

Thanks to your hints I got it running.

same GND for ESP and RG-15
TX and RX connected correct

thnaks a lot.

1 Like

Hello,
my KEMO rain sensor is broken and I would like to replace it with a Hydreon RG-XX.

I have a LAN cable on the roof, which currently supplies the Kemo Senso with 12v and is connected to an LCN-BU4L (binary sensor) via two additional wires.

Which RG-xx can I use to replace the old Kemo in the first step?

And is it possible to do more with the wiring later (when I have time)? So how do I connect an ESP in the house in the utility room?

Best wishes

Jörg

Ok, I couldn’t wait any longer :joy:
I’ve now ordered an esp32 and an rg-15, I hope I can get it to work somehow (I don’t have any experience with the esp32 and esphome yet) I would be very happy about any links for beginners :slight_smile:

Do keep asking questions. Couple of things:

  1. You need a really good stable power supply.
  2. Keep the run between RG15 and ESP32 short. Mine is 1.5m. I built a water proof case and installed outdoors.
  3. If you use Cat cable then shielding is great but a twisted pair is not good for the data run. Use both sides of the pair.
  4. GND for both ESP32 and RG15 must be the same.

The yaml is on the ESPHome website. Good luck

1 Like

Hi Julian,
Thanks for your answer, I already have a question about the wiring:
Which PIN do I have to connect something to now? Further up it says something about PIN 4/5 and then something about GIPO16/17?
I think the minus cable from my power supply has to go to some GND pin and the plus cable to the 5v pin, right?
But where do the cables from the RG-15 go?

You need to have infront of you

  1. Pin guide

Not all pins are equal or usable. I used a spreadsheet because I have used a lot of pins for different sensors so sometimes you need to plan out what is available

  1. Wiring diagram for RG15. This tells you what is needed. Read this thread and you can start to plot out a wiring diagram. Write it down to avoid confusion

Here is my ESPHome configuration, but with a D1 Mini Pro:

external_components:
  - source:
      type: git
      url: https://github.com/bkaufx/esphome
    components: [web_server_base]

esphome:
  name: riego-1

esp8266:
  board: d1_mini_pro
  early_pin_init: False

# Enable logging
logger:
# Disable logging on com-port
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ota:
  password: "ppppppppppppppppppppppppppppp"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
# Optional manual IP
  manual_ip:
    static_ip: 192.168.8.158
    gateway: 192.168.8.1
    subnet: 255.255.255.0
#    dns1: 192.168.178.1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Riego-1 Fallback Hotspot"
    password: "pppppppppppppppppp"

captive_portal:

web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time

# Reserved for rain sensor (Hydreon Rg-15)
uart:
  id: uart_bus
  tx_pin: GPIO1 
  rx_pin: GPIO3 
  baud_rate: 9600

switch:
  - platform: gpio
    name: "Relay 1"
    pin: D1
    # Stellt sicher, dass die Relais beim neustart des ESPs ausgeschaltet sind
    restore_mode: ALWAYS_OFF
    id: riego_zone1_valve
    # Schaltet sicherheitshalber den GPIO-Switch nach 16 Minuten aus. Im Bedarfsfall die Dauer anpassen ;)
    on_turn_on:
    - delay: 960s
    - switch.turn_off: riego_zone1_valve
  - platform: gpio
    name: "Relay 2"
    pin: D2
    restore_mode: ALWAYS_OFF
    id: riego_zone2_valve
    # Schaltet sicherheitshalber den GPIO-Switch nach 16 Minuten aus. Im Bedarfsfall die Dauer anpassen ;)
    on_turn_on:
    - delay: 960s
    - switch.turn_off: riego_zone2_valve
  - platform: gpio
    name: "Relay 3"
    pin: D3
    restore_mode: ALWAYS_OFF
    id: riego_zone3_valve
    # Schaltet sicherheitshalber den GPIO-Switch nach 16 Minuten aus. Im Bedarfsfall die Dauer anpassen ;)
    on_turn_on:
    - delay: 960s
    - switch.turn_off: riego_zone3_valve
  - platform: gpio
    name: "Relay 4"
    pin: D5
    restore_mode: ALWAYS_OFF
    id: riego_zone4_valve
    # Schaltet sicherheitshalber den GPIO-Switch nach 16 Minuten aus. Im Bedarfsfall die Dauer anpassen ;)
    on_turn_on:
    - delay: 960s
    - switch.turn_off: riego_zone4_valve
  - platform: gpio
    name: "Relay 5"
    pin: D7
    restore_mode: ALWAYS_OFF
    id: riego_zone5_valve
    # Schaltet sicherheitshalber den GPIO-Switch nach 3 Minuten aus. Im Bedarfsfall die Dauer anpassen ;)  
    on_turn_on:
    - delay: 180s
    - switch.turn_off: riego_zone5_valve

sensor:
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"

  - platform: hydreon_rgxx
    uart_id: uart_bus
    model: "RG_15"
    update_interval: 60s
    acc:
      name: "rain"
    event_acc:
      name: "rain event"
    total_acc:
      name: "rain total"
    r_int:
      name: "rain intensity"

button:
  - platform: restart
    name: "BewÀsserung neu starten"    

binary_sensor:
  - platform: status
    name: "BewÀsserung Status"       

I’m using that for my irrigation component that also operates the valves for watering the plants. Ignore the external component that fixes a temporary bug.

1 Like

Hi,
Now I have installed the RG-15
I have the DIP Switches 1 & 2 set to 1 for unit and High resolution.
Today we have light rain, but the RG-15 did not detect the rain.
With more rain it works. What could be the problem ?

Here ist meine yaml:

  device_name: regensensor-esp
  device_description: "Regensensor Hydreon RG-15"
  friendly_name: "Regensensor ESP"

esphome:
  name: '${device_name}'
  comment: '${device_description}'
  friendly_name: ${friendly_name}
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:

# Allow provisioning Wi-Fi via serial
improv_serial:

wifi:
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Rainsensor Fallback Hotspot"
    password: !secret wifi_password

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
  import_full_config: true

# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
  authorizer: none

# To have a "next url" for improv serial
web_server:

# Example RG-15 entry

uart:
  rx_pin: GPIO16
  tx_pin: GPIO17
  baud_rate: 9600
time:
  - platform: homeassistant
    id: homeassistant_time
    
binary_sensor:
  - platform: status
    name: "Status"

text_sensor:
  - platform: version
    name: "ESPHome Version"
  - platform: wifi_info
    ip_address:
      name: "IP"
    ssid:
      name: "SSID"
    bssid:
      name: "BSSID"
  - platform: template
    name: "RegeninstensitÀt Klasse"
    id: ric
    icon: mdi:water-outline

sensor:
  - platform: uptime
    name: "Uptime"
  - platform: wifi_signal
    name: "WiFi Signal"
  - platform: hydreon_rgxx
    model: "RG_15"
    update_interval: 10s
    acc:
      name: "Regen"
    event_acc:
      name: "Regen event"
    total_acc:
      name: "Regen total"
    r_int:
      name: "RegenintensitÀt"
      id: rain_int
      device_class: precipitation_intensity
      # https://en.wikipedia.org/wiki/Rain#Intensity
      on_value:
        - if:
            condition:
              sensor.in_range:
                id: rain_int
                below: 0.00001
            then:
              - text_sensor.template.publish:
                  id: ric
                  state: "Kein Regen"
        - if:
            condition:
              sensor.in_range:
                id: rain_int
                above: 0.00001
                below: 2.5
            then:
              - text_sensor.template.publish:
                  id: ric
                  state: "SprĂŒhregen"
        - if:
            condition:
              sensor.in_range:
                id: rain_int
                above: 2.5
                below: 7.6
            then:
              - text_sensor.template.publish:
                  id: ric
                  state: "Regen"                
        - if:
            condition:
              sensor.in_range:
                id: rain_int
                above: 7.6
                below: 50
            then:
              - text_sensor.template.publish:
                  id: ric
                  state: "Starkregen" 
        - if:
            condition:
              sensor.in_range:
                id: rain_int
                above: 50
            then:
              - text_sensor.template.publish:
                  id: ric
                  state: "Sehr Starker Regen"             

Could the Problem be that I found this in the Log (2 decimals) ?

[09:28:19][D][sensor:094]: 'Regen': Sending state 0.00000 mm with 2 decimals of accuracy

I don’t think so, i get the same messages from the device.
I don’t remember how i set the DIP-switch and can not check because i’m in Germany and the sensor is in Spain, but i’m pretty sure i have set them like you did.

The rain from yesterday:


Lowest value was 0.07.

Hi JĂŒrgen,
thanks for your answer.
0,07 is also 2 decimals :wink:
I’ve now changed it to 4 decimal places.

    acc:
      name: "Regen"
      accuracy_decimals: 4

Unfortunately, this super light rain has now stopped. Hope it comes again today :slight_smile: