Ecowitt2mqtt: Send data from an Ecowitt device to MQTT

It looks like the author of the HA add-on needs to update his code to be able to input MQTT credentials; I recommend creating an issue in that repo: https://github.com/smarthall/hassio-addons/issues

Hi Aaron,

Thanks for your help I’ll head on over and do that.

Great work BTW, - this add on got me over the line with the purchase of the Ecowitt Gw1000 and associated sensors. - Until now I wasnt sure which hardware and how I was going to integrate.

I’ll upload some pics of the card and the sensors in situ when this is working. - Hopefully the ‘Author of the code’ can sit back and appreciate the how he has helped others…

If you have nothing better to do for 5 minutes, read here

specifically the content of Para 7… THACF…

J.

2 Likes

The addon now allows manual configuration of the MQTT Broker details ( IP, port, user. P/W) directly for situations where the MQTT broker is separate to the HA node.

Tested and works.

Thanks to the Coder…

J

1 Like

Excellent! Glad everything is in action and you’re enjoying it.

Hi,

I try to run ecowitt2mqtt into a container using portainer.
Running the container stops with error “Missing required environment variable: either MQTT_TOPIC or HASS_DISCOVERY”
If I add those variables it deletes them strangely enough and starting all over with the same error.

Anybody any suggestions what I am doing wrong?

Regards

I don’t use Portainer, but have you tried this? https://www.reddit.com/r/docker/comments/gy53r7/how_to_edit_environment_variables_in_portainer/

This one broken again? Upon clicking install it just spins the circle then never installs

I don’t know which “this” you’re referring to – ecowitt2mqtt or the hass.io add-on?

sorry, hass.io addon :slight_smile:

I see you already posted an issue in that repo. :+1:t2:

1 Like

Released 1.1.0 today. Marquee features:

  • Better detection of device classes in HASS (i.e., temperature sensors will show up as temperature sensors – icons, etc. – automatically)
  • Support for “binary batteries” (batteries that are either “OK” or “Low”)
  • Support for the HASS device registry
1 Like

I am so happy that you have made the effort to make this accessible to people and simplify the installation process for less technical like myself. Congrats!

I have my Ecowitt2mqtt running and data is flowing through fine but there is no preceding name to the sensors.

I have a question which probably shows my lack of knowledge:
My mqtt message is as follows and as a result my sensors are all over the place and do not have ecowitt2mqtt in the topic to allow them to be found easily.
How would I go about adding this so that for example in Developer Tools:
sensor.monthlyrain becomes:
sensor.ecowitt2mqtt_monthlyrain

Any help appreciated.

homeassistant/sensor/F6F882B3BA6EF58E2916363883A01CE5/tempin/config at 2:29 PM:
{
“availability_topic”: “homeassistant/sensor/F6F882B3BA6EF58E2916363883A01CE5/tempin/availability”,
“icon”: “mdi:thermometer”,
“name”: “tempin”,
“qos”: 1,
“state_topic”: “homeassistant/sensor/F6F882B3BA6EF58E2916363883A01CE5/tempin/state”,
“unique_id”: “F6F882B3BA6EF58E2916363883A01CE5_tempin”,
“unit_of_measurement”: “°C”
}

Thank you for doing this and sharing. The other custom component I was using stopped working. I just followed the instructions to add your repository, and set it up quickly, without issues.

1 Like

Thanks all for the nice work.
However…I am still not able to get it working on my system.
I prefer the methode of using the add-on “GitHub - smarthall/hassio-addons: Addons for Hassio that I've made/modified” but each time I try to use the link my system give : invalid repository.

Anybody had the same?
Solution?

Thanks

Herbert

Hello,

I can’t get this to work and I feel like I missing something obvious?

I tried to install docker in Unraid using this:

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='ecowitt2mqtt' --net='bridge' -e TZ="America/Denver" -e HOST_OS="Unraid" -e 'MQTT_USERNAME'='ha' -e 'MQTT_BROKER'='192.168.1.9' -e 'MQTT_PASSWORD'='password' -e 'HASS_DISCOVERY'='true' -p '8080:8080/tcp' 'bachya/ecowitt2mqtt'`

I have also tried to install using portainer using both of these options:

docker run --name ecowit -e MQTT_BROKER=192.168.1.9 -e MQTT_USERNAME=ha -e MQTT_PASSWORD=password -p 8080:8080 -e HASS_DISCOVERY=true bachya/ecowitt2mqtt:latest
docker run --name ecowit -e MQTT_BROKER=192.168.1.9 -e MQTT_USERNAME=ha -e MQTT_PASSWORD=password -p 8080:8080 -e MQTT_TOPIC=ecowitt bachya/ecowitt2mqtt:latest

The docker does start, but if I check logs it’s always empty, and running MQTT Explorer shows no topic being created or data being sent. I know that my broker IP/port, username/password are correct because I have them configured for bunch of other stuff.

Any ideas?

I implemented ecowitt2mqtt into UNRAID using docker with the following settings: Name: ecowitt2mqtt; Repository: bachya/ecowitt2mqtt; Console Shell Command: Shell. The goal was to talk to my home assistant instance on a second NUC running HASSOS. I used the following container variable labels and values: LOG_LEVEL: INFO; MQTT_PORT: 1883 MQTT_PASSWORD: my.password; MQTT_USERNAME: my.mqttuser; MQTT_TOPIC: ecowit2mqtt; MQTT_BROKER: ip.addr; PORT: device port. The device port is what I used on my Ecowitt GW1000 when setting it up. This all worked well for me for a long time. I am having an issue which I will post in a separate message. Hope this helps you gain success with UNRAID and this great docker program.

As mentioned above, I have been using ecowitt2mqtt in a docker container for many months, My gw1000 is on firmware 1.6.8 and has been for over a year. This integrated into Home Assistant right off the bat and reports on both the GW1000 and a secondary sensor I have. Until - a couple of months ago when my battery entity started reporting as “unknown”. In the Ecowitt website it still reports the battery as “Normal” but I see in mqtt where the batt1 value is being reported as “off”. As a binary sensor I suspect it needs to be reporting 1 or 0 instead. Has anyone else had similar problems and were you able to resolve it? Other than updates to the ecowitt2mqtt app I have not changed anything on this integration. I did not notice it immediately so I do not know if a docker version upgrade changed things. Sorry HassOS has been regularly upgraded and I am on 2022.3.1.

I have to update my previous posting to reflect that I forgot to add that you need to include a “container port” in UNRAID so that this app can communicate with the device. In my case, I am using 4199 instead of the default and yours needs to match how you configured the gateway.

Hmm I have it set up the same way, I am not sure why it’s not working. When I click on the docker log icon in Unraid, it’s just completely empty even when it’s running. No errors but also nothing else. Using MQTT Explorer I don’t see any new topic being created. I have a bunch of stuff running using MQTT (zigbee2MQTT, zwave2MQTT, Frigate, etc) so I know MQTT is setup properly.