Bug Found: web/json command broken (applies only to rfxcom)

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Tuesday 15 May 2018 17:40

Version: 3.9030
Platform: RaspberryPi 2B /Running on last version of Raspbian Jessie
Plugin/Hardware: RFXCOM - RFXtrx433 USB 433.92MHz and Z-Wave.Me ZME_UZB1 USB Stick
Description:


hi, when I try to dime light using web commands it dose not wanna execute the request if the light unit is controlled thru the 433mhz rfxcom.

If it is a zwave unit it works fine.

Command I send.

Code: Select all

http://192.168.1.110:8080/json.htm?type=command&param=switchlight&idx=185&switchcmd=Set%20Level&level=50
I get this response

Code: Select all

{
   "status" : "OK",
   "title" : "SwitchLight"
}
Last edited by tillo on Friday 18 May 2018 9:06, edited 4 times in total.
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: web/json command broken (applies only to rfxcom)

Post by tillo » Wednesday 16 May 2018 16:16

Dose any one have any input, or response?

This is easily replicated, at-least on my system.

Any Dev with input?
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Thursday 17 May 2018 14:22

bump
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

simonrg
Posts: 1071
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by simonrg » Thursday 17 May 2018 15:29

Version: 3.8807
Platform: Raspberry Pi 2B / Raspbian Stretch
Plugin/Hardware: Rfxcom 433E
Description: web / json is working perfectly
I can't replicate your fault on my system, I have tried:

Code: Select all

http://192.168.8.14:8080/json.htm?type=command&param=switchlight&idx=823&switchcmd=Set%20Level&level=50
and

Code: Select all

http://192.168.8.14:8080/json.htm?type=command&param=switchlight&idx=823&switchcmd=Off
Both are working perfectly and I have a large number of scripts which rely on this functionality and I have not seen any issues.

You might be more successful in getting a response if you follow the template suggested on the Bugs and Problems list, i.e. give very clear details of your system (version of Raspbian / model of Raspberry Pi etc. included at the bottom of your post but contradicted by your signature) you are using, use the various tags to allow others to easily read your post (code instead of url so nothing is truncated) and include the part of the Domoticz log which shows the command has been received.

From the information you have supplied, without seeing any log, the simplest explanation is that you have the wrong idx and so are watching the wrong lamp.

Good luck.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Friday 18 May 2018 9:04

It all worked fine in the latest stable version (3.9030).

After that I updated to the beta it all stopped working.

NOTE: On and off works fine thru the web commands. Just not dim to a level.
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Friday 18 May 2018 9:22

As you could see, I did send a dim command of 50% to domoticz, but it set it to 100% instead.

Command

Code: Select all

http://192.168.1.110:8080/json.htm?type=command&param=switchlight&idx=185&switchcmd=Set%20Level&level=50
Response from Domoticz

Code: Select all

{
   "status" : "OK",
   "title" : "SwitchLight"
}
Log File

Code: Select all

2018-05-18 09:14:29.768 User: Admin initiated a switch command (185/Living Room - Ceiling Light/Set Level)
2018-05-18 09:14:29.783 (433mHz Controller) Lighting 2 (Living Room - Ceiling Light)
Log for Name: Living Room - Ceiling Light

Code: Select all

2018-05-18 09:14:29	Set Level: 100 %
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

User avatar
jvdz
Posts: 1368
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by jvdz » Friday 18 May 2018 10:00

What is the JSON return value for this IDX for MaxDimLevel when you do this command:
http://192.168.1.110:8080/json.htm?type=devices&rid=185

That value represents 100%, so I have several dummy dimmers that I use for blinds and they have a MaxDimLevel of 32.
This means that:
0=0%
16=50%
32=100%
and I need to do the following command to set the dimmer to 50%:

Code: Select all

http://192.168.1.110:8080/json.htm?type=command&param=switchlight&idx=185&switchcmd=Set%20Level&level=16
Jos

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Friday 18 May 2018 10:38

Thanx Jos for the response. See more details below

Command (Dim level 16 aka 50%)

Code: Select all

http://192.168.1.110:8080/json.htm?type=command&param=switchlight&idx=185&switchcmd=Set%20Level&level=16
Log from device

Code: Select all

2018-05-18 10:34:23	Set Level: 100 %

___________________________________________________________________


Per recommendation by Jos

Code: Select all

http://192.168.1.110:8080/json.htm?type=devices&rid=185
Gave the response

Code: Select all

