15326 - [WebServer] Depricated RType Topic is solved

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!

Moderators: leecollings, remb0

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.
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

15326 - [WebServer] Depricated RType

Post by kiddigital »

Run your domoticz instance with `-debuglevel webserver,received,auth` and maybe the debug logs tells us something why authentication does not work.

Most security related improvements where done in 2023.1 and it works in that version. So weird why it does not in 2023.2
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Lokonli
Posts: 2260
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Lokonli »

Gravityz wrote: Tuesday 15 August 2023 19:52 trusted network setting is ok. everything(homebridge,docker,domoticz) is running on the same host and ip address 192.168.1.50
all the containers use the same network setting

127.0.0.*;192.168.1.*
i even added 192.168.1.50:8581(this is the homebridge instance)
also switched on basic api authorisation but this did not help either.

it seems i am not the only one with this problem
https://github.com/akamming/homebridge- ... t/issues/1

for now i switched back to 2023.1
hopefully somebody will figur out what the problem is
On 2023.2 can you check the reply of the following:

Code: Select all

curl "http://192.168.50:8084/json.htm?type=command&param=getauth"
It should give the name of the authorized used.
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

the reply on the curl command tested from my router(192.168.1.1) is

Ronald@RT-AX88U-8028:/tmp/home/root# curl "http://192.168.1.50:8084/json.htm?type= ... am=getauth"
{
"rights" : 2,
"status" : "OK",
"title" : "GetAuth",
"user" : "admin",
"version" : "2023.2 (build 15503)"
}

the reply from my synology(docker host where everything runs)
root@DISKSTATION:~# curl "http://192.168.1.50:8084/json.htm?type= ... am=getauth" {
"rights" : 2,
"status" : "OK",
"title" : "GetAuth",
"user" : "admin",
"version" : "2023.2 (build 15503)"
}
root@DISKSTATION:~#

i tested both the old curl command as well as the new curl command from the commandline and now it seems to work

the homebridge themostat only seems to work if you use a valid username:password (i created ronald:ronald in domoticz)
also it only works with basic auth on, otherwise it still gives the same 401 error

for now i switched back to 15092 again because the thermostat plugin is generating a lot of depreciated lines and i need to wait before akamming creates a new plugin which uses the new json structure.
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by kiddigital »

Gravityz wrote: Wednesday 16 August 2023 17:06...

the homebridge themostat only seems to work if you use a valid username:password (i created ronald:ronald in domoticz)
also it only works with basic auth on, otherwise it still gives the same 401 error
If the homebridge is within the Trusted network, than there is no need to provide a username (and pass). But if you do, than it needs to be valid username/password. If invalid, even within the Trusted network, it will be rejected.

btw.. it is good (and secure) practise to give each 'system/plugin' that needs access to the API, their own user/pass. That way it is clear who does what on your system and you can confine systems/plugins to the device(s) they should manage and prevent them to access devices they should not.
Gravityz wrote: Wednesday 16 August 2023 17:06for now i switched back to 15092 again because the thermostat plugin is generating a lot of depreciated lines and i need to wait before akamming creates a new plugin which uses the new json structure.
No need to switch back, the messages are only informational and do no harm.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

thanks

if you do not need a username password when everything is in the trusted network i suspect there is something wrong with this thermostat plugin.

with domoticz 15092(2023.1) and plugin without user:password(left blank)
basic auth off: no error everything working
basic auth on:error 401

with domoticz 15503(2023.2) and plugin without user:password(left blank)
basic auth off: error 401
basic auth on:error 401

with domoticz 15503(2023.2) and plugin WITH user:password(ronald:ronald)
basic auth off: error 401
basic auth on:no erros everything working
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by kiddigital »

I think the plug-in expect a user/pass to be present. Which it should as it is more secure.

The fact that it could work without, within the Trusted network, does not mean it should.

And to clarify, you can not turn ‘Basic Auth’ on or off. Basic Auth is always available when accessing domoticz over HTTPS. By default, domoticz does not accept Basic Auth when accessed over HTTP as the user/pass info is sent as clear text and not encrypted. But you can tell domoticz to accept it by enabling ‘Basic Auth over HTTP’.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

ok that part is clear.

so somehow the new domoticz can not handle it when no user:password is specified with this plugin
it can be that there still is a bug in the plugin
it could also be that the security in 2023.1 was not functioning properly ang now in 2023.2 they fixed it.

then it is still strange that the trusted network setting should be used(regardless of user:password being specified or not)
but aparently it is not using it
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by kiddigital »

Gravityz wrote:ok that part is clear.



then it is still strange that the trusted network setting should be used(regardless of user:password being specified or not)
but aparently it is not using it
I don’t understand what you mean here. You should preferably use user/pass (or other forms of authentication) OR use Trusted network. Not both to give acces to a system/plugin. And again if any kind of authentication is provided, regardless valid or invalid, Trusted network settings will not be used to authenticate the request.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

