Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Govee H5178 #440

Closed
Ernst79 opened this issue Jul 15, 2021 · 10 comments
Closed

Add support for Govee H5178 #440

Ernst79 opened this issue Jul 15, 2021 · 10 comments
Labels
new sensor Request for a new sensor

Comments

@Ernst79
Copy link
Collaborator

Ernst79 commented Jul 15, 2021

From @Thrilleratplay in #386

There is another Govee device, H5178, that has an open PR for sensor.goveetemp_bt_hci, which may not be as easy to integrate. It is a multiple sensor device, there is a display with a temperature humidity sensor then a second temperature humidity sensor that, I believe, communicates via RF. The display broadcast the information via BLE for both sensors but only uses one MAC address.

This will require to make two Temperature/humidity and possibly battery/voltage sensors for one mac, which can be a bit tricky. Done that before for the Kegtron devices with two ports, but for that device, I just created two sensor classes,

@Ernst79 Ernst79 added the new sensor Request for a new sensor label Jul 15, 2021
@Ernst79 Ernst79 changed the title Add support for H5178 Add support for Govee H5178 Jul 15, 2021
@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jul 19, 2021

I've added H5178 to the tests branch, with a second (outdoor) temperature and humidity sensor. I'm not sure the battery(/ies) will work ok, as I only have one battery sensor for now. It might mix the measurements of the two, if both report individual values.

Edit: Ready for testing, added in 4.2.1-beta.

@Thrilleratplay could you do a check (as far as possible). I just added the 00/01, like explained in the PR on goveetemp_bt_hci by @noah-holland to a H5102 advertisement. Or maybe @noah-holland is willing to test?

The unit acts similarly to H5101/H5102, but has a byte preceding the temperature/humidity payload that seems to differentiate which sensor module the data is for (in this case 00 for the base unit, 01 for the outdoor module).

@Thrilleratplay
Copy link
Collaborator

@Ernst79 Were you asking me to check if the other Govee devices still work with 4.2.1-beta? They do.

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jul 21, 2021

I was actually asking if you wanted to do a check of the H5178. I understand you don't have this device, so it would be better is @noah-holland could do the check. But I'm not sure he/she will read this and if he/she is prepared to move from govee_bt_hci to ble_monitor. I'll just wait a couple of days and will merge if I don't get a response.

@Thrilleratplay
Copy link
Collaborator

I decided to purchase the H5178. I am using a H5074 for my outdoor temperature and it seems to be susceptible to direct sunlight so I'll see if this works any better. I'll test it out and let you know.

@noah-holland
Copy link

I apologize, I've been away from home for the past two weeks. I can get you the HCI advertisement later today (my work day has just started). I'd be happy to test the beta as well.

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jul 21, 2021

@noah-holland No problem, glad you are willing to test 😄 You can first try with 4.2.2-beta, it might already work (I tried to add it based on your PR for govee_bt_hci). If not, please send me an hcidump for this sensor and I will add it.

@Thrilleratplay
Copy link
Collaborator

@Ernst79 I am not seeing the sensor in discovery or the logs. I created a gist with the hcidump containing the lines with that device's mac address https://gist.github.com/Thrilleratplay/f66a61ef34fbf7826008c7b1d4b58418

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jul 23, 2021

Fixed it in 4.2.3-beta. I had the length byte wrong.

@Thrilleratplay
Copy link
Collaborator

Thrilleratplay commented Jul 23, 2021

@Ernst79 Working now. Thank you. Although, I only see one battery entity but not sure if that is broadcasted separately or if @noah-holland had that working for the Govee integration.

Sorry, I've been busy the past few days to look into this myself.

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Jul 23, 2021

No problem. I created only one battery sensor. as I'm not sure about the battery either. It the commit of @noah-holland, I only see temperature and humidity as separate sensors, but I think it adds the battery per device as an attribute.

The RSSI and battery seem to report the same value for both, but as battery is 100%, it is not possible to say if it is the battery per sensor not. Perhaps we can find out later, when the battery is a bit more empty. Creating a separate battery is a bit more difficult, as it isn't only used as a sensor, but also as the attribute of each sensor. I'll release the current status, we can always change it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new sensor Request for a new sensor
Projects
None yet
Development

No branches or pull requests

3 participants