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

Toggle option in api/devices/.../action/...


Elio

Question

Hi all,

Has anyone manage to get this to work, or actually even work out what the action 'param' for toggle is

 

Please login or register to see this link.

/api/devices/541/action/turnOn

works fine as does action/turnOff

 

docs say a double switch has these actions :

Actions:

  • Turn on
  • Turn off
  • Toggle

 

I've tried every permutaion of toggle turnToggle, upper / lower case I can think of but cant work out the 'toggle' option.....

 

I've managed to get a whole bunch of esp8266 (tasmota) stuff working with Fibaro (inbound as sensors/switches as well as managed devices/VD's) but the fact I cant 'toggle' a lights status via a remote battery powered momentary switch is driving me round the twist.

 

Any ideas?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

To perform toggle action you need to use post method :

POST https://hc-IP/api/devices/92/action/toggle

where payload: args={92,turnOn}

Edited by cag014
Link to comment
Share on other sites

  • 0
  • Inquirer
  • thanks for the reply

    yep i'm doing a POST, running curl through a shell script on a pi zero that take args $1,$2 as device and action. Driven by a simple php page that you can shoot a url at from the most basic device without doing authentication as the pi injects that.

     

    I've tired with your payload suggestion

    curl -g -H "Content-Type: application/json" -d '{"$1","turnOn"}' -X POST http://xxx:[email protected]/api/devices/$1/action/$2

    works with both turnOn and turnOff as before

    original I had also worked with both

    curl -g -H "Content-Type: application/json" -d {} -X POST http://xxx:[email protected]/api/devices/$1/action/$2

     

    hard code or command line toggle and no joy

     

    tried all of this on the api forms page fib-ip/docs on the POST call action option and whilst turnOn/turnOff work there as well toggle does nothing.

    I'm using a standard fibaro switch 2... perplexed...

    Link to comment
    Share on other sites

    • 0

    I don't know how to explain that, but it didn't work for me till I have switched HC3 to https  and then back to http.

    Play with this and see if it works... let me know

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • I'm on a HC2 so cant turn https on / off.

    On inspecting the device object via /docs I get :

    Please login or register to see this code.

    so I do wonder if toggle is 'actually' supported on a Fibaro (Double) Swtich 2, In the end I created a new endpoint to fire a scene that checks the device value and then sets it to the opposite.  Not very pretty but it works...

     

    For anyone that cares the entire sequence of :

     

    rf433 switch -> sonoff bridge module -> pi zero php webpage -> curl -> fibaro scene -> toggle lights.... executes in about 1/2 second

    so

    I can place a normal wall switch (rf433 module is in the back box) in a location where its not easy to get either (a) a switch line in or  (b) even power for that matter and still control a set of lights.

     

     

     

     

     

    Link to comment
    Share on other sites

    • 0

    Oops... HC2? since you've posted this in Home Center 3 section I thought we're dealing with HC3 (QuickApp), my bad.

    There is no toggle command for fibaro switch 2. The meaning of toggle switch in user manual, that you have toggle option to control via switch connections. (S1/S2). This is not an action command.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • oups yes my bad appologies for that - if an admin knows how to move this thread...

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