Create Custom Sensor with Axis Label in JSON call

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
ElPhilou
Posts: 8
Joined: Thursday 25 January 2018 17:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Create Custom Sensor with Axis Label in JSON call

Post by ElPhilou »

Hello,

I'm looking to create (and why not delete), one (and of course more) custom sensor with specific axis, by one call in JSON :roll:

The target is create it in one script.

I did a lot of research, on this forum and of course with our friend Google ;) but I didn't find the good call in JSON.

The excellent WIKI page Domoticz API/JSON URL's speak about createvirtualsensor ( Create a virtual sensor ) with one Dummy Hardware, but I can't find how call to have one new Custom Sensor without ERROR :cry: :oops:

I think, is look like something like that :

Code: Select all

http://IPADRESS:8080/json.htm?type=createvirtualsensor&idx=DUMMY_HARDWARE_ID&sensorname=NAME&sensortype=CustomSensor&axislabel=NAMELABEL
But all my tests failed :?

So, if somebody have the good call ( in JSON or other ) to create ( and delete ) one customsensor, you are welcome :D
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Create Custom Sensor with Axis Label in JSON call

Post by waaren »

ElPhilou wrote: Wednesday 04 September 2019 20:29 I'm looking to create (and why not delete), one (and of course more) custom sensor with specific axis, by one call in JSON :roll:
So, if somebody have the good call ( in JSON or other ) to create ( and delete ) one customsensor, you are welcome :D
Can you try this to create ? (XX) is hardware idx

Code: Select all

http://IPADRESS:8080/json.htm?type=createdevice&idx=XX&sensorname=myCustomSensor&sensormappedtype=0xF31F&sensoroptions=1;Label
and this to delete (XXXX) is device idx

Code: Select all

http://IPADRESS:8080/json.htm?idx=XXXX&type=deletedevice
[code]
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
ElPhilou
Posts: 8
Joined: Thursday 25 January 2018 17:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create Custom Sensor with Axis Label in JSON call

Post by ElPhilou »

Thanks a lot :D

And last question, during create, it is possible to define the icon ? :roll:
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Create Custom Sensor with Axis Label in JSON call

Post by waaren »

ElPhilou wrote: Thursday 05 September 2019 17:05 And last question, during create, it is possible to define the icon ? :roll:
No that is a different JSON

Code: Select all

http://<domoticzIP>:<domotczPort>/json.htm?type=setused&used=true&name=<devicename>&description=<description>&idx=<idx>&switchtype=<switchTypeValue>&customimage=<iconNumber> 
(or use the setIcon method in dzVents)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
ElPhilou
Posts: 8
Joined: Thursday 25 January 2018 17:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Create Custom Sensor with Axis Label in JSON call

Post by ElPhilou »

setIcon method in dzVents :lol: Of course, Thanks again
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest