[Solved] Govee WiFi Thermometer Hygrometer H5179 Intergration Support

Was there anything else you did with the MQTT integration or the Mosquitto broker while getting your other devices working that might have affected this? For example, the auto discovery in the MQTT configuration settings? Or maybe some configuration on the H5179 itself that I am unaware of?

This is quite confusing as I have had the broker and MQTT all set up the exact same way for a few days with the H5179 on wifi and nothing is appearing.

Nope, I really did absolutely nothing special. Here’s some screenshots of the MQTT Integration configuration just in case you notice something different.


Thats so odd. I have no idea how you managed to get it working then.

What about your Govee settings? Are you perchance using their Distributed Gateway setting or any other features - like the Google Assistant integration? Perhaps turning on one of these addons makes the device seek out MQTT brokers on the local network and connect to them. Otherwise I’m not sure how your device is talking to MQTT?

Actually, does your MQTT broker support anonymous connections, or does it require a password? If the later, I’m not sure how Govee could be talking to it without some configuration somewhere :thinking:

So I’m definitely not using the Distributed Gateway settings in Govee. However, I did connect Google Home to Govee so I’d be able to control my smart plugs (this was before I had HA)! So maybe that’s it? Google Home → Settings → Services → Works with Google → Added Govee.

I followed this guide exactly to get Mosquitto up and running: https://github.com/home-assistant/addons/blob/8ccd6c40beb7d32a7e6ecf5472abc6bbd965ed26/mosquitto/DOCS.md
. Of note, I did to the step that said "Create a new user for MQTT via your Home Assistant’s frontend SettingsPeopleUsers " —> but I don’t necessarily remember putting those creds anywhere in any configuration :thinking::thinking:

As for anonymous login, based on this topic, I’m fairly certain I don’t have anonymous logins turned on.

1 Like

I’m still evaluating if HA is the right solution for me. I have a Govee Hygrometer. Can I use HA to create a routine to switch on/off a smart plug if the humidity value returned by the goove device is within(without) a range?

regards

Yup, should be easy peezy as long as you can figure out how to get the Hygrometer to show up in HA, which we don’t quite have nailed down yet.

(Side note: there’s other stupid cheap temperature/humidity sensors you can get too if you’re not tied to Govee)

Hey @fxfitz : Sounds quite cool what you achieved. I am struggeling as well with the integration. I got the 5179 with the Govee2MQTT integrated. But that’s limitted to 1000 polls per day. So if you have more than one sensor you don’t get really actual values…
Would you mind to share:

1. Version (mine is: 1.03.04) and Hardware Version (mine: 1.00.02) out of the APP
2. Sceenshot incl Advanced options of MQTT Integration configuration
2.1 Have you created the mosquitomqtt user? (per default its homeassistant, at least with me it was) Is it a normal user?
3 Your screenshot states connected via C8F09EB94D54 MAC: 18:CE:B9:53:8C:CE. Is this the WiFi MAC Address of H5179 which you can find in your router as well? What is the C8F09EB94D54 for a “service”?


