garbled1 / homeassistant_ecowitt

Ecowitt Weather Station integration for homeassistant
Apache License 2.0
142 stars 70 forks source link

Ecowitt Wittboy not showing rainfall sensor in home assistant #122

Open Icello1 opened 2 years ago

Icello1 commented 2 years ago

After integrating Ecowitt Wittboy all sensors except rainfall sensor (Piezo) are shown.

Ecowitt App is showing all sensors working (including rainfall sensor)

Link to Hardware: https://shop.ecowitt.com/products/wittboy

Nicao commented 2 years ago

Same issue, the rain sensor doesn't seem to be supported

Shad0wWulf commented 2 years ago

Has anybody been able to work this out?

antonsarg commented 1 year ago

Same here, was kinda suprised not to find the rain sensor in the entities. I hope this gets fixed.

Nicao commented 1 year ago

What I am really pissed about is that ecowitt is actively marketing to be compatible with home assistant but doesn't care a damn to fix it. I contacted their support twice. No reply. Never. They even largely advertise on their packaging to be ready for home assistant but that seems a blunt lie.

PXL_20220722_154302571

antonsarg commented 1 year ago

Update: Please refer to @Shad0wWulf since this is a much better solution which I can definitely approve. The PR #109 works like a charm.

I have came up with a workaround for now. I exposed my weather station to Wunderground and setup a scrape sensor which fetches the data of my public weather station from the website. I am not really satisfied with it, because the scan interval seems to be very large and often it fetches cached data, but it should do the work until the rain sensor problem is fixed within the HA integration.

Here is what the two scrape sensors look like:

- platform: scrape
  name: Weather Station Precipitation Rate Scrape
  resource: https://www.wunderground.com/dashboard/pws/{YOUR_PWS_ID}
  select: "span.wu-unit-rainRate .wu-value"
  state_class: measurement
  unit_of_measurement: "mm/hr"

- platform: scrape
  name: Weather Station Precipitation Total Scrape
  resource: https://www.wunderground.com/dashboard/pws/{YOUR_PWS_ID}
  select: "span.wu-unit-rain .wu-value"
  state_class: measurement
  unit_of_measurement: "mm"
Shad0wWulf commented 1 year ago

I have resolved this using one of the existing PR's https://github.com/garbled1/homeassistant_ecowitt/pull/109

I found the const.py in my HA directory

For me: Home-Assistant-Core\custom_components\ecowitt

Then I took the raw copy of the .py from the PR then deleted the old, created a new const.py file and then pasted in the raw contents.

Then after removing the device and re-adding (or may of just reloaded, I forget) I had all of the sensors.

Only issue is they are in inches instead of what i have them set to which is mm. But for now its better than nothing!

image image

It would be nice if @garbled1 accepted the PR :)

Alex9779 commented 1 year ago

Rainfall sensors only work if you select "imperial" as unit for rain in the setup. I created template sensors to convert to metric:

- template:
  - sensor:
    - name: wittboy_daily_rain_rate_piezo_mm
      unique_id: 9ff9850b-7695-409a-ac4c-469988c0393b
      unit_of_measurement: mm/d
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_daily_rain_rate_piezo_in') | float * 25.4) | round(1) }}

    - name: wittboy_event_rain_rate_piezo_mm
      unique_id: 3ac81bce-286b-4429-8c8d-184da76add02
      unit_of_measurement: mm/h
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_event_rain_rate_piezo_in') | float * 25.4) | round(1) }}

    - name: wittboy_hourly_rain_rate_piezo_mm
      unique_id: da915cc3-c4f8-4467-ab41-c3621046b303
      unit_of_measurement: mm/h
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_hourly_rain_rate_piezo_in') | float * 25.4) | round(1) }}

    - name: wittboy_monthly_rain_rate_piezo_mm
      unique_id: f6c88de1-16f3-4ba2-af99-f0011c7d00b2
      unit_of_measurement: mm/m
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_monthly_rain_rate_piezo_in') | float * 25.4) | round(1) }}

    - name: wittboy_rain_rate_piezo_mm
      unique_id: 412c8b7e-2144-4e01-aead-dee9e4769955
      unit_of_measurement: mm/h
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_rain_rate_piezo_in') | float * 25.4) | round(1) }}

    - name: wittboy_weekly_rain_rate_piezo_mm
      unique_id: 20992985-b4e9-46f7-adde-9c005967b307
      unit_of_measurement: mm/w
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_weekly_rain_rate_piezo_in') | float * 25.4) | round(1) }}

    - name: wittboy_yearly_rain_rate_piezo_mm
      unique_id: e2037b3c-1664-401f-a35a-4c0aee93b5ec
      unit_of_measurement: mm/y
      state_class: total_increasing
      icon: mdi:water
      state: >-
        {{ (states('sensor.wittboy_yearly_rain_rate_piezo_in') | float * 25.49) | round(1) }}