Jump to content

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


Question

Posted (edited)

This QuickApp gets your energy consumption and production data from Tibber Live. 
This QuickApp can be used in combination with the Tibber Monitor to get the Tibber Prices. 
Based on the Fibaro WebSockets/GraphQL demo by Peter Gebruers 

 

If you use Tibber for your Energy Panel, you can use this Tibber Live QuickApp for your energy consumption and production combined with the Tibber Monitor QuickApp to provide the Energy Panel with the hourly prices. 

 

Please login or register to see this attachment.

 

 

Main device with positive or negative actual power consumption

 

Child devices are available for:

  • power (Actual consumption with maxPower in log text)
  • powerProduction (Actual production with maxPowerProduction in log text)
  • accumulatedConsumption (Todays consumption, also the child device for the Energy Panel)
  • accumulatedProduction (Todays production)
  • accumulatedCost (Todays cost)
  • Accumulated Reward (Todays reward for energy production) 
  • Net Profit (Todays reward for energy production minus todays cost for energy consumption) 
  • accumulatedConsumptionLastHour (Consumed since since last hour shift)
  • accumulatedProductionLastHour (Produced since last hour shift)
  • lastMeterConsumption (Total consumption)
  • lastMeterProduction (Total production)
  • voltagePhase1
  • voltagePhase2
  • voltagePhase3
  • currentL1
  • currentL2
  • currentL3

 

Please login or register to see this attachment.

 

 

Available information: 

  • power (Consumption at the moment (Watt))
  • maxPower (Peak consumption since midnight (Watt))
  • powerProduction (Net production (A-) at the moment (Watt))
  • maxPowerProduction (Max net production since midnight (Watt))
  • accumulatedConsumption (kWh consumed since midnight)
  • accumulatedProduction (net kWh produced since midnight)
  • accumulatedCost (Accumulated cost since midnight; requires active Tibber power deal)
  • currency (Currency of displayed cost; requires active Tibber power deal)
  • lastMeterConsumption (Last meter active import register state (kWh))
  • lastMeterProduction (Last meter active export register state (kWh))
  • voltagePhase1 (Voltage on phase 1) *
  • voltagePhase2 (Voltage on phase 2) *
  • voltagePhase3 (Voltage on phase 3) *
  • currentL1 (Current on L1) *
  • currentL2 (Current on L2) *
  • currentL3 (Current on L3) *
  • accumulatedConsumptionLastHour (kWh consumed since since last hour shift)
  • accumulatedProductionLastHour (net kWh produced since last hour shift)
  • accumulatedReward (Accumulated reward since midnight; requires active Tibber power deal)
  • minPower (Min consumption since midnight (Watt))
  • averagePower (Average consumption since midnight (Watt))
  • powerReactive (Reactive consumption (Q+) at the moment (kVAr)) *
  • powerProductionReactive (Net reactive production (Q-) at the moment (kVAr)) *
  • minPowerProduction (Min net production since midnight (Watt))
  • maxPowerProduction (Max net production since midnight (Watt))
  • powerFactor (Power factor (active power / apparent power)) *
  • signalStrength (Device signal strength (Pulse - dB; Watty - percent)) *
  • timestamp (Timestamp when usage occurred)

* on Kaifa and Aidon meters the value is not part of every HAN data frame therefore the value is null at timestamps with second value other than 0, 10, 20, 30, 40, 50. There can be other deviations based on concrete meter firmware. In this QuickApp "null" values are replaced by their previous values. 

 

To communicate with the API you need to acquire a OAuth access token and pass this along with every request passed to the server.
A Personal Access Token give you access to your data and your data only. 
This is ideal for DIY people that want to leverage the Tibber platform to extend the smartness of their home. 
Such a token can be acquired here:

Please login or register to see this link.

 

When creating your access token or OAuth client you’ll be asked which scopes you want the access token to be associated with. 
These scopes tells the API which data and operations the client is allowed to perform on the user’s behalf. 
The scopes your app requires depend on the type of data it is trying to request. 
If you for example need access to user information you add the USER scope. 
If information about the user's homes is needed you add the appropriate HOME scopes.
If you have more than one home in your subscription, you need to fill in your home number the change between your homes. 


If the Tibber server disconnects the webSocket, the QuickApp wil do a re-connect for the amount in the QuickApp variable reconnect. 
If the re-connect fails for that amount, there will be a timeout for the seconds in the QuickApp variable timeout. 

 

Use this QuickApp at your own risk. You are responsible for ensuring that the information provided via this QuickApp do not contain errors. 
Tibber is a registered trademark being the property of TIBBER. TIBBER reserves all rights to the registered trademarks.
Information which is published on TIBBER’s websites belongs to TIBBER or is used with the permission of the rights holder. 
Making of copies, presentations, distribution, display or any other transfer of the information on the website to the public is, except for strictly private use, prohibited unless done with the consent of TIBBER. 
Published material on dedicated TIBBER press websites, intended for public use, is exempt from the consent requirement.
Also see:

Please login or register to see this link.

 

Guide Communicating with the Tibber API:

Please login or register to see this link.


Tibber API Explorer:

Please login or register to see this link.


Tibber gitHub:

Please login or register to see this link.


Tibber SDK NET:

Please login or register to see this link.


Fibaro webSocket manual:

Please login or register to see this link.


Fibaro Forum - Headers in webSocket:

Please login or register to see this link.


WebSocket++ Documentation:

Please login or register to see this link.


GraphQL over WebSocket Protocol:

Please login or register to see this link.


GraphQL query language:

Please login or register to see this link.

 

Version 4.0 (3rd January 2025)

  • Added child for Accumulated Reward (todays reward for energy production). 
  • Added child for Net Profit (todays reward for energy production minus todays cost for energy consumption). 
  • Added more functions to fully disable the quickapp. If the QuickApp is disabled by the user, now also the buttons and fibaro calls are disabled.
  • Added buttons to disconnect and connect webSocket session. 
  • Changed the behaviour of connecting to the Tibber WebSocket. After the maximum reconnects (10), the QuickApp disconnects and sends a notification to the Tibber iOS or Android app. The Tibber user gets better informed and can take action. 
  • Removed the reconnect QuickApp variable, not necessary to get changed by the Tibber user, it is now hardcoded (and the value is still 10 reconnects). 
  • Added check if realtime consumption (Tibber Pulse is working) is enabled at startup of the QuickApp and when reconnecting the QuickApp. If the Tibber Pulse is not available, not working, then the QuickApp will go in disconnected status and in the labels the Tibber user can see the reason. 
  • Added Net Profit (todays reward for energy production minus todays cost for energy consumption) to the labels. 
  • Placed the average power consumption (Watt) more prominent in the labels. 
  • Added Tibber Server responses to the labels (they were already in de debuglogging) so the Tibber users gets better informed about the connection status. 
  • Added the check for a new QuickApp version. The user gets notified in the Fibaro Notifications of the new QuickApp with the changelog. 
  • Changed the debuglevels a bit, so you can see the connection statusses already in debuglevel 2. 
  • Changed QuickApp variabels 'token' and 'homeId' to secret (stored encrypted) so they cannot get shown or published unintentionally. 
  • Added dynamic Tibber Live webSocket URL (at startup the QuickApp gets the current webSocket URL), so the QuickApp is future proof in case the WebSocket URL gets changed. 
  • Removed both simulation modes (debugLevel 4 and 5). 

 

Version 3.0 (8th March 2023)

  • Removed Tibber old Websocket code
  • Prepared, not enabled: Check home.features.realTimeConsumptionEnabled has a true value always before reconnecting
  • Prepared, not enabled: Added button to disconnect or re-connect the Tibber webSocket
  • Prepared: Added quickapp variable homeNr (most of the time 1) to be able to check the response realTimeConsumptionEnabled

Version 2.3 (beta 8th December 2022)

  • Improved the 60 seconds interval child devices update, it now never skips a beat
  • Added translation for English (en), Dutch (nl), Swedish (se), Norwegian (no)
  • Changed the json response for the debugLevel=4 Offline Simulation mode, the date/time format was wrong
  • Added random (jitter) reconnection handleDisconnected and handleError between 10 and 15 seconds
  • Added random (jitter) reconnection interval handleDisconnected and handleError plus between 1 and 10 seconds
  • Added exponential backoff (increasing delay) between each timeout. The increase is limited to 10 times the value in the quickapp reconnect variable. 

Version 2.2 (20th November 2022)

  • Changed to new Tibber webSocket requirements, required from December 2022

Version 2.1 (15th October 2022)

  • Child devices are now updated every (whole) minute to reduce CPU load
  • Replaced zero values for Voltage L1 L2 L3 with the previous value

