JSON full spec? Scenes/Groups

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
maq1017
Posts: 4
Joined: Saturday 28 September 2013 18:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

JSON full spec? Scenes/Groups

Post by maq1017 »

Hi there,

New to Domoticz and JSON, but currently coding an interface to integrate my existing LightWave system into Domoticz, retaining use of the original (pretty bad!) LW remote app.

I'm struggling to see what you can do with JSON, and specifically looking to understand how you trigger groups or scenes. Can anyone provide any examples, or even better if there is a full spec for the JSON calls out there somewhere.

I have individual switches triggering fine via JSON, but I don't fancy adding a virtual switch to trigger each scene unless thats the only way to do it, as my set up is scene heavy. Any help appreciated!

Regards,
M
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: JSON full spec? Scenes/Groups

Post by gizmocuz »

There is not a documented json interface yet. (who want to do this?)
Best thing todo is look at the domoticz web interface and html pages.

For switching devices/scenes, have a look in domoticz.js (but also of course in the html pages)

With kind regards,
Rob
Quality outlives Quantity!
gertjuhh

Re: JSON full spec? Scenes/Groups

Post by gertjuhh »

I started expanding the Wiki, although progress is slow.
http://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s
maq1017
Posts: 4
Joined: Saturday 28 September 2013 18:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: JSON full spec? Scenes/Groups

Post by maq1017 »

Already very helpful updates, thank you :)
seblang
Posts: 10
Joined: Sunday 27 December 2015 21:24
Target OS: Windows
Domoticz version:
Contact:

Re: JSON full spec? Scenes/Groups

Post by seblang »

hi

I want to command a light with external http command :

http://XXXXXX:[email protected]:8080/j ... itchcmd=On

when I start this commande in script i have :

Iacces not authorizzed for command : http://XXXXXX:[email protected]:8080/j ... itchcmd=On

on the wiki it is a comment about Authorization (https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's)
I have found solution to convert to base64 Encode. but i do not know how to use it!
thank for help
seb
klauskinski
Posts: 3
Joined: Monday 11 March 2019 7:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Switzerland
Contact:

Re: JSON full spec? Scenes/Groups

Post by klauskinski »

Hi, guys,

Let's restart this topic again... I'm doing DIY electronics that talks JSON over mqtt (which works fine). However, in order to make it work with domoticz, I'd need the domoticz JSON specs. It's dead simple to do it for a sensor with a single value (e.g. a dummy temperature sensor), however I use sensors that report multiple values, e.g. BMP280 which reports temperature, baro pressure and humidity or a gyro that report 3D position changes as well as other values.

So, the question is does somebody have a guide to domoticz JSON over mqtt?

Thanks,
klaus
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: JSON full spec? Scenes/Groups

Post by waaren »

klauskinski wrote: Monday 11 March 2019 7:50 I'd need the domoticz JSON specs. It's dead simple to do it for a sensor with a single value (e.g. a dummy temperature sensor), however I use sensors that report multiple values, e.g. BMP280 which reports temperature, baro pressure and humidity or a gyro that report 3D position changes as well as other values.
So, the question is does somebody have a guide to domoticz JSON over mqtt?
The domoticz JSON guide is maintained here and the mqtt JSON syntaxis is derived from these commands.
example: Temperature/humidity/barometer

JSON:

Code: Select all

/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEMP;HUM;HUM_STAT;BAR;BAR_FOR
MQTT:

Code: Select all

#mosquitto_pub -t  domoticz/in -m '{"idx": IDX, "nvalue": 0, "svalue":"TEMP;HUM;HUM_STAT:BAR;BAR_FOR" }'
Spoiler: show
sets the parameters for a Temp+Humidity+Barometer device
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
TEMP = Temperature
HUM = Humidity
HUM_STAT = Humidity status
BAR = Barometric pressure
BAR_FOR = Barometer forecast

HUM_STAT can be one of:
0=Normal
1=Comfortable
2=Dry
3=Wet

Barometer forecast can be one of:
0 = No info
1 = Sunny
2 = Partly cloudy
3 = Cloudy
4 = Rain
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
klauskinski
Posts: 3
Joined: Monday 11 March 2019 7:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Switzerland
Contact:

Re: JSON full spec? Scenes/Groups

Post by klauskinski »

Thanks, I'll give it a try.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest