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
Door Contact - JSON Call
Moderator: leecollings
-
- Posts: 14
- Joined: Monday 05 October 2015 15:00
- Target OS: Linux
- Domoticz version: 4.10717
- Location: UK
- Contact:
Door Contact - JSON Call
-
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'
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'
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: Door Contact - JSON Call
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
- 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
You'll need the udevice command, see wiki.
Re: Door Contact - JSON Call
I've read the wiki but there is no trace of contacts.
I've tried the udevice (/json.htm?type=command¶m=udevice&idx=65&nvalue=0&Status=Open) and even if the result is
the device is not updated, it's always "Closed"
This is the device:
Thanks,
Andrea
I've tried the udevice (/json.htm?type=command¶m=udevice&idx=65&nvalue=0&Status=Open) and even if the result is
Code: Select all
{
"status" : "OK",
"title" : "Update Device"
}
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"
}
Andrea
-
- Posts: 1
- Joined: Wednesday 08 June 2016 17:05
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Door Contact - JSON Call
Try this (it works for me):
/json.htm?type=command¶m=switchlight&idx=13&switchcmd=On
/json.htm?type=command¶m=switchlight&idx=13&switchcmd=Off
/json.htm?type=command¶m=switchlight&idx=13&switchcmd=On
/json.htm?type=command¶m=switchlight&idx=13&switchcmd=Off
-
- Posts: 166
- Joined: Sunday 26 April 2020 5:27
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Netherlands
- Contact:
Re: Door Contact - JSON Call
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
TP-Link | Plugwise | Thermosmart | Node-Red | Grafana | Master and 5 remote servers
Who is online
Users browsing this forum: No registered users and 1 guest