Ecowitt2mqtt: Send data from an Ecowitt device to MQTT

Recently, @jwoodard80 tipped me off to the Ecowitt GW1000, a small device that can read RF signals from a variety of devices (such as Ambient Weather weather stations). This creates a local API for devices that would otherwise strictly communicate via a cloud API.

So, I developed ecowitt2mqtt, a small web server that receives data from the GW1000 and sends it to an MQTT broker. In addition to its standard mode (where the entire data payload is sent to a single MQTT topic), it has a mode to accommodate HASS MQTT Discovery for easy creation of entities within HASS.

It’s early days for the project, but I hope it can be useful to you!

7 Likes

I have a WS-2000 and a WS-2909 and everything has worked great! The console still displays just like always and talks to the sensor separately than this gateway so there is no conflict.

Currently it’s running as a docker container on my UnRaid server and just ticks away. The internet was spotty last night but data continues to pull into HA with no problems!

1 Like

Thank you for writing this - great job. I had almost started on writing my own but fortunately discovered yours just in time.

I have one minor behavior that I do not understand. I have ecowitt2mqtt running in docker via docker-compose. If the server restarts - in this specific scenario following a controlled shutdown initiated by UPS notify of power failure - the ecowitt2mqtt container loops endlessly reporting error 4. If I restart the container a little while after the system is up, it resumes working perfectly fine. I am assuming that this is a race condition of some kind with mosquitto, and likely the error 4 returned is an oddity in mosquitto or the library… any thoughts on this?

Glad you’re finding it useful! The behavior you mention has been logged (sort of) here: https://github.com/bachya/ecowitt2mqtt/issues/24

I haven’t had much time due to work, but this is definitely on my radar and I’ll get to it ASAP.

Check out the latest! :+1:t2:

I got the notification from github and pulled the new container. It seemed to behave in the same way following a power failure over the weekend - looping with the invalid password error. I have not had time to look at the details yet. As before, restarting the container resolved the problem. I will try to take a look this weekend to confirm that I am in fact running the new container. Any thoughts on the password error? is that a bug in the MQTT library?

Let me know once you’ve verified that you’re running the latest container (either the dev or 1.0.0 container). Please post logs, too.

This seems like a great idea but I am having zero luck trying to get this to work.

I’m running the Docker container and have enabled the HASS discovery. But I am seeing no new sensors in HA or new topics using MQTT Explorer. I’ve turned up logging to DEBUG but don’t see much.

I am beginning to wonder if there’s any traffic that’s making it from my HP2551 console, despite being configured as per the read me. But Ecowitt doesn’t really provide much in the way of debug so I am scratching my head on this one.

Is there more debug info that I can get from ecowitt2mqtt?

I’ll run you through my test setup and it’s output.

I use this docker-compose stack to spin up ecowitt2mqtt and an MQTT broker – note that the ecowitt2mqtt configuration uses DEBUG-level logging and HASS Discovery:

---
version: "3"

services:

  ecowitt2mqtt:
    container_name: ecowitt2mqtt
    environment:
      LOG_LEVEL: DEBUG
      ENDPOINT: /data/report
      HASS_DISCOVERY: "true"
      PORT: 8080
      MQTT_BROKER: vernemq
      MQTT_PORT: 1883
      MQTT_PASSWORD: password
      MQTT_USERNAME: ecowitt
    image: "bachya/ecowitt2mqtt:dev"
    ports:
      - "8080:8080/tcp"
    restart: always

  vernemq:
    container_name: vernemq
    environment:
      DOCKER_VERNEMQ_ACCEPT_EULA: "yes"
      DOCKER_VERNEMQ_USER_ECOWITT: "password"
    image: "vernemq/vernemq:1.11.0"
    ports:
      - "1883:1883/tcp"
    restart: always
    user: root

With this running, I configure the following parameters in the WS View app (per the docs):

  • Server IP/Hostname: the IP of my MacBook (where I’m testing)
  • Path: /data/report (note that this matches the environment variable above)
  • Port: 8080 (note that this matches the environment variable above)
  • Upload Interval: I use 16 seconds (which seems to be the minimum allowed)

After a moment, I start to see entries in the ecowitt2mqtt container logs. For example, each time the Ecowitt device sends a data payload to ecowitt2mqtt, I see this block of logs:

DEBUG:ecowitt2mqtt:Using arguments: Namespace(log_level='DEBUG', mqtt_broker='vernemq', mqtt_port=1883, mqtt_username='ecowitt', mqtt_password='password', mqtt_topic='', hass_discovery=True, hass_discovery_prefix=None, endpoint='/data/report', port=8080, unit_system='imperial')
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:ecowitt2mqtt:Received data from Ecowitt device: {'PASSKEY': '6962BBC665DE6D96B0F4578A5DA5CA0D', 'stationtype': 'GW1000B_V1.6.3', 'dateutc': '2020-12-17 19:51:29', 'tempinf': '41.9', 'humidityin': '38', 'baromrelin': '24.604', 'baromabsin': '24.604', 'tempf': '47.8', 'humidity': '33', 'winddir': '177', 'windspeedmph': '1.79', 'windgustmph': '4.47', 'maxdailygust': '8.05', 'solarradiation': '147.05', 'uv': '1', 'rainratein': '0.000', 'eventrainin': '0.000', 'hourlyrainin': '0.000', 'dailyrainin': '0.000', 'weeklyrainin': '0.161', 'monthlyrainin': '0.161', 'yearlyrainin': '1.000', 'totalrainin': '1.000', 'wh65batt': '0', 'freq': '915M', 'model': 'GW1000_Pro'}
DEBUG:ecowitt2mqtt:Wind Chill Temperature is only defined for temperatures at or below 50 F and wind speeds above 3 mph. (temperature: 47.8, wind speed: 2)
DEBUG:ecowitt2mqtt:Publishing according to Home Assistant MQTT Discovery standard
DEBUG:ecowitt2mqtt:Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b''
DEBUG:ecowitt2mqtt:Received CONNACK (0, 0)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m1), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/humidityin/config'', ... (341 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m2), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/humidityin/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m3), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/humidityin/state'', ... (2 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m4), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/humidity/config'', ... (333 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m5), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/humidity/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m6), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/humidity/state'', ... (2 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m7), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/winddir/config'', ... (323 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m8), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/winddir/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m9), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/winddir/state'', ... (3 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m10), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/maxdailygust/config'', ... (351 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m11), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/maxdailygust/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m12), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/maxdailygust/state'', ... (3 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m13), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/solarradiation/config'', ... (361 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m14), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/solarradiation/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m15), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/solarradiation/state'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m16), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/uv/config'', ... (316 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m17), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/uv/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m18), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/uv/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m19), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/wh65batt/config'', ... (327 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m20), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/wh65batt/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m21), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/wh65batt/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m22), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/baromabs/config'', ... (328 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m23), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/baromabs/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m24), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/baromabs/state'', ... (2 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m25), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/baromrel/config'', ... (328 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m26), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/baromrel/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m27), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/baromrel/state'', ... (2 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m28), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/dailyrain/config'', ... (340 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m29), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/dailyrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m30), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/dailyrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m31), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/eventrain/config'', ... (340 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m32), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/eventrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m33), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/eventrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m34), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/hourlyrain/config'', ... (344 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m35), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/hourlyrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m36), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/hourlyrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m37), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/monthlyrain/config'', ... (348 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m38), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/monthlyrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m39), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/monthlyrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m40), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/rainrate/config'', ... (336 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m41), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/rainrate/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m42), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/rainrate/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m43), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/totalrain/config'', ... (340 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m44), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/totalrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m45), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/totalrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m46), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/weeklyrain/config'', ... (344 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m47), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/weeklyrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m48), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/weeklyrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m49), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/yearlyrain/config'', ... (344 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m50), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/yearlyrain/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m51), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/yearlyrain/state'', ... (1 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m52), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/temp/config'', ... (321 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m53), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/temp/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m54), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/temp/state'', ... (4 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m55), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/tempin/config'', ... (329 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m56), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/tempin/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m57), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/tempin/state'', ... (4 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m58), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/dewpoint/config'', ... (337 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m59), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/dewpoint/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m60), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/dewpoint/state'', ... (4 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m61), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/feelslike/config'', ... (341 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m62), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/feelslike/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m63), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/feelslike/state'', ... (4 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m64), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/heatindex/config'', ... (341 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m65), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/heatindex/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m66), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/heatindex/state'', ... (4 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m67), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windchill/config'', ... (343 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m68), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windchill/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m69), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windchill/state'', ... (4 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m70), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windgust/config'', ... (335 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m71), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windgust/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m72), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windgust/state'', ... (3 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m73), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windspeed/config'', ... (339 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m74), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windspeed/availability'', ... (6 bytes)
DEBUG:ecowitt2mqtt:Sending PUBLISH (d0, q0, r0, m75), 'b'homeassistant/sensor/6962BBC665DE6D96B0F4578A5DA5CA0D/windspeed/state'', ... (3 bytes)
DEBUG:ecowitt2mqtt:Sending DISCONNECT
INFO:ecowitt2mqtt:Published to HASS discovery: {'humidityin': '38', 'humidity': '33', 'winddir': '177', 'maxdailygust': 8.1, 'solarradiation': '147.05', 'uv': '1', 'wh65batt': '0', 'baromabs': 24, 'baromrel': 24, 'dailyrain': 0, 'eventrain': 0, 'hourlyrain': 0, 'monthlyrain': 0, 'rainrate': 0, 'totalrain': 1, 'weeklyrain': 0, 'yearlyrain': 1, 'temp': 47.8, 'tempin': 41.9, 'dewpoint': 20.1, 'feelslike': 47.8, 'heatindex': 43.8, 'windchill': None, 'windgust': 4.5, 'windspeed': 1.8}

