Estación meteorológica en Home Assistant

A modo de recordatorio para mí y a quien le pueda servir, incluyo la configuración para integrar la estación meteorológica Sainlogic o Easyweather WS-3500  en Home Assistant en tiempo real.

Esta es la configuración que debemos aplicar en la estación meteorológica mediante su aplicación desde el móvil. Un servidor personalizado (Customized) que será nuestra instalación de Home Assistant.

Después, en HA, en el fichero de configuration.yaml debemos incluir el siguiente código:

template:
  - trigger:
    - platform: webhook
      webhook_id: pws
    sensor:
      #
      # --------------------------------------------------------------------------------
      #
      # Temperature
      - name: "PWS - Temperatura"
        device_class: temperature
        state: "{{ ((trigger.data.tempf | float - 32) / 1.8) | round(1) }}"
        unit_of_measurement: "°C"
      - name: "PWS - Temperatura (indoor)"
        device_class: temperature
        state: "{{ ((trigger.data.tempinf | float - 32) / 1.8) | round(1) }}"
        unit_of_measurement: "°C"
      #
      # --------------------------------------------------------------------------------
      #
      # Humidity
      - name: "PWS - Humedad"
        device_class: humidity
        state: "{{ trigger.data.humidity }}"
        unit_of_measurement: "%"
      - name: "PWS - Humedad (indoor)"
        device_class: humidity
        state: "{{ trigger.data.humidityin }}"
        unit_of_measurement: "%"
      #
      # --------------------------------------------------------------------------------
      #
      # Barometer
      - name: "PWS - Barometro (relativa)"
        device_class: pressure
        state: "{{ (trigger.data.baromrelin | float * 33.86) | round(1) }}"
        unit_of_measurement: "hPa"
      - name: "PWS - Barometro (absoluta)"
        device_class: pressure
        state: "{{ (trigger.data.baromabsin | float * 33.86) | round(1) }}"
        unit_of_measurement: "hPa"
      #
      # --------------------------------------------------------------------------------
      #
      # Rain
      - name: "PWS - Velocidad Lluvia"
        state: "{{ (trigger.data.rainratein | float * 2.54) | round(0) }}"
        unit_of_measurement: "mm/h"
      - name: "PWS - Lluvia"
        state: "{{ (trigger.data.dailyrainin | float * 2.54) | round(0) }}"
        unit_of_measurement: "mm"
      #
      # --------------------------------------------------------------------------------
      #
      # Sun
      - name: "PWS - Radiacion Solar"
        device_class: illuminance
        state: "{{ trigger.data.solarradiation }}"
        unit_of_measurement: "W/m²"
      - name: "PWS - UV"
        device_class: illuminance
        state: "{{ trigger.data.uv }}"
        unit_of_measurement: "UV Index"
      #
      # --------------------------------------------------------------------------------
      #
      # Wind
      - name: "PWS - Velocidad Viento"
        state: "{{ (trigger.data.windspeedmph | float * 0.44704) | round(1) }}"
        unit_of_measurement: "m/s"
      - name: "PWS - Rafaga Viento"
        state: "{{ (trigger.data.windgustmph | float * 0.44704) | round(1) }}"
        unit_of_measurement: "m/s"
      - name: "PWS - Direccion Viento"
        state: "{{ trigger.data.winddir }}"
        unit_of_measurement: "°"
      #
      # --------------------------------------------------------------------------------
      #
      # Misc
      - name: "PWS - Typo Estacion"
        state: "{{ trigger.data.stationtype }}"
        unit_of_measurement: ""
      #
      # --------------------------------------------------------------------------------
      #
      # Ecowitt does not support the extra information as with Wunderground, so lets calculate them
      #
      # Dewpoint
      #   https://www.ajdesigner.com/phphumidity/dewpoint_equation_dewpoint_temperature.php
      - name: "PWS - Punto Rocio"
        state: "{{ ((trigger.data.humidity | float / 100) ** (1 / 8) * (112 + 0.9 * ((trigger.data.tempf | float - 32) / 1.8)) + 0.1 * ((trigger.data.tempf | float - 32) / 1.8) - 112) | round(1) }}"
        unit_of_measurement: "°C"

Información extraída del tutorial de https://domotica.solar/

Deja una respuesta