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 Ability to Control Govee Scenes with New Development Platform #50

Closed
superpunkduck opened this issue Dec 29, 2023 · 27 comments
Closed

Comments

@superpunkduck
Copy link

Recently Govee Released the new Development Platform...
https://app-h5.govee.com/share/community?client=0&postId=165266&t=1701725633893

Is there any way the integration could be update to allow HA to control Govee Scenes, Music Modes, and DIY rather than Just Single Colors and Power?

@mattgphoto
Copy link

Looked for the issues on this to find out if this had been requested yet or if it was just something I was missing, this would be invaluable for a QoL Feature Request.

@mattgphoto
Copy link

@superpunkduck I think we have our answer here actually... #42 (comment) Unless Govee exposes this information, I think we're out of luck.

@wez
Copy link
Owner

wez commented Jan 1, 2024

FWIW, I've been doing some reverse engineering the past couple of days and have found a way to send scene controls via undocumented parts of the LAN protocol (egold555/Govee-Reverse-Engineering#11)

My strategy for taking advantage of this new knowledge is not to update govee-lan-hass directly, but rather to build a home assistant addon instead; that approach means that I can move much more rapidly with development, using Rust as well, and also tackle some issues that folks have with routing of LAN packets across subnets.

The addon approach has worked out really well for me with my Power View integration, so I'm excited to apply it here to my govee lights as well.

@Tom-Sumner
Copy link

@wez
Just reading your comment and im not clear wether you plan on integrating scenes, diys and the other new things in your new version. sorry if i misunderstood

@wez
Copy link
Owner

wez commented Jan 1, 2024

Yes, the new addon will support scenes

@Tom-Sumner
Copy link

amazing cant wait to try this out. loving it so far

@Worren
Copy link

Worren commented Jan 2, 2024

amazing cant wait to try this out. loving it so far

Same for me :-)

@wez
Copy link
Owner

wez commented Jan 3, 2024

My work so far is up at:

To run it, you'll need docker.

@superpunkduck
Copy link
Author

My work so far is up at:

To run it, you'll need docker.

So this wont work for someone running a straight HASS install without it being inside docker?

Will it ever?

@wez
Copy link
Owner

wez commented Jan 3, 2024

I'll add a hass addon in the near future, but otherwise: no, I have no plans to make this work as a regular hass integration. The reasons are:

  • I find it extremely frustrating to split the work across two separate python-based projects (this one, and the underlying python library which is just the govee API), which is a requirement for hass integrations. It makes development very slow going, and makes it harder to develop both components.
  • I do not enjoy working in python, which means I don't really want to look at either project very often.
  • The UDP discovery stuff required for Govee's LAN API is a PITA and I found it much easier to deal with it in the context of a a long lived process
  • It is possible to iterate on govee2mqtt without bouncing my whole home automation system

That said, you don't have to use docker to run govee2mqtt, you can just compile and run the executable outside of docker.

@mattgphoto
Copy link

Appreciate the effort @wez. I don't have machines to spin up docker on anymore, and don't know the first thing about compiling something in windows or about setting mqtt. But that is not your fault, and I hope this works great for you!

@Tom-Sumner
Copy link

I'll add a hass addon in the near future, but otherwise: no, I have no plans to make this work as a regular hass integration. The reasons are:

  • I find it extremely frustrating to split the work across two separate python-based projects (this one, and the underlying python library which is just the govee API), which is a requirement for hass integrations. It makes development very slow going, and makes it harder to develop both components.
  • I do not enjoy working in python, which means I don't really want to look at either project very often.
  • The UDP discovery stuff required for Govee's LAN API is a PITA and I found it much easier to deal with it in the context of a a long lived process
  • It is possible to iterate on govee2mqtt without bouncing my whole home automation system

That said, you don't have to use docker to run govee2mqtt, you can just compile and run the executable outside of docker.

I quite enjoy working in Python. Could I help you out anyway in the hass addon development?

@superpunkduck
Copy link
Author

I'll add a hass addon in the near future, but otherwise: no, I have no plans to make this work as a regular hass integration. The reasons are:

  • I find it extremely frustrating to split the work across two separate python-based projects (this one, and the underlying python library which is just the govee API), which is a requirement for hass integrations. It makes development very slow going, and makes it harder to develop both components.
  • I do not enjoy working in python, which means I don't really want to look at either project very often.
  • The UDP discovery stuff required for Govee's LAN API is a PITA and I found it much easier to deal with it in the context of a a long lived process
  • It is possible to iterate on govee2mqtt without bouncing my whole home automation system

