Door Contact - JSON Call

Post Reply
Jzjr
Posts: 20
Joined: Monday 05 October 2015 15:00
Target OS: Linux
Domoticz version: 3.8796
Location: UK
Contact:

Door Contact - JSON Call

Post by Jzjr » Thursday 03 November 2016 20:53

Hi,

I am trying to update a door contact dummy switch through JSON but can't seem to find the correct format. I have tried using switch commands but receive an error.

Can anyone help me to learn the correct command?

Thanks
Fred
-
Fred Boniface

- Acer Veriton Mini PC - Aeotec Z-Wave USB - RFXtrx433 - Oregon Scientific Sensors - Horstmann Thermostat - LightwaveRF Mood Switches -

User avatar
safi78
Posts: 460
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Location: Alkmaar, NL
Contact:

Re: Door Contact - JSON Call

Post by safi78 » Thursday 03 November 2016 21:16

Maybe it helps to show us what command you have used & what error you get? ;)
I don't know if you noticed or not, but I'm an extremely arrogant man who tends to think all of his plans will work ...

https://safiweb.nl

homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz

User avatar
Egregius
Posts: 2513
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Door Contact - JSON Call

Post by Egregius » Thursday 03 November 2016 22:43

You'll need the udevice command, see wiki.

Andrex
Posts: 60
Joined: Thursday 18 February 2016 10:11
Target OS: Linux
Domoticz version:
Contact:

Re: Door Contact - JSON Call

Post by Andrex » Friday 27 January 2017 22:40

I've read the wiki but there is no trace of contacts.
I've tried the udevice (/json.htm?type=command&param=udevice&idx=65&nvalue=0&Status=Open) and even if the result is

Code: Select all

{
   "status" : "OK",
   "title" : "Update Device"
}
the device is not updated, it's always "Closed"

This is the device:

Code: Select all

{
   "ActTime" : 1485549591,
   "ServerTime" : "2017-01-27 21:39:51",
   "Sunrise" : "07:51",
   "Sunset" : "17:21",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "Closed",
         "Description" : "",
         "Favorite" : 0,
         "HardwareID" : 8,
         "HardwareName" : "Dummy",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "HaveDimmer" : true,
         "HaveGroupCmd" : true,
         "HaveTimeout" : false,
         "ID" : "00014091",
         "Image" : "Light",
         "IsSubDevice" : false,
         "LastUpdate" : "2017-01-27 21:33:26",
         "Level" : 0,
         "LevelInt" : 0,
         "MaxDimLevel" : 100,
         "Name" : "Andrea Home?",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "Status" : "Closed",
         "StrParam1" : "",
         "StrParam2" : "",
         "SubType" : "Selector Switch",
         "SwitchType" : "Contact",
         "SwitchTypeVal" : 2,
         "Timers" : "false",
         "Type" : "Light/Switch",
         "TypeImg" : "contact",
         "Unit" : 1,
         "Used" : 1,
         "UsedByCamera" : false,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "65"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
Thanks,
Andrea

DrEmil
Posts: 2
Joined: Wednesday 08 June 2016 17:05
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Door Contact - JSON Call

Post by DrEmil » Tuesday 28 November 2017 22:04

Try this (it works for me):

/json.htm?type=command&param=switchlight&idx=13&switchcmd=On
/json.htm?type=command&param=switchlight&idx=13&switchcmd=Off

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests