Created At
Jan 10, 2022
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
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):
QuickApp provide simple API for LUA programmers, that allow for more advanced control of the light.
Available functions:
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.
Sample call to activate Alarm snapshot (snapshot name is NOT case sensitive)hub.call(345, "setSnapshotByName", "alarm") --where 345 is Govee QuickApp ID
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
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.
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.
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%.
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!
Hello, thanks this is great, tested with outdoor spot lights, but unfortunately only white, no rgbw control
Hi Irek. No repo. I know that there are some updates to do. Contact me via smarthome @ hdev.pl
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.
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?
I released completly new version (2.0) based on new Govee API. Description above was updated for this new version.