Govee WiFi Water Sensor

Does anyone have any experience with Govee water/leak sensors (Amazon)? And integrating these into Home Assistant?

I naively purchased these on sale late last year before diving into Home Assistant, in earnest. The sensors work well, and the app has been… functional. I have no big complaints. However, since it does not integrate in Home Assistant, the functionality is greatly limited for me. All of my research on these, after the fact, has been unfruitful.

Does any method exist to integrate these? MQTT, HACS, Tasmota, RF receiver?

The gateway appears to be model H5040, and it utilizes 433.92 MHz to communicate to the sensors. In the FCC internal photos the components are not clear enough to determine if an ESP chip is used. I can try to tear down my own if it looks promising for flashing tasmota. There are clear GND, Rx, Tx, and 3V pins.

While I would much prefer local polling, I’ll take what I can get. On the HACS front, I noted in the current android app release notes (V3.5.0) there is a new option to request for API key:

I did this, and promptly received an API key via email, along with an API reference document. Unfortunately I am not a developer and cannot easily utilize this. It does appear to use JSON formatting and one with experience could probably easily implement this with HACS. Weirdly, the H5040 isn’t listed as a device compatible. I don’t own any other Govee products but maybe this will help someone else.

I greatly appreciate any and all help from the community.

2 Likes

Thanks for posting this. I was considering these, since they look handy. I cannot find anyone who has flashed them to avoid the gateway. This API might be useful for integration into HA. However, it only gets info out of the cloud. So, you cannot avoid keeping your devices from going outside your network. That is not a problem, if you don’t care about relying on their servers not disappearing, and you keep these devices on their own network. If your device uses the gateway, it is really strange that it is not included in the API. Maybe if you asked them, you might find out otherwise.

Have you opened one up to see what is on the PCB?

Thank you for the interest! I got to tearing down my gateway H5040 & sensors H5054. I think we have some hope. I confirmed the chip inside the gateway is an ESP8266EX. Here are the pictures from my teardown.

For myself, I would definitely prefer local operation, like tasmota. Relying on the govee API would only be a last resort. However, I put it out there for the community in case someone was interested.

It seems like the best course of action is to flash the gateway. Unless anyone knows of an RF gateway that could replace the Govee one? Do you recognize anything helpful on the sensors themselves?

I have neither the tools nor experience flashing tasmota with pinouts. I have only flashed tasmota OTA with tuya convert. However, I’m willing to give it a shot. After flashing we’d have develop a template (I think, again, I have no experience with this) since there doesn’t seem to be one?

2 Likes

This is very interesting. I am just getting into all of this so am in the same boat as you. I have several of the leak sensors which I do like and have worked well on 2 small leaks I have had. I may have to order some of the tools and try things but I’m not confident I’ll actually accomplish anything, still trying to wrap my head around all of it!

I don’ know enough about the chips to help you. But it does indeed use the ESP8266, and even looks like it might have the pin outs placed conveniently. How does one set up the Govee hub to your router? With a special app? It is worth trying the simplest method with tuya-connect OTA. From what my little research has shown, Govee does not like to play with other apps, so it seems unlikely. But it doesn’t hurt anything to try.

I would leave the sensors alone, and try to attack the hub itself, but I have not (yet) had to do that from scratch. You could use a UART device to see what comes out of the TX RX pins during setup.

It looks like you have access to all of the pins, which means that you can indeed force a flash. Then you have to figure out how the pins attach to the sensors. I am guessing that it probably just attaches to an RF chip that is the go-between for the messages. I wonder how one extracts the existing code on the ESP chip to get that.

@smoysauce
I’m in a similar boat! It probably won’t be a few weeks, or longer before I get to trying to acquire the tools and try a flash.

@jds
It does certainly look like the pin outs are easily accessible. The Govee uses their own app, not Tuya. I don’t think tuya-convert would work. But you’re right, I could try.

I will probably look into getting one of the UART devices recommended by tasmota. Regarding the original firmware, something like Tasmotizer looks like it can backup the original firmware.

That’s right tuya-convert does that. I have no idea how readable it is by humans, but there must be useful information in there on how it communicates. You could go through the tasmotizer routine, but not flash it, and just look at the original firmware first. To flash, you often have to groud out a pin (GPIO0, I think) that forces it to flash.

I was just looking to see if you can buy just the gateway for testing, but could not find one. Apparently you can buy one detector and one hub for about $20.

Here is the most relevant information that I have found so far on a different gateway.
It has warnings, of course, about the high voltage while the thing is operating.

Addition: And here is the data sheet for the chip. From your pix, it looks like the RF transmitter to the devices is on the left, using pins 25 through 32. 25 and 26 are TX and RX for flashing the chip, 32 is for resetting the chip. 29 and 30 are for power. 27 and 28 are usually for bluetooth, so these are probably what connect to the devices.

Can you repost the API reference document? The filemail expired on 7/28. Thanks

Here is what I got from them…https://drive.google.com/file/d/1vmDZ7jtU5St7Nay4oipccrU6V6pWECAV/view?usp=sharing

1 Like

Has anyone tried using an SDR with rtl_433 to see what information can be retrieved?

Here is another file upload of the api document
https://gofile.io/d/xq4hmc

Curious about this as well, as I’ve had these already.

I did also request the API and got an instant response. I quick used requests to list the devices, but it seems like none of mine are supported (which I expected from the supported devices list, but I had a sliver of hope that they would have added some and not yet documented it).

So it doesn’t seem like the API will be helpful to us at the moment :frowning:

That’s a bummer. I was curious if the leak devices would even be supported with the API. So it sounds like the best bet would be to flash the gateway somehow? I have actually thought about just hacking the sensor itself, taking out their board and replacing it with the board from one of the Wyze contact sensors; just need to get some time to try it out.

@smoysauce That is certainly one way to do it, I wouldn’t want to be stuck on Wyze any more than Govee. Maybe another door sensor though.

I too have been thinking of attacking the sensors themselves. I was watching @DrZzs’s latest video about the Sonoff RF bridge and got excited this might be a possible solution too (with or without Portisch). Its cheap enough to try, and then I could use the bridge for other things too.

That being said, I still think its worth trying to flash the Govee bridge directly too.

1 Like

Good point. I am bypassing Wyze and connected their bridge directly to my HA hardware which has been amazing for response time of the sensors. Though I’m sure that could always end up going away through an update or something (though could that happen if it’s not connected to their servers?).

I think with some more learning I’d be comfortable flashing the Govee bridge but have zero clue what to do after that to get the sensors to communicate, etc… definitely above my level of understanding at this point. Lots more learning to do!

I have been playing around with the sensors and you can receive the raw signal with the Sonoff RF.
I use the Sonoff RF with Esphome but I think I prefer Tasmota on it.
I want to hack the WiFi bridge though. Putting Tasmota on it will be easy, the hard part will be comumicating with the RF chip (CMT2210).Data sheet

2 Likes

So the sensors will just connect to sonoff rf? Interesting, does it recognize it as a remote or something?

The Govee water sensors just put out a signal on 433 MHz. When they get wet the Sonoff RF just picks this signal. It doesn’t recognize it as anything just give you a raw code like “01011100111111111111101011111010111110001011110”

1 Like