That said, you don't have to use docker to run govee2mqtt, you can just compile and run the executable outside of docker.

...... Unfortunately that's all Greek to me... I typically am pretty good at following install instructions... but i look at this and get really confused...

That being said... i appreciate all your effort.

@wez
Copy link
Owner

wez commented Jan 3, 2024

I typically am pretty good at following install instructions... but i look at this and get really confused

Those are not install instructions, those are reasons why I don't plan on doing much more to the python code here.

If you want install instructions for govee2mqtt, they are here: https://github.com/wez/govee2mqtt/blob/main/DOCKER.md

@wez
Copy link
Owner

wez commented Jan 3, 2024

@mattgphoto how are you running home assistant at the moment?

@Tom-Sumner
Copy link

@mattgphoto how are you running home assistant at the moment?

Im just running it on my RPI 3B as the OS itself. is there any way I can use this yet?

@wez
Copy link
Owner

wez commented Jan 3, 2024

@Tom-Sumner which of these installation methods did you use? https://www.home-assistant.io/installation/#advanced-installation-methods

@Tom-Sumner
Copy link

@mattgphoto how are you running home assistant at the moment?

I used the OS flasher windows app. to flash it to the boot sd

@mattgphoto
Copy link

@mattgphoto how are you running home assistant at the moment?

I have HAOS installed in a VM with HACS.

@sdaltons1
Copy link

@wez

Hey Wez, thanks for doing this.

I see the documentation mentions support for the platform api. Does that mean this integration will be able to pull in all govee devices, including appliances, rather than just those with lan api support?

@wez
Copy link
Owner

wez commented Jan 3, 2024

@sdaltons1 yes, all devices should be visible to it, however, since I only have lights to test against, right now it will simply represent them all as lights, so you may not be able to much more than just turn the power on or off.

@wez
Copy link
Owner

wez commented Jan 3, 2024

OK, for folks that are running HAOS or Supervised Home Assistant, you should now be able to install govee2mqtt as an addon.
https://www.home-assistant.io/addons/ has more information about add-ons

The steps are shown below; it's a bit of an adventure in clicking all over the place because of how HASS lays these things out, but it isn't especially difficult.

Steps:

  1. Go to the AddOns page: https://my.home-assistant.io/redirect/supervisor
  2. Click on the "Add-on store" button (look to the bottom right)
  3. Look for the Mosquitto Broker
    • "Install" it
    • "Start" it
  4. Now go to "Settings" "Devices & Services" and enable the MQTT integration.
  5. Go back to the AddOns Store
  6. Look for the 3 vertically stacked dots in the top right corner:

image

  1. Click on "Repositories"
  2. Enter https://github.com/wez/govee2mqtt and click "Add"
  3. You should see:

image

  1. Click "close"
  2. To make it show up in the "Store" area you need to ensure that "Advanced Mode" is turned on for your profile. There is a little link at the bottom of the screen you can click on, but otherwise you can click on your profile icon in the bottom left corner of the screen. Enable advanced mode:

image

  1. Go back to the AddOns Store
  2. You should now see:

image

  1. Click on it
  2. Click "install"
  3. At the top of the screen is a "Configuration" tab, click it

image

  1. Check the "Show unused optional configuration options" option
  2. Fill out at least the first three options; the govee email, password and api key
  3. You don't need to fill out the mqtt options because you are using the integrated Mosquitto Addon; the appropriate values are automatically passed through
  4. Click "Save" (bottom right)
  5. Click on the "Info" tab (top of screen)
  6. Now you can click "Start" to launch it

@wez
Copy link
Owner

wez commented Jan 3, 2024

Assuming it's all working, after a couple of seconds, you'll see your devices show up under the MQTT integration in Devices and Services, and any other dashboards that automatically populate.

@wez wez mentioned this issue Jan 3, 2024
@Worren
Copy link

Worren commented Jan 4, 2024

Just a note - you have to deactivate the govee-lan-hass integration in Home Assitant to try the new govee2mqtt integration.

@superpunkduck
Copy link
Author

superpunkduck commented Jan 4, 2024

It's working great for me so far.... Any idea on how to get it to react to music for devices with built in mics....

Here's an example of the music scenes I'm looking for in the govee app

@jiwe69
Copy link

jiwe69 commented Jan 6, 2024

I got it working very easily with @wez instructions, thank you so much!!

@wez
Copy link
Owner

wez commented Jan 6, 2024

Closing this as Resolved by switching to Govee2MQTT

@wez wez closed this as completed Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants