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


  • 0

Stream live data form Tibber pulse to HC2


Alexander_k_r
 Share

Question

I have a connection to Tibber for getting energy prices. But I would also like to get data from Tibber Pulse. Prices is collected with REST-API and POST request. Pulse data is collected with web socket and streams. Anyone done this before. Here is a example form python that works:

 

Please login or register to see this code.

 

Any helpe appreciated

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
  • Inquirer
  • On 12/27/2021 at 11:36 AM, Alexander_k_r said:

    I have a connection to Tibber for getting energy prices. But I would also like to get data from Tibber Pulse. Prices is collected with REST-API and POST request. Pulse data is collected with web socket and streams. Anyone done this before. Here is a example form python that works:

     

    Please login or register to see this code.

     

     

    On 12/27/2021 at 11:36 AM, Alexander_k_r said:

    Any helpe appreciated

     

    Since there is no support for websocet, I tryed with HC3. I get connected but disconnects at once , I think I am missing a header .....

     
    function QuickApp:GetLiveData()
    local sock = net.WebSocketClientTls()
    local interval = 10000
     
        local url1 = "wss://api.tibber.com/v1-beta/gql/subscriptions" 
     
     
     self.sock:connect(url1,"tibber token")
        self.sock:addEventListener("connected"function() self:handleConnected() end)
        self.sock:addEventListener("disconnected"function() self:handleDisconnected() end)
        self.sock:addEventListener("error"function(error) self:handleError(error) end)
        self.sock:addEventListener("dataReceived"function(data) self:handleDataReceived(data) end)
    end

     

    Link to comment
    Share on other sites

    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.

     Share

    ×
    ×
    • Create New...