Page 3 of 9
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 9:39
by a3vd
I understand that its a depricated issue from Json, but which api is it ? i switched off all my hardware one by one but can't figure out
which one is giving the problem.
The message in the log is :
2023-06-07 09:36:19.629 Status: [WebServer] Depricated RType (devices) for API request. Please use correct API Command!
Version: 2023.1 (build 15335)
Build Hash: 83bfca4d7
Compile Date: 2023-06-07 08:24:29
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 10:49
by waltervl
a3vd wrote: ↑Wednesday 07 June 2023 9:39
I understand that its a depricated issue from Json, but which api is it ? i switched off all my hardware one by one but can't figure out
which one is giving the problem.
The message in the log is :
2023-06-07 09:36:19.629 Status: [WebServer] Depricated RType (devices) for API request. Please use correct API Command!
Version: 2023.1 (build 15335)
Build Hash: 83bfca4d7
Compile Date: 2023-06-07 08:24:29
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]
You have to be sure you have cleared your browser cache. Using the normal Domoticz interface and hardware should not give issues.
So propably you use another interface like an app, dashticz etc. Or an external script that connects to domoticz.
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 11:28
by jvdz
Maybe updating the console message to contain the remote ip address and username would help to determine the source?
Something like? (untested):
Code: Select all
_log.Log(LOG_STATUS, "[WebServer] %s-%s: Depricated RType (%s) for API request. Please use correct API Command!", session.remote_host.c_str(), session.username.c_str(), rtype.c_str());
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 14:26
by heggink
jvdz wrote: ↑Wednesday 07 June 2023 11:28
Maybe updating the console message to contain the remote ip address and username would help to determine the source?
Something like? (untested):
Code: Select all
_log.Log(LOG_STATUS, "[WebServer] %s-%s: Depricated RType (%s) for API request. Please use correct API Command!", session.remote_host.c_str(), session.username.c_str(), rtype.c_str());
That would be really helpful indeed. I managed to clear most of the messages except for one and I can't, for the life of me, figure out where it comes from...
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 21:37
by kiddigital
heggink wrote:jvdz wrote: ↑Wednesday 07 June 2023 11:28
Maybe updating the console message to contain the remote ip address and username would help to determine the source?
Something like? (untested):
Code: Select all
_log.Log(LOG_STATUS, "[WebServer] %s-%s: Depricated RType (%s) for API request. Please use correct API Command!", session.remote_host.c_str(), session.username.c_str(), rtype.c_str());
That would be really helpful indeed. I managed to clear most of the messages except for one and I can't, for the life of me, figure out where it comes from...
Just enable the `webserver` debug flag and you will see a lot more details from the webserver.
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 22:26
by heggink
kiddigital wrote: ↑Wednesday 07 June 2023 21:37
heggink wrote:jvdz wrote: ↑Wednesday 07 June 2023 11:28
Maybe updating the console message to contain the remote ip address and username would help to determine the source?
Something like? (untested):
Code: Select all
_log.Log(LOG_STATUS, "[WebServer] %s-%s: Depricated RType (%s) for API request. Please use correct API Command!", session.remote_host.c_str(), session.username.c_str(), rtype.c_str());
That would be really helpful indeed. I managed to clear most of the messages except for one and I can't, for the life of me, figure out where it comes from...
Just enable the `webserver` debug flag and you will see a lot more details from the webserver.
Excellent so that helped. FOund the culprit which was unexpected: type=setused throws the warning but I didn';t see that mentioned in the wiki.
What would be the correct syntax?
NVM, found it: type=command¶m=setused
Many thanks!!
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 07 June 2023 23:14
by heggink
heggink wrote: ↑Wednesday 07 June 2023 22:26
kiddigital wrote: ↑Wednesday 07 June 2023 21:37
heggink wrote:
That would be really helpful indeed. I managed to clear most of the messages except for one and I can't, for the life of me, figure out where it comes from...
Just enable the `webserver` debug flag and you will see a lot more details from the webserver.
Excellent so that helped. FOund the culprit which was unexpected: type=setused throws the warning but I didn';t see that mentioned in the wiki.
What would be the correct syntax?
NVM, found it: type=command¶m=setused
Many thanks!!
For those using the machinon theme, there are a couple of changes to be made in custom.js:
Code: Select all
fetch('json.htm?type=command¶m=getsettings', {
and js/functions.js:
Code: Select all
if (settings.url.startsWith("json.htm?type=command¶m=getdevices") || settings.url.startsWith("json.htm?type=command¶m=getscenes")) {
} else if (settings.url.startsWith("json.htm?type=command¶m=switchscene")) {
Re: 15326 - [WebServer] Depricated RType
Posted: Thursday 08 June 2023 21:17
by kiddigital
Beta 15342 contains a few small API ‘backwards’ compatibility changes. A few more old RTypes are now still working (scene/plan/graph).
See
https://github.com/domoticz/domoticz/c ... 8b640a6ea3
Also the status message shows if (and via which command) it worked or was ignored and where the request came from (IP address).
Re: 15326 - [WebServer] Depricated RType
Posted: Friday 09 June 2023 8:49
by a3vd
[/quote]
You have to be sure you have cleared your browser cache. Using the normal Domoticz interface and hardware should not give issues.
So propably you use another interface like an app, dashticz etc. Or an external script that connects to domoticz.
[/quote]
Off course i cleared the cache, and domoticz is still working fine but with the latest beta (15342) i finally can see where the api problem is,
it is in de toon plugin. Now i have to dig in the source to find out where the problem is, and find some time for it
The log message is now much more clearer :
[WebServer] Depricated RType (devices) for API request. Handled via fallback (getdevices), please use correct API Command! (xxx.xxx.xxx.xxx)
Re: 15326 - [WebServer] Depricated RType
Posted: Friday 09 June 2023 9:22
by EdwinK
kiddigital wrote: ↑Thursday 08 June 2023 21:17
Also the status message shows if (and via which command) it worked or was ignored and where the request came from (IP address).
It's. coming from my macBook. Updated the machinon and the machinon-beta theme to the latest version and it seems the errors are gone now.
Re: 15326 - [WebServer] Depricated RType
Posted: Friday 09 June 2023 21:42
by newpond
so… in my case after trying lots of the things suggested earlier in this post, on my rpi 4 with no luck, i decided to upgrade another domoticz server i have running on a pi zero to see if that displayed the same problem (as this is not running as many apps in the back ground as my rpi4 setup)
The pi zero server doesnt display the [WebServer] Depricated RType (devices) for API request error.
I started looking at the differences between the two devices and then remembered that the rpi4 has a touchscreen screen attached to it which runs a custom frontpage allowing me to control devices from that rather than the domoticz interface itself.
This is running as a different user, with the browser opening automatically on startup in kiosk mode.
Disabling this from automatically opening the browser, fixed the issue, so the custom front page is clearly using api calls that are no longer supported.
there are 3 commands in that page which could possibly be causing the issue.
If any one can see how to modify these to follow the new requirements, i would be grateful of any help.
var jurl=$.domoticzurl+"/json.htm?type=devices&plan="+$.roomplan+"&jsoncallback=?";
$(document).ready(function() {
$.roomplan=0; // define roomplan in Domoticz and create items below.
$.domoticzurl="
http://192.168.1.x:8080";
//format: idx, value, label, description, [override css], [alarm value]
url: "
http://192.168.1.x:8080/json.htm?type=c ... witchlight" + "&idx=" + idx + "&switchcmd=" + switchcmd + "&level=0"
I hope this is useful to some people to maybe at least to remind them to be conscious of other devices that maybe causing these issues..
thanks
Newpond
Re: 15326 - [WebServer] Depricated RType
Posted: Friday 09 June 2023 22:13
by kiddigital
newpond wrote:…
If any one can see how to modify these to follow the new requirements, i would be grateful of any help.
var jurl=$.domoticzurl+"/json.htm?type=devices
thanks
Newpond
That one has to change ‘type=command¶m=getdevices’
You can remove the ‘&jsoncallback=?’ as that is also not supported anymore.
The others should be ok
Re: 15326 - [WebServer] Depricated RType
Posted: Saturday 10 June 2023 9:25
by newpond
@kiddigital that worked perfectly thank you so much for the help (and the fast response).
much appreciated
Bedankt!!!!!
Newpond
Re: 15326 - [WebServer] Depricated RType
Posted: Tuesday 13 June 2023 21:12
by Romain2022
kiddigital wrote: ↑Wednesday 07 June 2023 21:37
heggink wrote:jvdz wrote: ↑Wednesday 07 June 2023 11:28
Maybe updating the console message to contain the remote ip address and username would help to determine the source?
Something like? (untested):
Code: Select all
_log.Log(LOG_STATUS, "[WebServer] %s-%s: Depricated RType (%s) for API request. Please use correct API Command!", session.remote_host.c_str(), session.username.c_str(), rtype.c_str());
That would be really helpful indeed. I managed to clear most of the messages except for one and I can't, for the life of me, figure out where it comes from...
Just enable the `webserver` debug flag and you will see a lot more details from the webserver.
Hello,
How can I enable this debug flag ? Because I didn't find where come my errors....
Thanks a lot.
Re: 15326 - [WebServer] Depricated RType
Posted: Tuesday 13 June 2023 21:49
by wnaves
Just to add to this conversation as i did not find any references to this issue yet.
I'm running the Android mobile app version 0 . 2 . 358 (9328) and found that as the source device that generate these errors as well.
Any thoughts on the mobile version and if they could be affected ?
Re: 15326 - [WebServer] Depricated RType
Posted: Tuesday 13 June 2023 22:30
by jvdz
Any external App/Script/WebFrontend will use the standard API calls to retrieve the information from Domoticz so Yes, the android app will probably mostly still work but will trigger these warnings in the log each time it does one of the modified API calls.
Re: 15326 - [WebServer] Depricated RType
Posted: Tuesday 13 June 2023 23:23
by wnaves
jvdz wrote: ↑Tuesday 13 June 2023 22:30
Any external App/Script/WebFrontend will use the standard API calls to retrieve the information from Domoticz so Yes, the android app will probably mostly still work but will trigger these warnings in the log each time it does one of the modified API calls.
And is the mobile app going to be updated as well to make use of these new api calling method's ?
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 14 June 2023 0:36
by waltervl
The issue is brought to the attention of the app author
https://github.com/domoticz/domoticz-android/issues/692
For now most likely the app should work, you only have these messages. The app will probably change only after the current beta is promoted to stable else the app will not work on current stable.
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 14 June 2023 9:17
by jvdz
waltervl wrote: ↑Wednesday 14 June 2023 0:36
The app will probably change only after the current beta is promoted to stable else the app will not work on current stable.
Which is an issue when there is no backward compatibility build into the APP since a hard cut change would mean everybody needs to upgrade Domoticz immediately when the app changes!
To avoid putting the burden onto the developers of APPS and other external processes and hard cutoffs, these "breaking change" really should be implemented over 2 releases:
- First release (now) the new and old format API should work without it triggering all these errors in the logfile and informing everyone of start making the changes to the APIs in their external APPs/Fornt-ends/Batch processes.
- Next release (Beta&Prod after current Beta went into production) the new and old format API should work, but now implement the errors in the logfile so people know this is really happening.
- 2nd Next release (Beta&Prod) stop support for old API format.
This way everybody gets the time to make the adaptions and upgrades in their own time.
Just my 2 cents.
Re: 15326 - [WebServer] Depricated RType
Posted: Wednesday 14 June 2023 14:21
by waltervl
I agree (but have no influence on this)