hacs-govee icon indicating copy to clipboard operation
hacs-govee copied to clipboard

New API

Open andygreen1976 opened this issue 7 months ago • 6 comments

Due to the current API not displaying all devices, I have been in touch with Govee support who have provided a new API URL

https://developer.govee.com/reference/get-you-devices

Could this be integrated please

andygreen1976 avatar May 15 '25 07:05 andygreen1976

I have a brief python script using this new API and I get all my devices.

(i have suppressed the MAC address on purpose)

  1. Device Name: Kitchen Light 1, Model: H60A1, ID: 50:39:
  2. Device Name: Kitchen Light 2, Model: H60A1, ID: 08:25:
  3. Device Name: Flat lamp, Model: H6076, ID: 6E:F6:
  4. Device Name: House outdoor lights, Model: H7038, ID: 3D:8A:
  5. Device Name: Garage light, Model: H60A1, ID: 13:DF:D0:
  6. Device Name: Curtain Lights, Model: H70B3, ID: 18:C0:
  7. Device Name: Chris wardrobe, Model: H610A, ID: 60:A6:
  8. Device Name: Scenic DreamView1, Model: DreamViewScenic, ID: 9

With the current API in Govee HACS script I only get 2 devices

  1. Device Name: Chris wardrobe, Model: H610A, ID: 60:A6:
  2. Device Name: Flat lamp, Model: H6076, ID: 6E:F6:

Unfortunately, I'm not skilled enough to branch this and try and address the code.

andygreen1976 avatar May 15 '25 19:05 andygreen1976

Python Code

// import requests

//# Replace with your actual API key //API_KEY = "<API KEY HERE" // //# Correct Router API endpoint //DEVICE_LIST_URL = "https://openapi.api.govee.com/router/api/v1/user/devices" // //def list_govee_devices(): // headers = { // "Content-Type": "application/json", // "Govee-API-Key": API_KEY // } // // try: // response = requests.get(DEVICE_LIST_URL, headers=headers) // // print(f"Status Code: {response.status_code}") // print(f"Response Body:\n{response.text}") // // if response.status_code == 200: // data = response.json() // devices = data.get("data", []) // // if not devices: // print("✅ API call successful, but no devices returned.") // else: // print("📋 Devices Found:") // for i, device in enumerate(devices, start=1): // print(f"{i}. Device Name: {device['deviceName']}, Model: {device['sku']}, ID: {device['device']}") // else: // print("❌ API returned an error. Check status code and key.") //
// except Exception as e: // print("❌ Exception occurred:", str(e)) // //if name == "main": // list_govee_devices()` //

andygreen1976 avatar May 15 '25 19:05 andygreen1976

Due to the current API not displaying all devices, I have been in touch with Govee support who have provided a new API URL

https://developer.govee.com/reference/get-you-devices

Could this be integrated please

That link goes to the API that hasn't been updated for over a year. What new api URL are you talking about?

Canabian1 avatar May 21 '25 02:05 Canabian1

That’s what Govee told me “our new API”. At least this one returns all devices, unlike the current one.

andygreen1976 avatar May 21 '25 06:05 andygreen1976

H607C no present on API Is itt possible also to add the Dreamview device ?

flashouillette avatar May 28 '25 07:05 flashouillette

I have the same issue with H7038 not showing yet it can be seen in API. I tried Python script but it didnt work. Any suggestions?

Image Image

c0nstantinator avatar Sep 02 '25 03:09 c0nstantinator