agentleFS
jangabrielssonjangabrielsson/flua/.github/skills/quickapp-types/SKILL.md

quickapp-types

Skill1 starsChanged 15 days agoMITView on GitHub

All Fibaro device types (40+ types: switches, sensors, climate, covers, controllers), flua file headers (--%%name, --%%type, --%%var, --%%u:, --%%debug, etc.), UI element syntax (label, button, slider, switch, select, multi), and minimal starter templates for each device category. USE FOR: creating a new QuickApp, choosing the right device type (e.g. "what type for a temperature sensor?"), defining UI elements, understanding required actions per device type.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All update value (boolean).

    line 171
  2. Very specific:

    All update value as number or {value=n, unit="C"}.

    line 192
  3. Very specific:

    All thermostat setpoint/temperature values use {value=n, unit="C"} format.

    line 209

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

QuickApp Device Types and Headers

Reference for all flua QuickApp file headers and the complete set of Fibaro device types.

Starter Lua templates are in the templates/ directory — the complete set (30 device types), one file per type, each with the type's canonical actions and property conventions (e.g. multilevelSwitch.lua handles turnOn/turnOff/setValue with value 0-99; temperatureSensor.lua asserts {value=, unit=}). Reference them when the user needs a working skeleton for a specific device type, and scaffold one with flua --tool newQA <type> [name] (lists all types with no argument).


flua Header Syntax

--%%key:value

Headers are Lua comments processed by flua before execution. All headers must appear before any Lua code.


Device Configuration Headers

--%%name:My QuickApp            -- display name (required)
--%%type:com.fibaro.binarySwitch -- device type (required)
--%%manufacturer:ACME Corp
--%%model:SmartDevice v1.0
--%%description:What this device does
--%%uid:unique-id-string

Variable Headers

--%%var:apiKey="abc123"          -- string value: must be a Lua string literal
--%%var:location="Stockholm"     -- strings need quotes
--%%var:updateInterval=30        -- numbers are Lua literals, no quotes needed

Gotcha: The value is evaluated as a Lua expression. --%%var:X=London evaluates the global London (likely nil). Use --%%var:X="London" for strings.

Interface Headers

--%%interfaces:{"battery","energy"}

Multi-file Headers

--%%file:./lib/utils.lua,utils   -- include external Lua file (path, module name)

To include a library file, use --%%file:$fibaro.lib.libraryName,alias (e.g. --%%file:$fibaro.lib.qwikchild,qwikchild)

Development & Debug Headers

--%%debug:refreshState=true,api=true,http=true  -- debug logging channels
--%%offline:true      -- legacy alias for --%%mode:offline
--%%mode:online|offline|proxy  -- runtime mode; proxy needs online + HC3 credentials
--%%warn:true         -- extra runtime warnings (e.g. api error statuses)
--%%db:file.json      -- seed data; --%%db:+file.json also persists state across restarts
--%%location:latitude=N,longitude=N  -- pin the sim's location (sun times)
--%%keep-alive:true   -- online: keep the run alive past idle
--%%scene:true        -- run this QA as an HC3 Lua scene
--%%uid:x / --%%description:x / --%%model:x / --%%build:x / --%%manufacturer:x
                      -- device properties
--%%clobber:name=value -- plua's --%%conceal: the PACKAGE value, taken RAW
                      -- (no Lua evaluation — don't quote it)

--%%save, --%%desktop, --%%breakonload, --%%project and --%%qacolor are plua directives flua does not implement (ignored/unknown) — remove them when migrating. --%%proxy:true is the legacy alias for --%%mode:proxy, not a casual flag.


UI Element Headers

Each --%%u: line defines one row. Use {{...},{...}} for multiple elements on the same row.

Label

--%%u:{label="statusLbl",text="Status: Ready"}

Button

--%%u:{button="myBtn",text="Click Me",onReleased="handleClick"}
-- callback: function QuickApp:handleClick(event) end

Switch (toggle)

--%%u:{switch="autoSwitch",text="Auto Mode",value="false",onToggleOn="handleOn",onToggleOff="handleOff"}
-- 5.221 split events (also onReleased); event.values[1] == "true"/"false" (string)

Slider

--%%u:{slider="brightSlider",text="Brightness",min="0",max="100",value="50",onChanged="handleSlider"}
-- use tonumber(event.values[1]) to get numeric value

Select (single-choice)

--%%u:{select="modeSelect",text="Mode",value="1",onToggled="handleSelect",
--      options={{type='option',text='Economy',value='1'},{type='option',text='Comfort',value='2'}}}

Multi (multi-select)

--%%u:{multi="tagMulti",text="Tags",values={"1","3"},onToggled="handleMulti",
--      options={{type='option',text='Tag A',value='1'},{type='option',text='Tag B',value='2'}}}

Multiple elements on one row

--%%u:{{button="onBtn",text="On",onReleased="turnOn"},{button="offBtn",text="Off",onReleased="turnOff"}}

Updating dropdowns at runtime

Single-select (select) — use "selectedItem" to set the current selection:

self:updateView("modeSelect", "options", {{type='option',text='Economy',value='1'},{type='option',text='Comfort',value='2'}})
self:updateView("modeSelect", "selectedItem", "1")   -- value string of the selected option

Multi-select (multi) — use "selectedItems" to set selected values, "options" to update the list:

self:updateView("tagMulti", "options", {{type='option',text='Tag A',value='1'},{type='option',text='Tag B',value='2'}})
self:updateView("tagMulti", "selectedItems", {"1","3"})  -- table of selected value strings

Gotcha: Using "values" instead of "selectedItems" (or "selectedItem" for single-select) will silently fail or have no effect on the HC3.

UI event callback pattern

function QuickApp:handleClick(event)
    -- event.deviceId, event.elementName, event.eventType, event.values
    self:debug("clicked:", event.elementName)
end

function QuickApp:handleSlider(event)
    local value = tonumber(event.values[1])
    self:updateView("brightSlider", "value", tostring(value))
end

Device Type Quick Reference

Switches

TypeRequired ActionsValue / Notes
com.fibaro.binarySwitchturnOn, turnOffvalue = boolean
com.fibaro.multilevelSwitchturnOn, turnOff, setValuevalue = 0–99
com.fibaro.colorControllerturnOn, turnOff, setValue, setColorvalue = 0–99, color = "r,g,b,w" string e.g. "200,10,100,255"

Templates: binary-switch.lua · multilevel-switch.lua · color-controller.lua

Binary Sensors

All update value (boolean). No required actions.

TypeTypical use
com.fibaro.binarySensorGeneric open/closed
com.fibaro.doorSensorDoor/window
com.fibaro.windowSensorWindow
com.fibaro.motionSensorPIR motion
com.fibaro.smokeSensorSmoke detector
com.fibaro.fireDetectorFire detector
com.fibaro.floodSensorWater/flood
com.fibaro.waterLeakSensorWater leak
com.fibaro.gasDetectorGas leak
com.fibaro.coDetectorCarbon monoxide
com.fibaro.rainDetectorRain
com.fibaro.heatDetectorHeat detector

Template: binary-sensor.lua

Numeric Sensors

All update value as number or {value=n, unit="C"}. No required actions.

TypeValue format
com.fibaro.temperatureSensor{value=21.5, unit="C"}
com.fibaro.humiditySensornumber 0–100
com.fibaro.lightSensornumber (lux)
com.fibaro.multilevelSensornumber
com.fibaro.energyMeternumber (kWh)
com.fibaro.powerMeternumber (W)
com.fibaro.rainSensornumber (mm/h)
com.fibaro.windSensornumber (m/s)

Template: templates/numeric-sensor.lua

Climate / Thermostat

All thermostat setpoint/temperature values use {value=n, unit="C"} format.

Full thermostat types — handle setThermostatMode, update thermostatMode, supportedThermostatModes, temperature:

TypeExtra ActionsExtra Properties
com.fibaro.thermostatsetThermostatMode, setHeatingThermostatSetpoint, setCoolingThermostatSetpointheatingThermostatSetpoint, coolingThermostatSetpoint
com.fibaro.thermostatHeatsetThermostatMode, setHeatingThermostatSetpointheatingThermostatSetpoint
com.fibaro.thermostatCoolsetThermostatMode, setCoolingThermostatSetpointcoolingThermostatSetpoint
com.fibaro.thermostatHeatCoolsetThermostatMode, setHeatingThermostatSetpoint, setCoolingThermostatSetpointheatingThermostatSetpoint, coolingThermostatSetpoint

Setpoint-only types — no mode, just setpoints + temperature:

TypeRequired Actions
com.fibaro.thermostatSetpointsetHeatingThermostatSetpoint, setCoolingThermostatSetpoint
com.fibaro.thermostatSetpointHeatsetHeatingThermostatSetpoint
com.fibaro.thermostatSetpointCoolsetCoolingThermostatSetpoint
com.fibaro.thermostatSetpointHeatCoolsetHeatingThermostatSetpoint, setCoolingThermostatSetpoint

HVAC System types — same interface as full thermostat counterparts:

TypeActions
com.fibaro.hvacSystemHeatsetThermostatMode, setHeatingThermostatSetpoint
com.fibaro.hvacSystemCoolsetThermostatMode, setCoolingThermostatSetpoint
com.fibaro.hvacSystemHeatCoolsetThermostatMode, setHeatingThermostatSetpoint, setCoolingThermostatSetpoint
com.fibaro.hvacSystemAutosetThermostatMode, setHeatingThermostatSetpoint, setCoolingThermostatSetpoint

Templates: thermostat.lua (full) · thermostat-heat.lua · thermostat-cool.lua · thermostat-heatcool.lua · thermostat-setpoint-heat.lua · thermostat-setpoint-cool.lua · thermostat-setpoint-heatcool.lua

Covers and Controllers

TypeRequired ActionsNotes
com.fibaro.windowCoveringopen, close, stop, setValuevalue = 0–99 (% open)
com.fibaro.deviceController(none — generic)define your own methods
com.fibaro.remoteController(none)call self:emitCentralSceneEvent(keyId, keyAttribute) to emit button events; keyAttribute defaults to "Pressed"
com.fibaro.alarmPartitionarm, disarmarmed = boolean, alarm = boolean

Templates: controller.lua · window-covering.lua · alarm-partition.lua · remote-controller.lua

Special

TypeRequired ActionsProperties
com.fibaro.playerplay, pause, stop, next, prev, setVolume, setMutevolume (0–100), mute (boolean), power (boolean)
com.fibaro.weather(none)Temperature {value=n,unit="C"}, Humidity (number), Wind (number) — note capital property names
com.fibaro.genericDevice(none)No specific interface contract

Templates: player.lua · weather.lua · generic-device.lua

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.