kiddigital wrote: Wednesday 16 August 2023 19:43
Gravityz wrote:ok that part is clear.


I don’t understand what you mean here. You should preferably use user/pass (or other forms of authentication) OR use Trusted network. Not both to give acces to a system/plugin. And again if any kind of authentication is provided, regardless valid or invalid, Trusted network settings will not be used to authenticate the request.
this is exactly what i mean.
i think some kind of authentification is provided by the plugin, even when the user/password is blank.
security in 2023.1 aparently was not that strict and trusted network was used.
security in 2023.2 probably got upgraded and has problems with the passed credentials thus trusted network is not used but since credentials are not correct it generates the 401 error
when putting in existing credentials and basic auth on it is accepted.

i have to wait and see how the plugin designer interpet my findings.

for now i can indeed switch to 2023.2 and take the warnings for granted
User avatar
pierrotori
Posts: 101
Joined: Tuesday 15 May 2018 0:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by pierrotori »

i remove all my lua script and i confirm i have a material use not good syntax
viewtopic.php?p=304297&sid=1a90d1664973 ... 48#p304297
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by waltervl »

Code: Select all

 Deprecated RType (devices) for API request. Handled via fallback (getdevices)
The devices command is normally called by an external user interface (Dashticz, an external app, a custom template/theme etc) or some external script.
It perhaps could be called by a python plugin.
It should not be called by an integrated hardware gateway. Domoticz internally has no references to old commands anymore except for the fallbacks.
It could be that your browser still uses old javascripts but that should be solved by clearing your browser cache.

Check the IP address that is mentioned in the deprecated status log call. If it is your domoticz server, check and update dashticz, scripts, custom themes, custom templates and plugins.
If it is another client, check that client.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
guigui
Posts: 3
Joined: Sunday 01 November 2015 21:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by guigui »

Hello!

I'm having trouble finding the change in the API for the following command:

Code: Select all

type=command&param=udevice&idx=100&nvalue=0&svalue=237
which allows me to log the electricity voltage.



