WD Clientraw - NEW weather component

Hi everyone,
i wrote a simple weather component to read clientraw.txt file that some weather stations generate ie. Davis Vantage PRO 2 and many others so i thought somebody finds it useful too. I basically took YR component and tweaked it to suite this platform so it stayed async.

I created a redme in style of all other official components so it should be easy to integrate. https://github.com/pilotak/Home-AssistantConfig/tree/master/custom_components/sensor

6 Likes

I’m pleased I found this article to setup a connection between my weather display and HassbianPi. Hovever I’m somewhat uncertain what to do. In order to get it work, am I correct that I need to upload attributes.py and clientraw.py into <config_dir>/custom_components/sensor? Followed by reference into configuration.yaml.
Appreciate yr guidance how to setup.
Rgds
Dick

Hi @Bergerie you only need to upload clientraw.py so the full path of file would be <config_dir>/custom_components/sensor/clientraw.py

Thanks a lot. Just to clarify. Am I correct that homeassistant/.homeassistan//custom_components/sensor/ does not exist by default and has to be created? Appreciate yr continued support.

where you have configuration.yaml file, create folder custom_components open that folder and create folder sensor open that folder and paste clientraw.py file

Thanks a lot, works absolutely perfect. Something to be highlighted in the Weather-Watch forum. Used to pass it on from WD to VERA to HA. Looking for ways to cut out Vera on a piece by piece basis. This one tackled successfully thanks to your clientraw platform.

Is it possible to include the true weather description like sunny,dry which is also a variable in the clientraw.txt file. I do not see immediately a possibility to translate the symbol nr. into an appropriate icon and/or description.

I’m sure it is, you more than welcome to contribute.
But i guess the quickest way for you will be probably to create a sensor.template where you have a icon_template option - as a state for this sensor use symbol sensor from my component and map it to your icon a text (take a look at readme for mapping names/icons to symbol)

Example

sensor:
  - platform: template
    sensors:
      sensor_with_icon:
        friendly_name: "sensor with icon"
        value_template: "{{ states.sensor.clientraw_symbol }}"
        icon_template: >
          {%- if (value | int) == 0 -%}
            mdi:battery-alert
          {%- elif (value | int) == 1 -%}
            mdi:battery
          {%- endif -%}

Whatever I try, I do not get any icon output. For the sake of not having to type in all the conditions, I simplified for testing purposes the last else if statement into “{%- elif (value | int) != 0 -%}”

With the proposed code, it results in the code being displayed on the front-end against “sensor with icon”. Changing the value_template into “{{ states.sensor.clientraw_symbol.state }}” delivers only the symbol number against “sensor with icon” on the front end. Can anyone identify a typo and/or syntex error in the proposed code?

Just found this and the link seems to be broken. I also have a Personal Weather Station running Weather Display and run Home Assistant. This is VERY COOL! The only issues I might have is I know the clientraw uses Celsius and not Fahrenheit.

Would someone happen to have a version that will work with US values? I would attempt to get that working.

This component can be now upgraded via custom_updater and supports metric/imperial units based on your homeassistant default settings :wink:

Hello

I am using the same to get my weather data, BUT it seems that time to time hassio is not picking up the data from the clientraw.txt file. Have check by copying the location and I receive the data in my browser.
My clientraw.txt is on my other raspberry so it is on same network.
Any ideas why?

Why don’t you make use of the mqtt feature in weather display. Works flawlessly.

Hello Bergerie,

Tried installing that and whole weewx stopped working.
This one works.