This output is reflected in the MQTT broker itself, as well:

It almost seems like your Ecowitt device isn’t sending data to ecowitt2mqtt. I agree that Ecowitt sadly does not give much in the way of debugging, so you may have to use something like Wireshark to see if traffic is passing from the device over your LAN.

Yup. Wireshark was my next stop too-thanks!

EDIT

I’m running all of my Docker containers on my Synology NAS, but that shouldn’t cause any issues - my MQTT server container is there too.

Actually, before I jump into the TCP layer, I may see if can send something to the Docker image using Postman or something. I just need to grab an appropriate ecowitt data message from somewhere…

Line 3 in my logs above contains a valid, complete payload as Ecowitt sends them.

1 Like

Thanks! I also pulled one off my current NODE RED implementation which uses an HTTP input node. So I used this to test:

{‘PASSKEY’: ’B101ECBC7B446BE7BEF78F22A970D0DF’,’stationtype’: ’GW1000B_V1.6.3’,’dateutc’: ’2020-12-19 00: 00: 37’,’tempinf’: ’68.9’,’humidityin’: ’42’,’baromrelin’: ’29.391’,’baromabsin’: ’29.391’,’tempf’: ’44.6’,’humidity’: ’93’,’winddir’: ’166’,’windspeedmph’: ’3.36’,’windgustmph’: ’9.17’,’maxdailygust’: ’15.88’,’solarradiation’: ’0.00’,’uv’: ’0’,’rainratein’: ’0.000’,’eventrainin’: ’1.189’,’hourlyrainin’: ’0.020’,’dailyrainin’: ’1.150’,’weeklyrainin’: ’4.449’,’monthlyrainin’: ’8.528’,’yearlyrainin’: ’22.409’,’totalrainin’: ’22.409’,’temp4f’: ’43.88’,’humidity4’: ’94’,’wh65batt’: ’0’,’batt4’: ’0’,’freq’: ’915M’,’model’: ’GW1000_Pro’}

A POST with an ecowitt message body now yields some log entries as well as new sensors in HA.

But it only creates four new topics / sensors: dewpoint, feelslike, heatindex and windchill, all of which show as “unavailable” in HA. But no numerical data otherwise. And no creation of sensors for things like temperature, pressure, wind speed etc. etc.

So, I conclude three things. My Ecowitt console isn’t managing to send any data (yet). The end point is valid and can be seen. And sending manual data results in odd results.

I will continue to investigate.

1 Like

An update. I did mange to get this working - mostly.

I’m still feeding this from the Ecowit HP2551 display console. The trick to finally get it working was to update the firmware on the unit and reconfigure the custom weather server via the app. And then the MQTT topics flowed and the sensors were created in HA. Almost.

Several sensors are missing. While I have MQTT topics for them, they didn’t autodiscover as sensors in HA. Missing are items like wind speed, wind direction. All in all, HA created 23 sensors for the 30 published topics. One possible coincidence is that all of the missing sensors have the following in the config message:

 "unit_of_measurement": null

I’m going to see if I can manually ‘force’ the creation by using MQTT Explorer to republish the config message for the missing sensors.

But forward progress is always good.

Glad to hear! That null unit issue was fixed in 1.0.7; try that and see if your missing sensors appear.

Thanks - will do.

Edit: One quick Docker update and just like that, Bam - It’s fixed.

Thanks for all of your help Aaron and have a great Christmas!

Wonderful! :pray:t2: Merry Christmas!

Hello, this is probably a super dumb question, but where exactly can I install this?
I am running Home Assistant on Raspberry Pi, and I also have Unraid Server running 24/7. But where can I install it by running (pip install ecowitt2mqtt) ?

Thanks!

You can install this anywhere that Python exists.
It’s also offered as a Docker container, so it can run anywhere Docker can run.

So, I think it’s likely that you can run it on either your Pi or your Unraid Server.

I am a total noob on python. I am running home assistant on a BLUE computer and want to get your ecowitt2mqtt running, as I plan to get rain data, but also want to grab temperature data for controlling some hvac dampers. I have been reading up on pip and python, but don’t know how to run the python command on my BLUE computer. Do I need to run a virtual environment on my windows PC and somehow execute the pip command on the drive where home assistant is kept ? Sorry so dumb on this. I appreciate your work a lot.

Welcome, @merkurmaniac!

Your goal will be to figure out how to either (a) run a Python library or (b) run a Docker container on your system. I unfortunately don’t know what “BLUE” is, but since you mention Windows, I would recommend researching how to do (a) or (b) on Windows.

One note: ecowitt2mqtt does not need to run on the same machine that is running Home Assistant, although you certainly can in most cases – the only challenging situation at the moment is with Home Assistant OS, where the supervisor takes over the whole box. I don’t use that route and haven’t yet made ecowitt2mqtt a module that can be installed via Home Assistant itself.

I’ll help however I can along the way; let me know!