Page 1 of 1

Create device JSON failed

Posted: Saturday 02 September 2023 19:32
by michelscholte
I'v tried to create e device with JSON. Type is 244 (light/switch) and subtype is 62 (selector). I have the last release 2023.2.

/json.htm?type=command&param=createdevice&idx=HWIDX&name=TEST&sensormappedtype=244
{
"status" : "ERR"
}

Also the older command doesn't'work.

Hopefully someone can help me.

Re: Create device JSON failed

Posted: Saturday 02 September 2023 21:03
by jvdz
Have you checked the log as I assume it tells you that this format API format has changed!
https://www.domoticz.com/wiki/Domoticz_ ... d_newer.29

Re: Create device JSON failed

Posted: Saturday 02 September 2023 21:30
by michelscholte
Thanks for your answer.

As you can see in my post I use the NEW command. It's not working with this new command.

Re: Create device JSON failed

Posted: Saturday 02 September 2023 21:39
by jvdz
Ah ... you're (of course) right.
Maybe a security issue as that change substantially too?

Shouldn't your url also include the subtype?
/json.htm?type=command&param=createdevice&idx=HWIDX&name=TEST&sensormappedtype=244&devicesubtype=62

Re: Create device JSON failed

Posted: Saturday 02 September 2023 21:55
by michelscholte
Unfortunately same issue.

http://192.168.1.114:8080/json.htm?type ... subtype=62

Creating of new hardware/sensors is already enabled,. So, also that cannot be the problem.

Re: Create device JSON failed

Posted: Sunday 03 September 2023 9:14
by kiddigital
What HTTP response code do you get? 200 or something else?

Try running domoticz with some debug flags enabled by setting ‘-debuglevel normal,hardware,auth’ for example.

Re: Create device JSON failed

Posted: Sunday 03 September 2023 10:43
by waltervl
Just to be sure..
You have to change HWIDX to an enabled dummy hardware gateway idx number or other hardware gateway that is controlling the device.