When I search in the appropriate section (https://www.domoticz.com/wiki/Domoticz_ ... 7s#Voltage), I still have the syntax of the old API...

No matter how much I change and try:

Code: Select all

type=command&param=updatedevice&idx=100&nvalue=0&svalue=237'
type=command&param=getdevices&idx=100&nvalue=0&svalue=237'
Nothing works except:

Code: Select all

type=command&param=udevice&idx=100&nvalue=0&svalue=237'
which is the old syntax and gives me an error in the log!




Does anyone have the same problem?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by waltervl »

This seems not a api change issue but a authorisation issue. Api command is OK, Check your log file

Please use another topic for this or make a new one.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

i am using the same command and it is runnig fine

192.168.1.50,8084,/json.htm?type=command&param=udevice&idx=344&nvalue=0&svalue=[Watermeter#Total]

you do know that you need to turn on ALLOW BASIC-AUTH in the domoticz settings.

things will not work anymore without it.
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by desertdog »

I am trying to flip a switch according to the documentation. My call is starting with the type=command, but I still get the Depricated RType error. What is wrong with this json call?

Code: Select all

https://USER:PASSWORD@SERVER_IP:4010/json.htm?type=command&param=switchlight&idx=731&switchcmd=ON
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by waltervl »

desertdog wrote: Friday 01 September 2023 12:39 I am trying to flip a switch according to the documentation. My call is starting with the type=command, but I still get the Depricated RType error. What is wrong with this json call?

Code: Select all

https://USER:PASSWORD@SERVER_IP:4010/json.htm?type=command&param=switchlight&idx=731&switchcmd=ON
Are you sure it is coming from this command? Switchlight is not changed...
What is the exact Depricated RType message you get? it should state the command you tried to use. And the IP address it is coming from.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
basmaaks
Posts: 16
Joined: Tuesday 17 October 2017 18:55
Target OS: -
Domoticz version:

Re: 15326 - [WebServer] Depricated RType

Post by basmaaks »

Some can help me out ?

got the message :
[WebServer] Deprecated RType (devices) for API request. Handled via fallback (getdevices), please use correct API Command! (127.0.0.1)
in my log.

I think it's coming from script below but don't know what to modify ?

Code: Select all

return {
    on = {
        timer = { 'every 2 minutes' },
        httpResponses = { 'unifi_loggedin' , 'unifi_data' }
    },
    data = {
        presenceHistory = { history = true, maxMinutes = 6 } 		-- Change maxMinutes value to appropriate for your devices
    },
    execute = function(domoticz, item)
        local controllerUrl = 'https://192.168.178.42/' 	--Change IP and Port to your Unifi Controller settings
        local controllerLogin = 'SOME_USER'						-- Your username for Unifi Controller
        local controllerPassword = 'SOME_PASSWORD'-- Your password for Unifi Controller
       
        local devices = {
            ['BasIphone13'] = 784,	      -- Telefoon Bas	
            ['iPhonevanHeidi'] = 783,	  -- Telefoon Heidi
            ['iPhonemathijs'] = 785	  -- Telefoon Mathijs	
        }

        if (item.isTimer) then
            local cookie = '/home/pi/domoticz/domocookie.txt'
	    domoticz.utils.osExecute('rm ' .. cookie .. ' &' )
            domoticz.openURL({
                url = controllerUrl .. 'api/auth/login',
                method = 'POST',
                postData = { 
                    ['password'] = controllerPassword,
                    ['username'] = controllerLogin 
                },
                callback = 'unifi_loggedin'
            })
        end
        
        if (item.isHTTPResponse and item.ok) then
            if (item.trigger == 'unifi_loggedin') then
                domoticz.openURL({
                    url = controllerUrl .. 'proxy/network/api/s/default/stat/sta',
                    method = 'GET',
                    callback = 'unifi_data'
                })
            end
        
            if (item.trigger == 'unifi_data') then
                local presenceHistory = domoticz.data.presenceHistory

                for mac, device in pairs(devices) do
                    local isPresent = string.find(item.data, mac)
                    
                    presenceHistory.add({
                        ['mac'] = mac,
                        ['isPresent'] = not (isPresent == nil)
                    })
                
                    local wasPresent = presenceHistory.reduce(function(acc, item)
                        if (item.data.mac == mac and item.data.isPresent) then
                            acc = acc + 1
                        end
                        
                        return acc
                    end, 0)
                                       
                    if (wasPresent == 0) then
                        domoticz.devices(device).switchOff().checkFirst()
                    else
                        domoticz.devices(device).switchOn().checkFirst()
                    end
                end
            end
        end
    end
}
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

not sure but as far as i can tell you get that error when trying to access domoticz through http or https
this script looks like it is accessing something else(unifi controller) so i doubt it is causing this error(don't shoot me if i'm wrong)

i would check everything which is trying to acces domoticz like
homebridge
homebridge plugings
scripts from you router which are accessing domoticz
calls from esp devices, watermeters
etc,etc

also if it is coming from this script you should see the message every 2 minutes, what is the interval of the messages?
basmaaks
Posts: 16
Joined: Tuesday 17 October 2017 18:55
Target OS: -
Domoticz version:

Re: 15326 - [WebServer] Depricated RType

Post by basmaaks »

Gravityz wrote: Friday 01 September 2023 14:23 not sure but as far as i can tell you get that error when trying to access domoticz through http or https
this script looks like it is accessing something else(unifi controller) so i doubt it is causing this error(don't shoot me if i'm wrong)

i would check everything which is trying to acces domoticz like
homebridge
homebridge plugings
scripts from you router which are accessing domoticz
calls from esp devices, watermeters
etc,etc

also if it is coming from this script you should see the message every 2 minutes, what is the interval of the messages?
sometimes none for several hours in the log and sometimes every 1 minute 4 times in one second. Homebridge is running mqqt and only recieving one temp sensor from domoticz.

got a script running (Python) for my lux sensor, that runs every 5 minutes

Code: Select all

#!/usr/bin/python

import smbus

import time
import
 os

# Define some constants from the datasheet


DEVICE     = 0x23 # Default device I2C address


POWER_DOWN = 0x00 # No active state
POWER_ON   = 0x01 # 
Power on
RESET      = 0x07 # Reset data register value

bus = smbus.SMBus(1)

def convertToNumber(data):
  

# Simple function to convert 2 bytes of data
  
# into a decimal number. Optional parameter 'decimals'
 
# will round to specified number of decimal places.
  result=(data[1] + (256 * data[0])) / 1.2
  return (result)

def readLight(addr=DEVICE):
  
# Read data from I2C interface
  data = bus.read_i2c_block_data(addr,0x20)
  
return convertToNumber(data)

def main():

    lightLevel=readLight()
    print("Light Level : " + format(lightLevel,'.2f') + " lx")
    time.sleep(0.5)

cu1 = 'curl -s -i -H "Accept: application/json" "http://127.0.0.1:8085/json.htm?type=command&param=udevice&idx=854&svalue='
cu2 = str(readLight())
cu3 = '"'
cu = cu1 + cu2 +  cu3

retvalue = os.system(cu)

if __name__=="__main__":
   main()
but i don't see a problem in this script
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: 15326 - [WebServer] Depricated RType

Post by Gravityz »

that looks fine, i use the same command

do you have the edomoticz plugin in homebridge?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest