Created At

Jan 10, 2022

Last Update

Jan 07, 2025

Platforms

HC 3 Lite, Z-box Hub, Yubii Home Pro, Yubii Home, Venture WISE, HC 3

Views

6411

Download

381

Type Quick App

Version 2.0 (2024.12.30)
based on Govee Developer API Reference v1.0 (cloud access)
https://developer.govee.com/reference/

Compatibility

  • FIBARO Home Center 3, Home Center 3 Lite
  • Nice Yubii Home (PRO) and compatible
  • Yubii Home mobile APP only    
  • FIBARO/Nice firmware version: 5.170 or newer
  • Govee light device with WiFi connection, list of supported models: https://developer.govee.com/docs/support-product-model  

Features

  • Acts as extended RGBW light device, so support all SetColor, SetBrightness, ON/OFF/Toggle actions in scenes, and provide regular RGBW UI for manual settings
  • Warm White (White) channel is used to switch Govee light into white mode with temperature control, 1% is the most warm value, 100% is the coolest one. 
  • Supports snapshots defined by the user in Goove APP
  • Supports scenes available for Govee light device
  • Supports DIY scenes defined by user in Govve APP
  • Provides API for LUA programmers, that allows to start a scene, activate a snapshot and to control color and brightness of light segments (for RGBIC devices)

Notes

  • Govee API has a limit for 10000 call per day per user account (not per device!!!). When QuickApp refreshes its states every 10 seconds (to reflect changes in devices state done ex. via Govee APP), it makes 8640 get_state calls per day. If you have more Govee lights, and you install more instances of the QuickApp, Read_Every variable has to be set to higher values, so as not to exceed the limits (for example, not less than 20sec per QuickApp, when you have two instances)
  • Yubii Home Center mobile APP (the one with “N” icon)  is NOT compatible due to lack of proper handling of RGBW-type QuickApps (checked for APP version 1.22)
  • Home Center / Yubii Home hub with firmware 5.170 as well as Yubii Home APP have some issues with dropdown list support and UI refresh for RGBW QuickApps. Fixes are expected in newer firmware and APP versions. We have temporarily added some tricks to the QuickApp code to minimize the issues, but they are still noticeable.
  • Not all control settings activated at Govee APP are visible at Fibaro/Yubii side. Govee API does not provide all the statuses and states (for example there is no way to get information about active scene, music mode, or state of RGBIC led segments)
  • QuickApp supports English, German and Polish languages 

Settings

To connect Govee services and devices, you need to obtain API KEY. Open Govee APP, go to 👤 My Profile from menu at the bottom of the screen. Open Settings (⚙️ icon at the top-righ), use option Apply for API Key, fill the short form (as reason you can write “Fibaro integration”), and wait for the email with API KEY. Usually it comes in a minute.
See also: https://developer.govee.com/reference/apply-you-govee-api-key  

The QuickApp has following variables to set (Variables tab at device settings in Web UI):

  • GoveeAPIKey – API KEY provided by Govee, as described above
  • Device_ID – device ID, similar to MAC address. So you can put there simple numbers, as 1,2,3, which refer to number of device attached to your Govee account. If you have one device, just put "1". Enter "2" if you want to connect to second device. List of devices is available at Govee APP, but the IDs cannot be obtained there. After proper connection, DeviceID variable is updated and full ID number of device is put there by the QuickApp.
  • Read_Every – refresh period in seconds – how often the QuickApp fetch status of the light from Govee cloud. See Notes above for information about communication limits (!)

QuickApp API

QuickApp provide simple API for LUA programmers, that allow for more advanced control of the light.
Available functions:

setLightSceneByName

Sample call to activate Stacking scene (scene name is NOT case sensitive)
hub.call(345, "setLightSceneByName", "stacking")   --where 345 is Govee QuickApp ID

Names of scenes available for the device can be checked via drop down list in QuickApp UI.

setSnapshotByName

Sample call to activate Alarm snapshot (snapshot name is NOT case sensitive)
hub.call(345, "setSnapshotByName", "alarm") --where 345 is Govee QuickApp ID

setDIYSceneByName

Sample call to activate My Scene DIY scene (scene name is NOT case sensitive)
hub.call(345, "setDIYSceneByName", "My scene") --where 345 is Govee QuickApp ID

setSegmentColor

Capabilities of control segments’ color depends on Govee Light device. It shall be available for most RGBIC devices produced in 2023 and later. Number of segments depend on device, hind about numbers is displayed in status line at QuickApp UI (bottom line). Segments are numbered from 0.

Sample calls (where 345 is QuickApp ID):
hub.call(345, "setSegmentColor", "[1,2,3]", 0xff00) -- set color for segments 1,2,3
hub.call(345, "setSegmentColor", 7, 0x00ffff) -- set color for segment 7
hub.call(345, "setSegmentColor", "", 0xff0000) -- set same color for all the segments

In general – segment parameter is json table of values (as string), or a number for single segment, when empty - refers to all segments. Color – is a number (color code) from 0 to 0xFFFFFF. For color, only R,G and B channels can be set here. White channel is not supported.

setSegmentBrightness

Capabilities of control segments’ brightness depends on Govee Light device. It shall be available for most RGBIC devices produced in 2023 and later. Number of segments depend on device. Segments are numbered from 0.

Sample calls (where 345 is QuickApp ID):
hub.call(345, "setSegmentBrightness", "[1,2,3]", 40) -- set 40% brightness for segments 1,2,3
hub.call(345, "setSegmentBrightness", 7, 100) -- set 100% brightness for segment 7
hub.call(345, "setSegmentBrightness", "", 1) -- set 1% brightness for all the segments

In general – segment parameter is json table of values (as string), or a number for single segment, when empty - refers to all segments. Brightness – is a number from 0 to 100.

Sample scenes

Here is sample LUA scene that changes segment colors and brightness at 13-segments devices (0-12).
This scene checks also Govee_scene global variable (and is triggered by its change) and treat variable value as the name of the scene to activate. The text in global variable has to have at least 2 characters. Variable is cleared after the call, to allow activation of scene trigger for call with the same scene name.
Govee_scene global variable used in these scenes has to be created manually by the user.

--------------------------------------
-- DECLARATIONS (Conditions/Triggers)
--------------------------------------
{
  conditions = { {
      isTrigger = true,
      operator = "!=",
      property = "Govee_scene",
      type = "global-variable",
      value = ""
    } },
  operator = "all"
}

-------------------------------
--ACTIONS
-------------------------------

local QuickApp_ID = 345    --Govee QuickApp ID

local sc = hub.getGlobalVariable("Govee_scene") or ""
print("call",sc)
if string.len(sc) <= 1 then
    hub.call(QuickApp_ID, 'setColor', 255, 255, 0, 0)
    hub.call(QuickApp_ID, "setSegmentBrightness", "", 100)  --all segments
    hub.call(QuickApp_ID, "setSegmentColor", "", 0x8000FF)  --all segments
    hub.call(QuickApp_ID, 'setValue', 1)   --brightness
    hub.sleep(8000)

    hub.call(QuickApp_ID, 'setValue', 100)  --brightness
    hub.call(QuickApp_ID, "setSegmentColor", "[0,3,6,9]", 0xff0000)  --segments 0,3,6,9
    hub.call(QuickApp_ID, "setSegmentColor", "[1,4,7,10]", 0xff00) --RGB(0,255,0)
    hub.call(QuickApp_ID, "setSegmentColor", "[2,5,8,11,12]", 0xff) --RGB(0,0,255)

    hub.call(QuickApp_ID, "setSegmentBrightness", "[0,1,2]", 1)   --segments 0,1,2
    hub.call(QuickApp_ID, "setSegmentBrightness", "[3,4,5]", 10)
    hub.call(QuickApp_ID, "setSegmentBrightness", "[6,7,8]", 30)
    hub.call(QuickApp_ID, "setSegmentBrightness", "[9,10,11,12]", 100)
   
    -- scene/snapshot names below are NOT case-sensitive
    --hub.call(QuickApp_ID, "setSnapshotByName", "alarm")
    hub.call(QuickApp_ID, "setLightSceneByName", "stacking")
    --hub.call(QuickApp_ID, "setDIYSceneByName", "My scene")

elseif string.len(sc) > 1 then
    print("scene by name:",sc)
    hub.call(QuickApp_ID, "setLightSceneByName", sc)
    hub.setGlobalVariable('Govee_scene', '')
else
    print("dummy call, variable:",sc)
end

--also supported standard calls
--hub.call(QuickApp_ID, 'turnOn')
--hub.call(QuickApp_ID, 'turnOff')
--hub.call(QuickApp_ID, 'toggle')

The example block scene below shows how to easily start rainbow light scene at the device. This scene triggers the LUA scene listed above by change of the global variable). In the example below, scene changes also brightness, to start the scene dimmed to 50%.

  

Donate 

The QuickApp is distributed free, but in form of encrypted fqax file.

If you find my work useful to you or to your clients, then please support me with a donation. Thanks to this, I will be able to continue to create and develop further solutions and integrations for home automation. You can donate any amount of money via PayPal using this link: https://www.paypal.com/donate/?hosted_button_id=EUH377Q9U4UGJ  

In case on any other type of the support you can contact me via Fibaro Forum message or directly by e-mail: smarthome @ hdev.pl  

THANK YOU VERY MUCH!

33 Comments,  Want to add comment please login
9086b3ae49454c0bf13963d30047621f

I released completly new version (2.0) based on new Govee API. Description above was updated for this new version.

3f80fb418e61861d2faf5b13723e5f84

Hello, thanks this is great, tested with outdoor spot lights, but unfortunately only white, no rgbw control

9086b3ae49454c0bf13963d30047621f

Hi Irek. No repo. I know that there are some updates to do. Contact me via smarthome @ hdev.pl

196030d17fd487ad7b27e3b4e784dac1

Hi Albert, do you have a public repo for this quick app? There are few changes that this QA needs and I would like to participate, rather than forking your work or building separate QA.

C07e25adef0bd82dc36e1fb71585f20b

Hi, I have Govee Outdoor String and it only controlls white color. In Yubii I see no RGB controlls. Is there any fix for it?

© 2024. Nice-Polska Sp. z o.o.Privacy policyTerms & ConditionsFeedback