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

Synology - AudioStation (HCL)


TheBalage

Question

Hi!

 

I have a Home Center LITE (without LUA support) and I am trying the creat a Virtual Device that can control my Synology NAS music player (AudioStation).

It has a good webapi kit, that I can use with HTTP commands, but can't solve it.

 

For example my ip addresses:

- Fibaro HCL: 192.168.1.10

- NAS: 192.168.1.20:5000

- NAS l/p: admin:admin

 

This is 3 command to the NAS (login / start music / pause music / etc.):

LOGIN:

http://192.168.1.20:5000/webapi/auth.cgi?api=SYNO.API.Auth&method=Login&version=1&account=admin&passwd=admin

START MUSIC:

http://192.168.1.20:5000/webapi/AudioStation/remote_player.cgi?api=SYNO.AudioStation.RemotePlayer&method=control&action=play&id=__SYNO_USB_PLAYER__&version=2

PAUSE MUSIC:

http://192.168.1.20:5000/webapi/AudioStation/remote_player.cgi?api=SYNO.AudioStation.RemotePlayer&method=control&action=play&id=__SYNO_USB_PLAYER__&version=2

 

I can transform to GET HTTP request as a virtual device button, but doesn't work (e.g.. Pause):

GET /webapi/AudioStation/remote_player.cgi?api=SYNO.AudioStation.RemotePlayer&method=control&action=pause&id=__SYNO_USB_PLAYER__&version=2 
HTTP/1.1
Host: 192.168.1.20:5000
Authorization: Basic admin:admin(Base64EncodedForm)

 

I think it is ok, but what about Virtual Device advanced settings fields?

- Name

- Room

- IP Address

- TCP Port

 

Is these IP Address and TCP Port the HCL's address or NAS's address? Don't working nether :/

Can somebody help me, I fell I am so close!

 

Thanks,

Balage

Edited by TheBalage
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

@TheBalage

This works for me in virtual device

 

Synology url:

http://ip:port/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method=Trigger&version=1&eventId=1&eventName=%22This%20is%20external%20event1%22&account=%22username%22&password=%22password%22

 

Make a virtual device with IP op synology en synology port in TCP

 

local selfId = fibaro:getSelfId();
local ip = fibaro:get(selfId, "IPAddress")
local port = fibaro:getValue(selfId, "TCPPort")
local url = "/<password>/sf/41/down"
local ws = Net.FHttp(ip, port)

local resp = ws:GET("http://ip:port/webapi/entry.cgi?api=SYNO.SurveillanceStation.ExternalEvent&method=Trigger&version=1&eventId=1&account=username&password=password")

fibaro:debug(resp);

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • @Stegenga

    Thanks your answer. I think this is LUA language, which my HCL doesn't support (just HC2).

    Anyway, i invested in a Sonos system, which I can manage with fibaro via plugin.

     

    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.

    ×
    ×
    • Create New...