[SOLVED]RESTful toggle command doesn't seem to work wit...

Posted on
Thu Aug 28, 2014 10:49 am
NicholFD offline
Posts: 94
Joined: Nov 22, 2003

[SOLVED]RESTful toggle command doesn't seem to work wit...

I have a virtual device named "Dk Wall Lights Link" that is linked to a variable named "DkWallLightsLink". This is linked to Action Groups that simply toggle the variable between True & False.

In the GUI client, if I change either the device or variable, they work as expected, so I'm pretty sure I have the VD setup correctly.

Using REST commands, I can't get the toggle command to work with either the variable or the device. Output below:
Code: Select all
deck_rpi ~ # curl -s --digest --user user:password  http://maggie:8969/devices/Dk%20Wall%20Lights%20Link.txt
name : Dk Wall Lights Link
address : 0
addressStr : unknown
classID : 1
desc : Deck Wall Lights linked to set on/off/brightness the same
devProtocol : 999
displayInUI : True
displayLongState : off
displayRawState : off
folderID : 0
hasStateToDisplay : True
id : 565309260
isOn : False
lastChanged : 462536507
lastChangedDateStr : 2014-08-28
lastChangedRFC3339 : 2014-08-28T14:21:47Z
lastChangedRFC822 : Thu, 28 Aug 2014 14:21:47 GMT
lastChangedTimeStr : 10:21:47 AM
type : Virtual On/Off Device
typeFlags : 17
typeSupportsDim : False
typeSupportsEnergyMeter : False
typeSupportsHVAC : False
typeSupportsIO : False
typeSupportsOnOff : True
typeSupportsSensorValue : False
typeSupportsSpeedControl : False
typeSupportsSprinkler : False
versByte : 0

deck_rpi ~ # curl -s --digest --user user:password  http://maggie:8969/variables/DkWallLightsLink.txt
name : DkWallLightsLink
displayInUI : True
id : 1856621191
isFalse : True
readOnly : False
value : false

deck_rpi ~ # curl -s --digest --user user:password  -X PUT -d toggle=1 http://maggie:8969/devices/Dk%20Wall%20Lights%20Link
This resource can be found at <a href='http://maggie:8969/devices/Dk Wall Lights Link'>http://maggie:8969/devices/Dk Wall Lights Link</a>.

deck_rpi ~ # curl -s --digest --user user:password  http://maggie:8969/devices/Dk%20Wall%20Lights%20Link.txt
name : Dk Wall Lights Link
address : 0
addressStr : unknown
classID : 1
desc : Deck Wall Lights linked to set on/off/brightness the same
devProtocol : 999
displayInUI : True
displayLongState : off
displayRawState : off
folderID : 0
hasStateToDisplay : True
id : 565309260
isOn : False
lastChanged : 462536507
lastChangedDateStr : 2014-08-28
lastChangedRFC3339 : 2014-08-28T14:21:47Z
lastChangedRFC822 : Thu, 28 Aug 2014 14:21:47 GMT
lastChangedTimeStr : 10:21:47 AM
type : Virtual On/Off Device
typeFlags : 17
typeSupportsDim : False
typeSupportsEnergyMeter : False
typeSupportsHVAC : False
typeSupportsIO : False
typeSupportsOnOff : True
typeSupportsSensorValue : False
typeSupportsSpeedControl : False
typeSupportsSprinkler : False
versByte : 0

deck_rpi ~ # curl -s --digest --user user:password  http://maggie:8969/variables/DkWallLightsLink.txt
name : DkWallLightsLink
displayInUI : True
id : 1856621191
isFalse : True
readOnly : False
value : false


I have the same results if I try to toggle the variable instead of the VD.

Any ideas?

Thanks,
Frank

Posted on
Thu Aug 28, 2014 11:24 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: RESTful toggle command doesn't seem to work with Virtual

Did you specify a toggle action group (and enable the Supports Toggle checkbox) in the virtual device config?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Aug 28, 2014 11:36 am
NicholFD offline
Posts: 94
Joined: Nov 22, 2003

Re: RESTful toggle command doesn't seem to work with Virtual

Nope... :roll:

From my other discussion about VD's, I obviously don't know everything I need to know about them.

I just modified the VD as you described, and it's working as expected via the REST toggle command

Thanks again!

Frank

Ps. Please mark this as answered or solved.

Posted on
Thu Aug 28, 2014 12:09 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: [ANSWERED]RESTful toggle command doesn't seem to work wi

Glad it's working. I marked this one, though all we do is go back to the first post and prepend [ANSWERED] or [SOLVED] to the subject - no rules about which to use, just whichever seems appropriate.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 11 guests

cron