OK so I just guessed at some of the other fields and ran this in the Api Tool
{
"method": "extensions.plugin.run",
"id": "1234",
"params": {
"script": "HUB:test_plugin/scripts/add_device",
"scriptParams": {
"name": "TestMotionSensor",
"category": "sensor",
"subcategory": "motion_sensor",
"type": "motion.sensor",
"device_type_id": "test",
"battery_powered": false
}
}
}
REQUEST:
Request
Request body
method: "extensions.plugin.run"
id: "1234"
params:
script: "HUB:test_plugin/scripts/add_device"
scriptParams:
name: "TestMotionSensor"
category: "sensor"
subcategory: "motion_sensor"
type: "motion.sensor"
device_type_id: "test"
battery_powered: false
RESPONSE
error: null
id: "1234"
method: "extensions.plugin.run"
However no motion sensor device in the Vera app showing up.
I then rebooted the Ezlo Plus hub but still no motion sensor device showing in the app.
Also the motion sensor device does not appear in the results of a “hub.devices.list” query in the Api Tool, so I have obviously done it wrong.
I need more information about these fields and what to put in them ?
“id”: “ID”, - Presumably some random and unique ID number string.
“category”: “switch”, - Need a list of the possible categories.
“subcategory”: “interior_plugin”, - Need a list of possible sub categories.
“type”: “switch.outlet”, - Need a list of the possible types.
“device_type_id”: “test”, - What should be entered in to here?
EDIT:
This works instead “scripts/generate_devices”
{
"method": "extensions.plugin.run",
"id": "12345",
"params": {
"script": "HUB:test_plugin/scripts/generate_devices",
"scriptParams": {
"device_type": "motion_sensor",
"devices_count": 1
}
}
}
The first attempt I was trying to use “scripts/add_device” and I need more information on that.
OK so I renamed my virtual motion sensor and added it in to a room.
From the API Tool - hub.devices.list:
hub.items.list:
@Oleh Its “hasSetter” is false as I feared it might be !
I need this to be true so I can control this virtual motion sensor from Blue Iris camera software and from other things on my LAN for other virtual motion sensors that I may create on the Ezlo Plus controller.
EDIT 2:
Seems it doesn’t matter if “hasSetter” = false.
In Postman I can trip this virtual motion sensor with this command:
https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d230120bab1065bc0e74&value_bool=true
And I can untrip it with this comand:
https://192.168.0.11:17000/v1/method/hub.item.value.set?_id=5f57d230120bab1065bc0e74&value_bool=false
So someone please explain why “hasSetter” is false for this virtual motion sensor ? A bug ?
EDIT 3:
I just created a virtual Switch device and its “hasSetter” = true OK.