Door Contact - JSON Call

Moderator: leecollings

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

Door Contact - JSON Call

Post by Jzjr »

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

- Dell Optiplex 390 - Ubuntu Linux 18.04.01 LTS - Aeotec Z-Wave USB - RFXtrx433 - Hue Hub 2 - LGTV Plugin -
Hue Bulbs in every room, Temp Sensors on each floor, Temp-Monitoring Fridge, LightWaveRF 'Mood Switches'
safi78
Posts: 204
Joined: Thursday 05 September 2013 15:39
Target OS: Linux
Domoticz version: LastBeta
Contact:

Re: Door Contact - JSON Call

Post by safi78 »

Maybe it helps to show us what command you have used & what error you get? ;)
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Door Contact - JSON Call

Post by Egregius »

You'll need the udevice command, see wiki.
Andrex
Posts: 92
Joined: Thursday 18 February 2016 9:11
Target OS: Linux
Domoticz version:
Contact:

Re: Door Contact - JSON Call

Post by Andrex »

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: 1
Joined: Wednesday 08 June 2016 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Door Contact - JSON Call

Post by DrEmil »

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
Alain
Posts: 166
Joined: Sunday 26 April 2020 5:27
Target OS: Linux
Domoticz version: 2022.1
Location: Netherlands
Contact:

Re: Door Contact - JSON Call

Post by Alain »

Did you get this working with "open" and "closed"? I don't want it to say "On" or "Off" because it is a contact, not really a switch.
Hue | Zigbee2Mqtt | MQTT | P1 | Xiaomi | RFXCom | Modbus | Qlima | Solaredge
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest