Dimmer JSON API Commands
Moderator: leecollings
-
- Posts: 36
- Joined: Thursday 06 November 2014 15:59
- Target OS: Linux
- Domoticz version: 2564
- Contact:
Dimmer JSON API Commands
I have Domoticz running on my home server controlling Lightwave switches via a RFXCOM unit.
I can send JSON commands from my home automation system (Total Control) to turn dimmers on, off and set levels with success but was wondering if there is a JSON command to raise and lower dimmers?
Thanks.
I can send JSON commands from my home automation system (Total Control) to turn dimmers on, off and set levels with success but was wondering if there is a JSON command to raise and lower dimmers?
Thanks.
-
- Posts: 21
- Joined: Tuesday 25 November 2014 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Norwich, United Kingdom
- Contact:
Re: Dimmer JSON API Commands
From the Wiki: http://www.domoticz.com/wiki/Domoticz_A ... d_switches
Get all lights/switches
Turn a light/switch on or off
idx = id of your device.
switchcmd = "On" or "Off" (case sensitive!)
Set a dim-able light to a certain level
Level should be a value between 1 (0%) and 16 (100%)
When the light is off, it will be turned on
Get all lights/switches
Code: Select all
/json.htm?type=command¶m=getlightswitches
Code: Select all
/json.htm?type=command¶m=switchlight&idx=&switchcmd=&level=0
switchcmd = "On" or "Off" (case sensitive!)
Set a dim-able light to a certain level
Code: Select all
/json.htm?type=command¶m=switchlight&idx=&switchcmd=Set%20Level&level=6
When the light is off, it will be turned on
-
- Posts: 36
- Joined: Thursday 06 November 2014 15:59
- Target OS: Linux
- Domoticz version: 2564
- Contact:
Re: Dimmer JSON API Commands
Thanks but I am looking for a command to raise or lower a dimmer, not just set it at a level.
-
- Posts: 21
- Joined: Tuesday 25 November 2014 11:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Norwich, United Kingdom
- Contact:
Re: Dimmer JSON API Commands
Gotcha, didn't pick up on that sorry
Easy enough to work around it I guess, read it's value in , decrement/increment, then set it at that amount?
You need just a single JSON call though?
Easy enough to work around it I guess, read it's value in , decrement/increment, then set it at that amount?
You need just a single JSON call though?
-
- Posts: 36
- Joined: Thursday 06 November 2014 15:59
- Target OS: Linux
- Domoticz version: 2564
- Contact:
Re: Dimmer JSON API Commands
I can do a work around but was hoping there was a single command
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Dimmer JSON API Commands
Does anyone got a clue regarding dimlevels via the JSON url?
If i call with level=60, i would expect it to go to 60%. However, it goes to 100%
level=006, i would expect 6%, it goes to 33%?
Dimmer is KAKU AWMR-210
If i call with level=60, i would expect it to go to 60%. However, it goes to 100%
level=006, i would expect 6%, it goes to 33%?
Dimmer is KAKU AWMR-210
I am not active on this forum anymore.
- mbliek
- Posts: 194
- Joined: Friday 12 July 2013 14:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: the Netherlands
- Contact:
Re: Dimmer JSON API Commands
Dimmer has 16 staps. From 1 (0%) to 16 (100%)
Op zoek naar een Domoticz Start Set?
-
- Posts: 47
- Joined: Wednesday 10 December 2014 16:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dimmer JSON API Commands
I'm looking at representing mu UPS PIco in Domoticz, and the closest I've got to so far is a dimmer as it has a both
I've downloaded battery.zip and uploaded it as a custom icon. This worked fine when I set up a dummy On/Off switch.
However, I have two problems, one aesthetics, one functional.
- On/Off status - mains power status,
- level - indicate the battery status
I've downloaded battery.zip and uploaded it as a custom icon. This worked fine when I set up a dummy On/Off switch.
However, I have two problems, one aesthetics, one functional.
- I can't change the icon for the dimmer to use the Battery Icon like I did for the On/Off switch as the drop down isn't visible when a switch type of 'Dimmer' is selected
- Although I can set the dimmer switch to On or Off using the code
However, I cannot set the level. If I try to set anything other than a level of 0 or 1 I get the error.
Code: Select all
curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=249&switchcmd=On' curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=249&switchcmd=Off'
No matter whether I set the level to 0 or 1, the switch changes to state Off and a level of zero.Code: Select all
pi@domoticzpi:~# curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=3' { "message" : "Error sending switch command, check device/hardware !", "status" : "ERROR", "title" : "SwitchLight" } pi@domoticzpi:~]
- bbqkees
- Posts: 407
- Joined: Sunday 17 August 2014 21:01
- Target OS: Linux
- Domoticz version: 4.1x
- Location: The Netherlands
- Contact:
Re: Dimmer JSON API Commands
Use Percentage:
And if not set to 'On/Off', you cannot change the icon.
So you need 2 devices, one 'On/Off' and a Percentage.
Code: Select all
http://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Percentage
So you need 2 devices, one 'On/Off' and a Percentage.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Dimmer JSON API Commands
Set a dimmer to a level:
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0 = Off
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0 = On
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=50 = 50%
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0 = Off
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0 = On
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=50 = 50%
-
- Posts: 47
- Joined: Wednesday 10 December 2014 16:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dimmer JSON API Commands
Egregius wrote:Set a dimmer to a level:
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0 = Off
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0 = On
json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=50 = 50%
Code: Select all
root@domoticzpi:~# curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=50'
{
"message" : "Error sending switch command, check device/hardware !",
"status" : "ERROR",
"title" : "SwitchLight"
}
pi@domoticzpi:~# curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=0'
{
"status" : "OK",
"title" : "SwitchLight"
}
pi@domoticzpi:~# curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=249&switchcmd=Set%20Level&level=1'
{
"status" : "OK",
"title" : "SwitchLight"
}
pi@domoticzpi:~#
-
- Posts: 47
- Joined: Wednesday 10 December 2014 16:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dimmer JSON API Commands
That's what I currently have, an On/Off set with Battery as the icon and a separate percentage. it works but it's not really what I wanted.bbqkees wrote:Use Percentage:And if not set to 'On/Off', you cannot change the icon.Code: Select all
http://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s#Percentage
So you need 2 devices, one 'On/Off' and a Percentage.
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Dimmer JSON API Commands
What type/subtype do you have for your dimmer?
A Qubino dimmer is type 17 subtype 161 and supports dimlevels from 0 to 100. I control 5 of them with the commands provided earlier.
A Qubino dimmer is type 17 subtype 161 and supports dimlevels from 0 to 100. I control 5 of them with the commands provided earlier.
-
- Posts: 47
- Joined: Wednesday 10 December 2014 16:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dimmer JSON API Commands
I set this us as a basic 'Dimmer' which is the only option I had. This is a dummy switch, on the 'Dummy Hardware'Egregius wrote:What type/subtype do you have for your dimmer?
A Qubino dimmer is type 17 subtype 161 and supports dimlevels from 0 to 100. I control 5 of them with the commands provided earlier.
I have just set up a manual switch as a LWRF Dimmer. I have tried turning the switch on and off as well as moving the slider using JSON and got a status of "OK" every time.
Code: Select all
pi@domoticzpi ~ $ curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=250&switchcmd=On'
{
"status" : "OK",
"title" : "SwitchLight"
}
pi@domoticzpi ~ $ curl 'http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=250&switchcmd=Set%20Level&level=30'
{
"status" : "OK",
"title" : "SwitchLight"
}
pi@domoticzpi ~ $
I didn't have the option of setting a Qubino dimmer as it wasn't an option
- Egregius
- Posts: 2589
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Dimmer JSON API Commands
I sometimes change that directly in the database 

-
- Posts: 47
- Joined: Wednesday 10 December 2014 16:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dimmer JSON API Commands
When I looked in Devices I found that when I created the LWRF Dimmer (250) Domoticz also created another device (251).
The down side is that if I change the state to off, it sets the level to 0, and if I set the level to anything other than 0 it sets the state to On.
This means I can't show the mains as being off, and 50% battery remaining. Looks like I may have to stick with two separate devices.
I can manipulate this second device using JSON (although the dimmer only goes from 0 to 32) and I have been able to change the icon to the battery.The down side is that if I change the state to off, it sets the level to 0, and if I set the level to anything other than 0 it sets the state to On.
This means I can't show the mains as being off, and 50% battery remaining. Looks like I may have to stick with two separate devices.
-
- Posts: 5
- Joined: Monday 22 September 2014 13:24
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dimmer JSON API Commands
Editing the database directly was a great idea! Now finally I have working dummy triggers that can even send updates over MQTT. Cool!
Who is online
Users browsing this forum: Google [Bot] and 1 guest