{
   "ActTime" : 1526632571,
   "AstrTwilightEnd" : "00:00",
   "AstrTwilightStart" : "00:00",
   "CivTwilightEnd" : "22:22",
   "CivTwilightStart" : "03:06",
   "DayLength" : "17:11",
   "NautTwilightEnd" : "00:00",
   "NautTwilightStart" : "00:00",
   "ServerTime" : "2018-05-18 10:36:11",
   "SunAtSouth" : "12:05",
   "Sunrise" : "04:08",
   "Sunset" : "21:19",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "Set Level: 100 %",
         "Description" : "",
         "Favorite" : 0,
         "HardwareID" : 3,
         "HardwareName" : "433mHz Controller",
         "HardwareType" : "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
         "HardwareTypeVal" : 1,
         "HaveDimmer" : true,
         "HaveGroupCmd" : true,
         "HaveTimeout" : false,
         "ID" : "2F12FF6",
         "Image" : "Light",
         "IsSubDevice" : false,
         "LastUpdate" : "2018-05-18 10:34:23",
         "Level" : 100,
         "LevelInt" : 15,
         "MaxDimLevel" : 15,
         "Name" : "Living Room - Ceiling Light",
         "Notifications" : "false",
         "PlanID" : "14",
         "PlanIDs" : [ 14, 9 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "Status" : "Set Level: 100 %",
         "StrParam1" : "",
         "StrParam2" : "",
         "SubType" : "AC",
         "SwitchType" : "Dimmer",
         "SwitchTypeVal" : 7,
         "Timers" : "false",
         "Type" : "Lighting 2",
         "TypeImg" : "dimmer",
         "Unit" : 16,
         "Used" : 1,
         "UsedByCamera" : false,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "185"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

User avatar
jvdz
Posts: 1368
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by jvdz » Friday 18 May 2018 10:45

So in your case it is 15. ("MaxDimLevel" : 15,)
This means that 15 is equal to 100%.
So each step from 0 - 15 is 100/15 = 6.6 = 7%
so setting it to 50% would mean setting it to 7 which will lead to probably 46% and 8 to 53%.

Understood?
Jos

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Friday 18 May 2018 11:08

OMG! Yes, you are right Jos, that did the trick, Now it dimes correctly... Or... Well I guess that it dimmed correctly before as well, since I sent a value that was "out of range/scale".

But...but...but... I Know that this worked in the past. I have been using Domoticz Dashboard and HA bridge (thet sends web commands to domoticz) with this light device for a long time without any problem and suddenly it stopped working.

And that would indicate that the "MaxDimLevel" value have changed somehow? How did that happened?

And why is this only a problem on my RFXcom devices and not on the z-wave?
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

User avatar
jvdz
Posts: 1368
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by jvdz » Friday 18 May 2018 11:31

All my ZWAVE devices that have dimming capabilities have a MaxDimLevel = 100, so those are not a problem since the relation is 1-1.
I have no idea why the MaxDimLevel would/could have changed, but i've looked at the source and don't find any recent changes for that.
A lighting2 type and subtype AC has as default of 15 for MaxDimLevel.
Can you check an older database backup to see in the DeviceTatus table whether that IDX 185 record changed for the fields: SubType & SwitchType?

Jos

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Friday 18 May 2018 11:35

I have a few old database backups from the good old days when it seamed to work.

how do I read the database file in such a way that I can find IDX 185 and all values for it?

best regards.
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

User avatar
jvdz
Posts: 1368
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by jvdz » Friday 18 May 2018 12:13

Look for SQLite Expert personal. Just install it and open the db file with it. ;)

Jos

simonrg
Posts: 1071
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by simonrg » Saturday 19 May 2018 0:26

@jvdz - nice one, all my scripts only operate in the allowed range, but running on my current version of Domoticz 3.8807 it doesn't mind levels outside this range. As the maxdim level is 32, visually set level to 32 or 100 give the same brightness.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

User avatar
jvdz
Posts: 1368
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by jvdz » Saturday 19 May 2018 11:34

True, when it is larger it will simply set it to the max value and think that was also what the OP experienced.

Jos

tillo
Posts: 39
Joined: Monday 01 May 2017 20:15
Target OS: Raspberry Pi
Domoticz version: 3.9030
Contact:

Re: Bug Found: web/json command broken (applies only to rfxcom)

Post by tillo » Thursday 24 May 2018 10:20

I have now checked the old DB backup and "Type", "SubType" and "switch type" was the same as it is now.

But I know that thru the domoticz front page I have been able to dim the light up and down. and one day after that I updated domoticz the dimming stopped working.

Domoticz frontpage:
Image
Image borrowed from: https://www.diskusjon.no/index.php?show ... 12&page=27
Raspberry Pi 2 B - Raspbian Jessie + Domoticz + RFXtrxcom 433, House(dimmers, sockets, harmonyhub, Temp / Humidity Sensors, PIR, ESP8266)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests