Created At

Nov 29, 2017

Last Update

Dec 17, 2018


HC 2





Current status: Pre-release

Next steps: Get user feedback and improve

Need help or want to contribute?: [email protected]

How to

To enable price updates from Tibber you will need to download and import the virtual device which will hold the current price. You will also create a scene which is responsible for fetching the price and update you virtual device.

1. Go to tibber api login and retreive your access token. If you dont have a tibber account you can use demo token to test this.

2. Download the virtual device and import it. Optionally update icon. Retreive the deviceId, you will need it in step 3.

3. Create the LUA scene and call it I.e "Tibber scene". Add the code which is at the bottom of this post. Update the field where token is required. Update the DeviceId fields.

4. Now that your scene is setup you will have to update your device with the scene id.


Extended help:

The scene id is visible under: Scenes/Scene name/ general tab

The device id can be found using the local fibaro api i.e:




LUA script for scene:

local http = net.HTTPClient();

local payload = '{"query": "{viewer {homes {currentSubscription {priceInfo {current {total currency}}}}}}", "variables": null, "operationName": null}';


http : request('',  {

    options = {

        method = "POST",

        headers = {

            ['Authorization'] = 'Bearer YOUR_UNIQUE_TOKEN_HERE',

            ['Content-Type'] = 'application/json'



      data = payload


    success = function(response) 

      fibaro:debug (      

      local startIndex = string.find(,'{"total":') + 9;

      local endIndex = string.find(,',')-1;

      local price = string.sub(,startIndex, endIndex);    

      startIndex = string.find(,'currency":"') + 11;

      endIndex = string.find(,'}')-2;

      local currency = string.sub(,startIndex, endIndex);



      fibaro:call(DEVICE_ID, 'setProperty', 'ui.Price.value', price);

      fibaro:call(DEVICE_ID, 'setProperty', 'ui.TibberPrice.value', price..' '..currency);  


         error = function(err) fibaro:debug ("Error:" .. err)





6 Comments,  Want to add comment please login

[DEBUG] 22:38:12: {"data":{"viewer":{"homes":[{"currentSubscription":null}]}}} [DEBUG] 22:38:12: [DEBUG] 22:38:12: 2019-11-16 22:38:12.909620 [ fatal] LUA error: /opt/fibaro/scenes/175.lua:38: attempt to perform arithmetic on a nil value What is wrong?


Hi, I get the following error message when I try to update the main loop with the correct SCENE ID and DEVICE ID. I assume the DEVICE ID is the actual virtual device ID? --> Unable to create button - selected ID already exists.


Need to edit Main Loop to get VD to run automaticly. e.g: local lastModified = fibaro:getModificationTime(DEVICE ID, 'ui.Timestamp.value'); if ((os.time()) - tonumber(lastModified) >= 1800) then fibaro:startScene(SCENE ID); local time ("%c"); fibaro:debug(time); fibaro:call(DEVICE ID, 'setProperty', 'ui.Timestamp.value', time) else end


Same problem to me, the Scene dosen't run automaticly. It update the price if I run it manually.


The VD does not update automaticly. If i run the scene it seems to work, but is that the meaning?