Version 2.0 (5th August 2022)

  • Added two child devices, Hourly Consumption and Hourly Production
  • Added re-connect routine to handleError. If an Tibber error occurs, the QuickApp will try to re-connect. Thanks @JcBorgs for testing. 
  • Improved routine to handle Tibber null values. Thanks @Darquan for testing. 
  • Changed labels a bit to save some space
  • Changed "volt" and "amp" text in the labels. Thanks @Morten22 for mentioning. 
  • Changed kWh device types from com.fibaro.electricMeter to com.fibaro.energyMeter

Version 1.0 (19th June 2022)

  • Initial webSocket version Tibber Live
  • Thanks @JcBorgs for testing all beta versions and great suggestion to improve the quickapp
  • Based on the Fibaro WebSockets/GraphQL demo by @petergebruers


Variables (mandatory and created automatically): 

  • token = Authorization token (see the Tibber website: https://developer.tibber.com)

  • homeId = Tibber Home ID (see the Tibber website: https://developer.tibber.com)

  • homeNr = Tibber home (nodes) number if you have more than one home (default = 1)

  • language = Preferred language (default = en) (supported languages are English (en), Swedisch (se), Norwegian (no) and Dutch (nl))

  • reconnect = Amount of re-connects after disconnect from Tibber server (default = 10)

  • timeout = Pause after maximum amount of re-connects (default = 300 seconds)

  • debugLevel = Number 1=some, 2=few, 3=all (default = 1)

 

Fibaro Firmware:

Minimal version 5.111.48 (beta)

 

Download the QuickApp here:

Please login or register to see this attachment.

Or from the Fibaro Marketplace: 

Please login or register to see this link.


How to install: 

  1. Open the Configuration Interface
  2. Go to Settings > Devices
  3. Click  +
  4. Choose Other Device
  5. Choose Upload File
  6. Choose file from your computer with .fqax

 

(And enter your Token and Home ID in the quickapp variables)

 

 

 

 

 

 

Edited by SmartHomeEddy
  • Like 4
  • Thanks 4

Recommended Posts

  • 0
  • Inquirer
  • Posted

    Soon a new version of Tibber Live will see the light. I have several ideas of new functions and also some more technical changes to make the quickapp more smoothly working, will take place. 

     

    I could use some more interaction with you guys. It is a bit quiet over here. 

     

    The current version is 3.0.

    ‼️ If there are users on olders versions, I urgently advise to update to the latest 3.0 version. Older versions will no longer be supported by Tibber. 

    • 0
  • Inquirer
  • Posted
    On 9/18/2024 at 12:29 PM, SmartHomeEddy said:

    Soon a new version of Tibber Live will see the light. I have several ideas of new functions and also some more technical changes to make the quickapp more smoothly working, will take place. 

     

    I could use some more interaction with you guys. It is a bit quiet over here. 

     

    Also overhere, not received with such enthusiasm after all

    • 0
    Posted

    My quickapp freezes after running for a few days. Happens every time. It suddenly just stops updating. Any idea why?

    • Like 1
    • 0
  • Inquirer
  • Posted (edited)

    Hi @robbie11 there has been some general issues with the Tibber Pulse connection to the Tibber servers last day. That will result in connection issues of the Tibber Live quickapp. 
     

    Do you use the latest 3.0 version? 
     

    BTW There is a new quickapp on its way that handles the reconnection better, gives better notifications in case of issues (push messages and information in the label) and is easier to have the quickapp reconnect. (And a lot of other new stuff)

     

     

     

    Edited by SmartHomeEddy
    • Like 1
    • 0
    Posted

     

    Hi Eddy, 

     

    Yes, I'm using Tibber Live 3.0. 

    It drops out from time to time. Might take a day or so, before it comes alive again.  

    Last time it froze, the app never unfroze again. Not even wehen I deleted the whole quick app (device) and reinstalled it as a new device again.  Until I requested a new Access Token from Tibber, then it worked again. Was wondering if it had something to do with having too many WS connections to the Tibber server, even though I use only one (which is my HC3L). 

     

    Looking forward to the new Quickapp!

     

     

     

    • Like 1
    • 0
  • Inquirer
  • Posted

    Yes, it can have to do with too many sockets open. I am trying to find out if I can do something from within the quickapp to manage that. I know if you request the realtime subscription from the Tibber Explorer 

    Please login or register to see this link.

     and request is a few times, the sockets somehow are ok again. The quickapp connects again. 

     

    In the new quickapp I have added connect and disconnect buttons. I am testing if that can help, but I don't get disconnected in weeks now (also due to the retry mechanism). 

    • 0
    Posted

    Hi, when do you think it is ready? Mine keeps freezing.

    Please login or register to see this image.

    /monthly_2025_01/image.png.c95eb6063eae1a1c92ae231b48dea8ee.png" />

    • Like 1
    • 0
  • Inquirer
  • Posted (edited)

    Did some last modifications and final testing. Uploaded the newest version of the Tibber Live QuickApp (in the first post). 

     

    Don't forget to fill in your Token and Home ID in the quickapp variables !

     

    Please give me (us) some feedback on how the QuickApp works and what you use it for. 

     

    Version 4.0 (3rd January 2025)

    • Added child for Accumulated Reward (todays reward for energy production). 
    • Added child for Net Profit (todays reward for energy production minus todays cost for energy consumption). 
    • Added more functions to fully disable the quickapp. If the QuickApp is disabled by the user, now also the buttons and fibaro calls are disabled.
    • Added buttons to disconnect and connect webSocket session. 
    • Changed the behaviour of connecting to the Tibber WebSocket. After the maximum reconnects (10), the QuickApp disconnects and sends a notification to the Tibber iOS or Android app. The Tibber user gets better informed and can take action. 
    • Removed the reconnect QuickApp variable, not necessary to get changed by the Tibber user, it is now hardcoded (and the value is still 10 reconnects). 
    • Added check if realtime consumption (Tibber Pulse is working) is enabled at startup of the QuickApp and when reconnecting the QuickApp. If the Tibber Pulse is not available, not working, then the QuickApp will go in disconnected status and in the labels the Tibber user can see the reason. 
    • Added Net Profit (todays reward for energy production minus todays cost for energy consumption) to the labels. 
    • Placed the average power consumption (Watt) more prominent in the labels. 
    • Added Tibber Server responses to the labels (they were already in de debuglogging) so the Tibber users gets better informed about the connection status. 
    • Added the check for a new QuickApp version. The user gets notified in the Fibaro Notifications of the new QuickApp with the changelog. 
    • Changed the debuglevels a bit, so you can see the connection statusses already in debuglevel 2. 
    • Changed QuickApp variabels 'token' and 'homeId' to secret (stored encrypted) so they cannot get shown or published unintentionally. 
    • Added dynamic Tibber Live webSocket URL (at startup the QuickApp gets the current webSocket URL), so the QuickApp is future proof in case the WebSocket URL gets changed. 
    • Removed both simulation modes (debugLevel 4 and 5). 

     

     

    Edited by SmartHomeEddy
    • Like 2
    • 0
    Posted (edited)

    i cannot get the 4.0 to connect at all...

    [03.01.2025] [23:15:07] [WARNING] [TIBBER LIVE ID:951]: Trying to reconnect ... (3)[03.01.2025] [23:15:22] [DEBUG] [TIBBER LIVE ID:951]: Tibber Live - Version 4.0 - ⓒ by SmartHomeEddy[03.01.2025] [23:15:22] [DEBUG] [TIBBER LIVE ID:951]: createVariables() - Create all Variables[03.01.2025] [23:15:22] [DEBUG] [TIBBER LIVE ID:951]: checkForAvailableUpdate() - Check for new updates of the QuickApp[03.01.2025] [23:15:22] [DEBUG] [TIBBER LIVE ID:951]: sendGraphQLRequest() - Send a GraphQL query or mutation with retries, backoff, and jitter[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Response status sendGraphQLRequest: 200[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Response data sendGraphQLRequest: {"data":{"viewer":{"websocketSubscriptionUrl":"wss://websocket-api.tibber.com/v1-beta/gql/subscriptions"}}}[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Subscriptions Endpoint is wss://websocket-api.tibber.com/v1-beta/gql/subscriptions[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: sendGraphQLRequest() - Send a GraphQL query or mutation with retries, backoff, and jitter[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Response status sendGraphQLRequest: 200[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Response data sendGraphQLRequest: {"data":{"viewer":{"homes":[{"features":{"realTimeConsumptionEnabled":true}},{"features":{"realTimeConsumptionEnabled":true}}]}}}[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Realtime Consumption is Enabled[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: getData() - Get the data from Tibber[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: Connect: wss://websocket-api.tibber.com/v1-beta/gql/subscriptions {"User-Agent":"Tibber_Live\/4.0 Fibaro\/HC3 Firmware\/5.170.16","Sec-WebSocket-Protocol":"graphql-transport-ws","Authorization":""}[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: handleConnected() - Initialize the connection[03.01.2025] [23:15:23] [DEBUG] [TIBBER LIVE ID:951]: handleDisconnected() - The client or the server closed the socket[03.01.2025] [23:15:23] [WARNING] [TIBBER LIVE ID:951]: Trying to reconnect ... (10)[03.01.2025] [23:15:41] [DEBUG] [TIBBER LIVE ID:951]: getData() - Get the data from Tibber[03.01.2025] [23:15:41] [DEBUG] [TIBBER LIVE ID:951]: Connect: wss://websocket-api.tibber.com/v1-beta/gql/subscriptions {"User-Agent":"Tibber_Live\/4.0 Fibaro\/HC3 Firmware\/5.170.16","Sec-WebSocket-Protocol":"graphql-transport-ws","Authorization":""}[03.01.2025] [23:15:41] [DEBUG] [TIBBER LIVE ID:951]: handleConnected() - Initialize the connection[03.01.2025] [23:15:41] [DEBUG] [TIBBER LIVE ID:951]: handleDisconnected() - The client or the server closed the socket[03.01.2025] [23:15:41] [WARNING] [TIBBER LIVE ID:951]: Trying to reconnect ... (9)

     

    FYI Token removed :P

    Edited by Darquan
    • 0
  • Inquirer
  • Posted

    👓 Holymoly what small letters

     

    Did you disable the old quickapp? 
     

    You can have only one WebSocket active. And the countdown goes from 10 to zero, and your logging copy stops at 9, so maybe it connected? 

    • 0
    Posted

    i got message from tibber... maybe the old app somehow didnt det removed as it should...

    just wait and try reconnecting tomorrow

     

    • 0
  • Inquirer
  • Posted (edited)

    In the new quickapp you now have the possibilty to disconnect the WebSocket. In the old quickapp there wasn’t. So the socket could still be in use. 
     

    It could take some minutes to get it released,  But there is a way to force it a bit. Go to 

    Please login or register to see this link.

     and log in, choose real time subscription and hit the ▶️ until you get some data. 


     

    And yes, if the quickapp is disconnected, you get a nice message in your iOS or Android app. One of the many new functions. 
     

    Please login or register to see this attachment.


     

     

     

    Edited by SmartHomeEddy
    • 0
  • Inquirer
  • Posted

    If the quickapp is disconnected, you will also see it like this:

     

    Please login or register to see this image.

    /monthly_2025_01/IMG_5716.jpeg.8b4e2d02ec8ceb84d149bb11b4bda22d.jpeg" />

     

    That is also new. You can have the quickapp to re-connect just by clicking on the icon. 

    • 0
  • Inquirer
  • Posted
    On 1/3/2025 at 11:26 PM, Darquan said:

    i got message from tibber... maybe the old app somehow didnt det removed as it should...

    just wait and try reconnecting tomorrow

     


    Did you get the quickapp running? 

    • 0
    Posted
    On 1/5/2025 at 11:45 AM, SmartHomeEddy said:

    Did you get the quickapp running? 

    no.. i still get the same error

    • 0
  • Inquirer
  • Posted

    Also the right Home ID entered?

    • 0
    Posted
    1 minute ago, SmartHomeEddy said:

    Also the right Home ID entered?

    i just copied from the previous version... and now i cant doublecheck because there is only the asterixs :P

    but i will find new on tibber api


      "errors": [
        "Socket closed with event 4429 Too many open connections on this server; count 2;"
      ]

    i think i need to remove the QA because i thought it would be enough just to disconnect the app.. but obviously not??

    • 0
    Posted

    i tried disabling the QA

    • 0
  • Inquirer
  • Posted (edited)

    Try to push the ▶️ button a few times until you get some data. Then select a different query and push the ▶️ again until you get that data. I think that will do the job. 
     

    btw if you select the 👁️ before copying the Home ID or Token, you can see what you insert. 
     

     

     

    Edited by SmartHomeEddy
    • 0
    Posted
    3 minutes ago, SmartHomeEddy said:

    Try to push the ▶️ button a few times until you get some data. Then select a different query and push the ▶️ again until you get that data. I think that will do the job. 
     

    btw if you select the 👁️ before copying the Home ID or Token, you can see what you insert. 

     

    that did the trick:)

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...