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

Switch on/off via API


Question

Posted

Hi!

 

I connected my Fibaro HC2 to Homeassistant.

There is one device - an Everpring EH403 Z-Wave flood light with motion detector - where one function was not transferred.

This function is the flood light on/off manually which could be managed well by adding a Virtual Device in HC2 and create 2 buttons with fibaro:call functions in LUA, no big deal.

 

Now I'm also able to switch it on and off via http commands, like this: 

Please login or register to see this code.

This works well if I copy this link to Chrome for example.

 

But how can I use this with curl? Can somebody help me please? And please don't direct me to API documentation...I don't understand in and I didn't find an example with my problem which can help me understand the syntax.

Thanks

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
1 hour ago, s8109csa said:

Hi!

 

I connected my Fibaro HC2 to Homeassistant.

There is one device - an Everpring EH403 Z-Wave flood light with motion detector - where one function was not transferred.

This function is the flood light on/off manually which could be managed well by adding a Virtual Device in HC2 and create 2 buttons with fibaro:call functions in LUA, no big deal.

 

Now I'm also able to switch it on and off via http commands, like this: 

Please login or register to see this code.

This works well if I copy this link to Chrome for example.

 

But how can I use this with curl? Can somebody help me please? And please don't direct me to API documentation...I don't understand in and I didn't find an example with my problem which can help me understand the syntax.

Thanks

I think you've an issue with credentials... via Chrome you get a popup for user and password and after that it works always.

please try

http://<user>:<password>@192.168.0.68/api/callAction?deviceID=25&name=turnOn

Hope you don't need to encode special characters. (

Please login or register to see this link.

 

Edited by cag014
  • 0
  • Inquirer
  • Posted

    Hi @cag014!

     

    As I wrote in my post, I am able to operate the device with http commands but it is not what I want since in Home Assistant, URL opens a webpage with the link.

    I want to use "curl" command to operate the device. Luckily I was able to find the solution which I hope will help others too:

    So I needed to create a special switch, a Command Line type switch in Configuration.YAML like this:

    Please login or register to see this code.

     

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