Homematic IP weather station - rain sensor - change zeroing time

Hi

I have a weathersensor plus. The problem is that the rain sensor zeros at 0700. So following situation arises:

It rains 10mm on day x and stops at 2200. Max value on day x is 10mm. Then on day y it does not rain at all. But since the sensor zeros on 0700 on day y I get max value 10mm (from day x) for day y (instead of 0mm).

I think there might the possibility to use scirpts to change zeroing from 0700 to 0000. With the integrated script editor in HASS I can get to the point where I should start writing commands. But I have trouble finding relevant information on how to do this. Has anyone ever tried this or can point me to where I might get help?

Thanks
akrea

1 Like

I don’t know that specific device, but I would actually look if it is possible to configure the device itself to do this at a different time. I’m pretty sure it’s not Home Assistant that’s doing this, so ideally it should also not work around the problem if there is a better solution. Thinking of devices like thermostats or energy-meters, it’s usually possible to program the devices directly. In case of HomeMatic that would be on the CCU to which you have paired it. Take a look of you find anything related in the settings of the device.

Thanks for your answer. For the ease of use (for the level I need it except the rain sensor) I use the AccessPoint of HomematicIP and not CCU2. The AccessPoint does not provide the possibilities of the CCU2. Hence my approach with the script.

But it still should provide some way of configuring the devices. If we take a switch with energy measuring for example, it would be a huge loss of functionality if it wasn’t possible to configure energy prices etc… Or the weekly programs of a thermostat. Since I don’t own the device I can’t really make statements about this. But other devices I had access to typically provided quite some options for the devices. Hiding those options from people that use the Access Point seems odd to me. :thinking:

I already talked to eQ-3 about the zeroing time, and they told me it 's not possible to change, and will not be changeable in the future. I don’t know if it can be controlled by a CCU, but it’s definitly not controllable by an AP.

If they told you it’s not possible, then it doesn’t matter if it’s the AP or CCU. They seem to have hardcoded that value. So I guess you have no other choice than figuring out some workaround.

Okay, so I’ve got the “Wetterstation Pro”, which I think might be your device?
I just worked on that issue for a few hours and figured it out:
Since I’m running RaspberryMatic on my CCU3, this might not apply to you.

Go to “Programs and connections” in the top bar -> Programs and RaspMatic connections
On the bottom bar, click on “Show intrinsic programs”
There is now a program showing up called “prgDailySunshineRainCounter_1588”, edit it and change the trigger time to 0:00.

As far as fetching the value is concerned, I’ve found that the auto-discovered entity just keeps counting up. You have to create a template sensor and get the “svHmIPRainCounterToday_1588” attribute from your CCU.

1 Like

Thank you for this hint! I´m trying to set up a template sensor as described in the docs with the rain today value (which i found in the properties of homematic.ccu) but the state of my sensor remains “unknown”. This is my code:

- platform: template
    sensors:
      raintoday:
       value_template: "{{ states('SvHmIPRainCounterToday_5146') }}"
       entity_id: homematic.ccu3
       friendly_name: 'Rain Today'

Could you advise?

Your sensor config is invalid.
Take a look at the docs for template sensors.
You probably want sth. like this:

rain_today:
      friendly_name: "rain today"
      icon_template: 'mdi:weather-rainy'
      value_template: "{{ state_attr('homematic.ccu3', 'SvHmIPRainCounterToday_5146') }}"
      unit_of_measurement: 'mm'
1 Like

Thanks a lot! I already tried it in a similar way but changed it back because my mistake was that i was using 'SvHmIPRainCounterToday_5146' instead of 'svHmIPRainCounterToday_5146' …the capital “S” in the UI guessed the wrong way… :see_no_evil:

Now it´s working as expected and i learned to always verify IDs on script level! :wink:

Great to see you solved the topic on HmIP level - had to do the same but found that the reset is not really … “reliable”.

So I wanted to share two sensors I created to measure the rain count for a single day / a single rain happening. All without automations - only template sensors based on triggers:

RAIN TODAY:

template:

  - trigger:
      #offset sensor which stores the state of 'rain_counter' every day at midnight for calculation later
      - platform: time_pattern
        hours: 0
        minutes: 0
    sensor:
      - name: hmip_swo_pl_XXXXXXXXXXXX_rain_today_offset
        state: "{{ float(states('sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_counter'),0) }}"
        unit_of_measurement: "mm"

  - trigger:
      #sensor which stores the rain count today
    - platform: state
      entity_id:
        - sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_counter
        - sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_today_offset
    sensor:
      - name: hmip_swo_pl_XXXXXXXXXXXX_rain_today_counter
        state: "{{ float(states('sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_counter'),0) - float(states('sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_today_offset'),0) }}"
        unit_of_measurement: "mm"

CURRENT RAIN:

template:

  - trigger:
      #offset sensor which stores the state of 'rain_counter' whenever it stops raining for later calculation
    - platform: state
      entity_id:
        - binary_sensor.hmip_swo_pl_XXXXXXXXXXXX_raining
      from: 'on'
      to: 'off'
    sensor:
      - name: hmip_swo_pl_XXXXXXXXXXXX_rain_last_offset
        state: "{{ float(states('sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_counter'),0) }}"
        unit_of_measurement: "mm"

  - trigger:
      #sensor which stores the rain count of current raining
    - platform: state
      entity_id:
        - sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_counter
    sensor:
      - name: hmip_swo_pl_XXXXXXXXXXXX_rain_last_counter
        state: >-
            {% if states('binary_sensor.hmip_swo_pl_XXXXXXXXXXXX_raining') == 'on' %}
              {{ float(states('sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_counter'),0) - float(states('sensor.hmip_swo_pl_XXXXXXXXXXXX_rain_last_offset'),0) }}
            {% else %}
              {{ states('hmip_swo_pl_XXXXXXXXXXXX_rain_last_counter') }}
            {% endif %}
        unit_of_measurement: "mm"