If I check my Router I see, that the H5179 is only connecting ever 10 min to the WiFi, as setup in the Govee APP (10, 30 or 60min). How often are you getting updates via MQTT and what is our Router saying about the last online (delta between 2 times H5179 connecting to WiFi, should be same as APP setting. How often are you getting new values at your dashboard?
I even tried to find with wireshark traffic related to the Sensor. No success, at least the IP as a source isn’t shown nore the MAC… The device is somehow not visible… But is doing frequently (every 10min) upload of data to the cloud…
4 Can you please provide a short log of MQTT listening


that’s what I get for my H5179 via Govee2MQTT

5 Protocoll of mosquitto broker after “restart”

Many thanks in advance. Your help is highly appreciated!

Sorry for the late response, y’all! It’s been a busy week.

While trying to get all the information I could for @Rainer_HA, I think I have figured out why it’s working for me… and the I kind of feel silly for not knowing (but I’m brand new to Home Assistant and all these smart devices, so cut me a bit of slack :sweat_smile:).

TLDR: I originally set up MQTT (as described earlier in the post) for another device I have, a Theengs Plug, that I bought only for power consumption monitoring. Well, it apparently is also a BLE MQTT gateway, and it’s picking up the BLE data for the Govee devices.

For posterity though, I’ll answer all of @Rainer_HA’s questions above:

  1. Version Information

Govee Thermometer/Hygrometer Firmware Version: 1.03.04
Govee Thermometer/Hygrometer Hardware Version: 1.00.02

  1. Screenshots! These are fresh screenshots, but a lot are duplicated from my previous replies, but still wanted to add here for completeness.

Mosquitto Addon Configuration:

MQTT Integration Configuration:

2.1: User Information

I created a new user (not an Admin) in Home Assistant: MosquitoMQTT. The username and password is set in the MQTT Integration (Devices & Services → MQTT → Configure → Reconfigure MQTT).

  1. Networking Information

This part was key for me to understand what’s going on.

You can see the Govee device is connected to “Bottle Warmer”, which is my Theengs plug (MAC c8:f0:9e:b9:4d:54).

In my router connection logs, I was able to see my Govee devices connecting every 10/30/60 minutes based on whatever I have it configured to in the Govee app. Typically, I have mine set to 30 minutes, but I played around with it this morning.

The Govee device MAC addresses do differ between what I’m seeing in my router versus what I’m seeing in HA; this is because the WiFi mac address is different from the BLE mac address (obviously). I point this out just because this is ultimately how I figured out I was definitely getting this data via bluetooth and not wifi.

  1. Sniffed MQTT Message

At this point, I was pretty sure I knew what was going on, but I got an MQTT client to sniff the actual messages being sent to make sure:

And you can see in the topic BTtoMQTT :man_facepalming:.

So basically my assertion in my first post on this thread that I got this working with WiFi alone was completely wrong; I had been picking up the BLE messages and just didn’t know it at the time.

Sorry for the goose chase y’all, I’ll see myself out.

He @fxfitz, no worry. I’m new as well. Struggling around… So welcome here and have fun.

I try now to integrate Switchbot via the API using a Python script. Haying a lot of fun :frowning:

I am in exactly the same situation with both the Govee H5179 which does not work over WiFi, all my other Govee WiFi devices (lights) work fine. So based on what I read here I am giving up, is less effort to find a temperature sensor that works natively with HA over WiFi rather than make H5179 work over BLE. Also I tried last week the Switchbot integration via the API using Python based on this link https://www.jamesridgway.co.uk/integrating-the-switchbot-hub-mini-with-home-assistant-a-cautionary-tale/ but did not work, I posted my comment/error on that page, but it seems is not really supported as I never got a response. For my connecting BLE over to my HA server which is far away is not really an option even with BLE proxy etc, prefer only Wired/WiFi integrations.

Just being curious about the 1000 polls limitation on this. If I have 4 of these Govee devices polling for data over 24 hours, it would mean I can have one data point for all of the Govees each 3 minutes.

Is my calculation correct? Coz that type of accuracy would be sufficient for most folks unless they are interested in large temperature or humidity swings that occur within the 3 minute no-polls allowed time.

To extend it further, if you only need two of these Govees on WiFi the poling frequency increases to 1.5 minutes?

So have two of them on Bluetooth and the other two on WiFi?

Not sure if my thinking is correct and this is my first post on the forum coz I literally just installed Home Assistant yesterday for the first time lol

Please bear with me folks - just trying to learn this

@VasMan
try this: SiriosDev/SwitchBot-API-Script-Caller: This (Py)Script allows you to control all (WIP) your SwitchBot devices via API calls (1.1) (github.com)
it took me a while to understand but it works.
If you want to avoid Python: that’s cool as well: SwitchBot API v1.1 and Home Assistant - Speak to the Geek Speak to the Geek
youtube: SwitchBot API v1.1 and Home Assistant (youtube.com)

@Bluebeep
you have 10.000 per day and fun stuff is that the official api isn’t best one…
here you can do way more…
Get You Devices (govee.com)

Thanks a lot for sharing this. Tbh after my failure with the Switchbot Mini Hub API I decided to give it a go with the native Switchbot Bluetooth integration and bypass the Hub which I am using now only fo Voice commands over Alexa. I bought from Amazon a long range BT adapter with external antennas since my NAS hosting the HA VM is a bit far away and on a different floor than my curtains. I was pleasantly surprised to see that it connects and works fine via BT, is also quite consistent/reliable and the delay from the point you click on the action to the point that the curtain starts moving is about 5-10sec so not too bad.

Hi All,

I’m new to Home Assistant and I’m trying to set up Govee Thermo-Hygrometer Sensors are there any solutions to get these configured and working over wifi?

Any help would be really appreciated

Cheers, Dean

I’ve been experiencing similar sync issues via BT and no way to sync via WiFi, but… I found a really nice workaround that just might help somebody else.

My Govee H5179 is monitoring a terrarium that cannot get too hot or pets die. It’s imperative that the heat lamp switches off automatically in this case. Needless to say these data sync issues are prohibitive.

Now… The Govee app allows you to:

  1. set a safe band range for your temperature and humidity readings, and
  2. you can define an email alert.
    Please note that some of these settings are only available when you are within BT range of the device.

I’ve created a new Gmail inbox that I monitor with the IMAP integration. I then created an automation in accordance with:

This seems to be a very reliable approach.

Thought I would share how I managed to get data from an H5179 connected to WiFi! As I’m sure some of you found, LAN API isn’t an option with these devices, so I went down the path of seeing what their Cloud API supported. In short, I was able to pull temperature and humidity via the Govee Cloud API.

Steps were as follows …

  1. Apply for a Govee API key per the steps here: Apply Govee-API-Key
  2. Get your device details by running a curl request similar to this:
curl -X GET "https://openapi.api.govee.com/router/api/v1/user/devices" \
-H "Content-Type: application/json" \
-H "Govee-API-Key: your_api_key"  # Replace with your actual Govee API key
  1. Add and update the following in your configuration.yaml.
rest:
    resource: https://openapi.api.govee.com/router/api/v1/device/state
    method: POST
    headers:
        Content-Type: "application/json"
        Govee-API-Key: "REPLACE_ME_WITH_API_KEY"
    payload: '{"requestId": "uuid", "payload": {"sku": "H5179", "device": "REPLACE_ME_WITH_DEVICE_ID"}}' 
    scan_interval: 60
    sensor:
      - name: "Humidity"
        value_template: "{{ value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorHumidity') | map(attribute='state.value.currentHumidity') | first }}"
        device_class: humidity
        unit_of_measurement: "% RH"
      - name: "Temperature"
        value_template: "{{ (((value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorTemperature') | map(attribute='state.value') | first) - 32) * 5 / 9) | round(2) }}"
        device_class: temperature
        unit_of_measurement: "°C"

If you’re working with fahrenheit, just use the following for the temperature value_template and update unit_of_measurement.
{{ value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorTemperature') | map(attribute='state.value') | first }}

Hope that helps!

3 Likes

Thanks for the instruction. I´m completly new to HA and managed to get temperature and humidity for one device. However I failed to get the data from a second device. Repeating the code with a different deviceID seems not to work.
Could anyone help please?

By trial and error I got two devices to work in the following way:

rest:
  - resource: https://openapi.api.govee.com/router/api/v1/device/state
    method: POST
    headers:
        Content-Type: "application/json"
        Govee-API-Key: "REPLACE_ME_WITH_API_KEY"
    payload: '{"requestId": "uuid", "payload": {"sku": "H5179", "device": "REPLACE_ME_WITH_DEVICE_ID1"}}'
    scan_interval: 60
    sensor:
      - name: "Humidity1"
        value_template: "{{ value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorHumidity') | map(attribute='state.value.currentHumidity') | first }}"
        device_class: humidity
        unit_of_measurement: "% RH"
      - name: "Temperature1"
        value_template: "{{ (((value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorTemperature') | map(attribute='state.value') | first) - 32) * 5 / 9) | round(2) }}"
        device_class: temperature
        unit_of_measurement: "°C"
  - resource: https://openapi.api.govee.com/router/api/v1/device/state
    method: POST
    headers:
        Content-Type: "application/json"
        Govee-API-Key: "REPLACE_ME_WITH_API_KEY"
    payload: '{"requestId": "uuid", "payload": {"sku": "H5179", "device": "REPLACE_ME_WITH_DEVICE_ID2"}}'
    scan_interval: 60
    sensor:
      - name: "Humidity2"
        value_template: "{{ value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorHumidity') | map(attribute='state.value.currentHumidity') | first }}"
        device_class: humidity
        unit_of_measurement: "% RH"
      - name: "Temperature2"
        value_template: "{{ (((value_json.payload.capabilities | selectattr('instance', 'equalto', 'sensorTemperature') | map(attribute='state.value') | first) - 32) * 5 / 9) | round(2) }}"
        device_class: temperature
        unit_of_measurement: "°C”
1 Like