Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new field "srain_piezo" #200

Open
janchrillesen opened this issue Sep 25, 2024 · 4 comments
Open

Add new field "srain_piezo" #200

janchrillesen opened this issue Sep 25, 2024 · 4 comments

Comments

@janchrillesen
Copy link

The latest software for the gateway introduces a new field "srain_piezo" - see home-assistant/core#125850

This causes Home Assistant to log the following entry

2024-09-25 14:16:29.726 WARNING (MainThread) [aioecowitt.server] Unhandled sensor type srain_piezo value 0
2024-09-25 14:17:00.726 WARNING (MainThread) [aioecowitt.server] Unhandled sensor type srain_piezo value 0

@smuliv
Copy link

smuliv commented Sep 28, 2024

same here:

Logger: aioecowitt.server
Quelle: components/ecowitt/__init__.py:30
Erstmals aufgetreten: 03:09:38 (16 Vorkommnisse)
Zuletzt protokolliert: 03:11:53

Unhandled sensor type srain_piezo value 1

found in:

    "raw": {
      "__type": "<class 'multidict._multidict.MultiDict'>",
      "repr": "<MultiDict('stationtype': 'GW2000A_V3.1.5', 'runtime': '787112', 'heap': '113008', 'dateutc': '2024-09-27 17:22:59', 'tempinf': '71.96', 'humidityin': '62', 'baromrelin': '29.911', 'baromabsin': '27.309', 'tempf': '54.14', 'humidity': '99', 'winddir': '242', 'windspeedmph': '1.12', 'windgustmph': '2.68', 'maxdailygust': '9.84', 'solarradiation': '0.00', 'uv': '0', 'rrain_piezo': '0.000', 'erain_piezo': '0.976', 'hrain_piezo': '0.000', 'drain_piezo': '0.976', 'wrain_piezo': '1.331', 'mrain_piezo': '6.106', 'yrain_piezo': '29.760', 'ws90cap_volt': '2.7', 'ws90_ver': '143', 'srain_piezo': '0', 'temp8f': '61.52', 'batt8': '0', 'wh90batt': '3.06', 'freq': '868M', 'model': 'GW2000A', 'interval': '8')>"
    },

@smuliv
Copy link

smuliv commented Sep 28, 2024

if someone is interested in creating a pr here are the needed changes.
i will post this also in home-assistant/core#125850, because the integration needs a change too.

in aioecowitt lib:

calc.py:

***************
*** 151,156 ****
--- 151,158 ----
      if "yrain_piezo" in data:
          data["yrain_piezo"] = float(data["yrain_piezo"])
          data["yrain_piezomm"] = round(data["yrain_piezo"] * in_mm, 1)
+     if "srain_piezo" in data:
+         data["srain_piezo"] = int(data["srain_piezo"])
  
      # Pressure
      if "baromrelin" in data:

sensor.py:

***************
*** 77,82 ****
--- 77,83 ----
      LUX = 28
      PERCENTAGE = 29
      SOIL_RAWADC = 30
+     RAIN_STATE = 31
  
  
  @dataclass
***************
*** 442,447 ****
--- 443,449 ----
      "yrain_piezo": EcoWittMapping(
          "Yearly Rain Rate Piezo", EcoWittSensorTypes.RAIN_COUNT_INCHES
      ),
+     "srain_piezo": EcoWittMapping("Rain State Piezo", EcoWittSensorTypes.RAIN_STATE),
      "rrain_piezomm": EcoWittMapping("Rain Rate Piezo", EcoWittSensorTypes.RAIN_RATE_MM),
      "erain_piezomm": EcoWittMapping(
          "Event Rain Rate Piezo", EcoWittSensorTypes.RAIN_COUNT_MM

in ecowitt integration:

binary_sensor.py:

***************
*** 26,31 ****
--- 26,34 ----
          device_class=BinarySensorDeviceClass.BATTERY,
          entity_category=EntityCategory.DIAGNOSTIC,
      ),
+     EcoWittSensorTypes.RAIN_STATE: BinarySensorEntityDescription(
+         key="RAIN_STATE", device_class=BinarySensorDeviceClass.MOISTURE
+     ),
  }

@de-Techneut
Copy link

de-Techneut commented Oct 30, 2024

Would like to know what the state is of this issue.

My log is still getting filled with this alarm.

Logger: aioecowitt.server
Source: components/ecowitt/__init__.py:30
First occurred: 14:52:58 (1448 occurrences)
Last logged: 14:52:58

Unhandled sensor type srain_piezo value 0

@mehuman
Copy link

mehuman commented Dec 12, 2024

Is this related to the binary Rain sensor I'm seeing? Was looking through the code trying to find the logic since my sensor has been in the state of on for 14 hours.
Screenshot from 2024-12-12 13-05-22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants