Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Search the Community
Showing results for tags 'agent'.
-
I have put together agent skills for developing QuickApps (offline). These are files added to your coding workspace that contains best practices for coding QuickApps. Agent skills are a "standard" for most coding environments using agents - copilot, Claude code, Codex etc. In the past I have coded an MCP for QA support but this is a much better approach. Please delete the MCP if you use it... The caveat is that these skills assumes that you are using plua to code and test QuickApps. Many skills will use the plua command to to run troubleshooting scripts etc... The instructions below are specifically for vscode/copilot but should be easy to reuse for other AI coding tools. Just put the skills directory in the proper place for your tool and ask it to add the skills to CLAUDE.md, AGENT.MD etc. The install-qa-skills prompt is specific for VSCode but your agent can most likely convert it to your agents preferences. Below is for VSCode. To install the skills you run an agent prompt 'install-qa-skills'. It's also used to update the skills to the latest version. Before you can run /install-qa-skills, you need this prompt file in your workspace. Run one of these commands from your workspace root, then type /install-qa-skills in Copilot chat. Universal (Python — macOS, Linux, Windows): python3 -c "import urllib.request,pathlib; pathlib.Path('.github/prompts').mkdir(parents=True,exist_ok=True); urllib.request.urlretrieve('https://raw.githubusercontent.com/jangabrielsson/plua/main/.github/prompts/install-qa-skills.prompt.md','.github/prompts/install-qa-skills.prompt.md'); print('Done')" macOS / Linux (curl): mkdir -p .github/prompts && curl -sL https://raw.githubusercontent.com/jangabrielsson/plua/main/.github/prompts/install-qa-skills.prompt.md -o .github/prompts/install-qa-skills.prompt.md Windows (PowerShell): New-Item -ItemType Directory -Force .github/prompts | Out-Null; Invoke-WebRequest https://raw.githubusercontent.com/jangabrielsson/plua/main/.github/prompts/install-qa-skills.prompt.md -OutFile .github/prompts/install-qa-skills.prompt.md Then in VS Code Copilot Chat: type /install-qa-skills and the agent will download all skills automatically. And the same command to update the skills. The skills makes the agent aware about the REST API, the Fibaro Lua SDK, best practices, using plua etc. This will allow the agent to help you create QuickApps from scratch, debug existing QAs, review the code for potential issues etc An example prompt Create a QUickApp in test/QATemp.lua that is a multilevel sensor and shows the temperature fetched from some public webservice Creates the code below --%%name:Temperature Sensor --%%type:com.fibaro.temperatureSensor --%%var:pollInterval=300 --%%var:city="London" --%%u:{label="tempLbl",text="Temperature: --"} --%%u:{label="infoLbl",text="Last update: --"} --%%desktop:true --%%offline:true -- Fetches current temperature from Open-Meteo (no API key required). -- Uses the WMO geocoding API to resolve city → lat/lon, then Open-Meteo for weather. -- Change --%%var:city= to any city name. local BASE_GEO = "https://geocoding-api.open-meteo.com/v1/search?name=%s&count=1&language=en&format=json" local BASE_WEATHER = "https://api.open-meteo.com/v1/forecast?latitude=%s&longitude=%s¤t_weather=true" local function httpGet(url, cb) local http = net.HTTPClient() http:request(url, { options = { method = "GET", timeout = 10000 }, success = function(r) if r.status == 200 then local ok, data = pcall(json.decode, r.data) if ok then cb(data) else cb(nil, "JSON parse error") end else cb(nil, "HTTP " .. tostring(r.status)) end end, error = function(err) cb(nil, tostring(err)) end }) end function QuickApp:onInit() self:debug(self.name, self.id) self.city = self:getVariable("city") if self.city == "" then self.city = "London" end local interval = tonumber(self:getVariable("pollInterval")) or 300 self:fetchTemperature() setInterval(function() self:fetchTemperature() end, interval * 1000) end function QuickApp:fetchTemperature() local geoUrl = string.format(BASE_GEO, self.city:gsub(" ", "+")) httpGet(geoUrl, function(geo, err) if not geo or not geo.results or not geo.results[1] then self:warning("Geocoding failed for '" .. self.city .. "': " .. tostring(err or "no results")) self:updateView("infoLbl", "text", "Error: city not found") return end local lat = tostring(geo.results[1].latitude) local lon = tostring(geo.results[1].longitude) local weatherUrl = string.format(BASE_WEATHER, lat, lon) httpGet(weatherUrl, function(wx, werr) if not wx or not wx.current_weather then self:warning("Weather fetch failed: " .. tostring(werr)) self:updateView("infoLbl", "text", "Error: weather unavailable") return end local temp = wx.current_weather.temperature self:updateProperty("value", temp) self:updateProperty("unit", "C") self:updateView("tempLbl", "text", string.format("Temperature: %.1f °C", temp)) self:updateView("infoLbl", "text", "Updated: " .. os.date("%H:%M:%S") .. " (" .. self.city .. ")") self:debug("Temperature in", self.city, ":", temp, "°C") end) end) end Pretty reasonable. It even found an available web api to get the temp. We could improve it by asking Instead of a hard coded quickVar, could we use the location of the HC3? ...and it will change the code accordingly. The exact result may vary depending on what LLM model is used. In these examples (and my coding overall) I use Claude Sonnet 4.6. This is an excellent way to over time add new skills and best practices so the agent becomes smarter - and I will update the skills continuously as I identify these "best practices" and possible issues when coding QAs. If you find something the agent could handle smarter, let me know in this thread and we can add it to the skill collection. This is the first release so there is a ton of stuff that could be added... Also, if someone uses this with Claude code or Codex, please share the instructions in this thread. I'm not using Claude myself but maybe in the future. The skill files are available directly from the repo at https://github.com/jangabrielsson/plua/tree/main/.github
- 4 replies
-
- 1
-
-
- agent
- development
- (and 4 more)
