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)

Dear gurus!

 

There is a chance I can make integration for Bayrol pool devices, but first I need to know if it is possible. I used MQTT Explorer with the following settings:

Please login or register to see this spoiler.

 

and that works perfectly. For testing I subscribed to get all possible communication, but subscribing is not a big problem, problem is how to get connection with HC3 to their server.

Does anyone know if that is even possible with HC3?

 

@jgab, @cag014, @SmartHomeEddy, @Łukasz997, @tinman, @m.roszak anyone?

 

Thank you in advance! 🙏♥️

 

Edited by Sankotronic
Corrected title

8 answers to this question

Recommended Posts

  • 0
Posted

I use the WebSocket connection for the Tibber Live quickapp. With the help of Peter Gebruers I created the quickapp in 2022. Tibber doesn't have a username/password but uses a token. I use the token in the headers, something like

Please login or register to see this code.

 

First I do

Please login or register to see this code.

 

Then to initialise

Please login or register to see this code.

 

If I get a "connection_ack" then I send

Please login or register to see this code.

 

And if then I get

Please login or register to see this code.

Tibber Live responded with next (Operation execution result(s) from the source stream created by the binding Subscribe message)

And I can get the values that have returned. 

 

But this is all Tibber like. Don't know if you can translate that to Bayrol. 

 

 

  • Like 1
  • 0
  • Inquirer
  • Posted

    Thanks @SmartHomeEddy,

     

    maybe that is way to go. BTW - what is URL for Tibber? does it starts with ws:// or wss://?

    • 0
    Posted

    I retrieve the URL from Tibber at startup. But if I don't get the URL from Tibber, it is wss://websocket-api.tibber.com/v1-beta/gql/subscriptions, so wss://

    • 0
    Posted

    So, you can try a header similar to when we access the HC3

    Please login or register to see this code.

    It's usually the standard way to encode user/password credential in headers

    • Thanks 1
    • 0
    Posted

    I’m not a network transport expert, please allow me to say as I understand the problem.

    Bayrol seems to use MQTT transported over WebSocket. I tried to check whether the native Fibaro MQTT client can use WebSocket as its transport. I tested it against public WebSocket-MQTT endpoint wss://test.mosquitto.org:8081/mqtt

    Maybe I did soemthing wrong, but... Fibaro rejected it with 'invalid MQTT URI'

    So it looks like Fibaro’s native MQTT client supports normal MQTT/MQTTS, but not MQTT over WebSocket. 

    My impression is that, in Fibaro, MQTT and WebSocket are two separate closed blocks. The MQTT client does not seem to allow using an already opened WebSocket as its transport, and the WebSocket client does not speak MQTT by itself.

    So for Bayrol, direct use of Fibaro’s mqtt.Client is probably not possible.

     

    The remaining options seem to be:

    - use an external bridge/translator (I know there are some choices)  which connects to Bayrol via MQTT-over-WebSocket and republishes the data to normal MQTT

    - use Fibaro’s WebSocketClientTls and implement a minimal MQTT client manually on top of it.

    I think - theoretically possible with knowledge of net transport area. 
    I found a short story about integration on polish seller page - you can use google to translate. I think its quite valuable:

    Please login or register to see this link.


    By the way: may those happy times come when I have a swimming pool at home...

    • 0
    Posted

    There may also be another option, not MQTT-based: scraping the Bayrol PoolAccess web portal. I found examples (sklepbasenowy.pl/2025/03...) where Home Assistant uses Multiscrape to log in to:

    Please login or register to see this link.

    and then read data from:

    Please login or register to see this link.

     

    So - probably on HC3 this could be done with net.HTTPClient (not as simple): log in, remember cookies (?), periodically call getdata.php, and parse the returned HTML. It is probably more fragile than MQTT, because it depends on the portal HTML structure, but it may be easier than implementing MQTT-over-WebSocket manually.
     

    • Thanks 1
    • 0
  • Inquirer
  • Posted

    Hi @Łukasz997,

     

    thanks for the info. I will test all suggested when I upgrade software on my Bayrol Automatic SALT.

    What I'm still missing is how to define Port with WebSocket on HC3? Is that even possible?

     

     

     

    • 0
    Posted

    The port number is part of the URL:

    self.sock = net.WebSocketClientTls()
    self.sock:connect("wss://www.bayrol-poolaccess.de:8083/ws")

    But this only opens the WebSocket transport. It is not MQTT over WebSocket yet - MQTT packets would still have to be handled manually on top of it.
    To be confirmed - I'm not 100% sure.

    I take a look into Fibaro WebSocket documentation - probably old, from knowledge base. According to this, send(data) sends a string. In Lua, strings can contain binary data, so in theory it may be possible to send raw MQTT packets. But this still needs to be tested, because the examples only show text messages being sent over WebSocket.

    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...