Page 1 of 1

methode = 'PUT'

Posted: Sunday 29 March 2020 19:40
by Maxx
Hello,

I noticed that since about a month the openURL also should support the PUT method. Also according the wiki.

My hue bulbs are controlled by os.execute,curl (long story :-))

Today I tried to rewrite to openURL using the PUT method but sofar unsuccesfull.

This is the test script:

Code: Select all

return {
	on = {
		timer = {'every minute'},
	},
logging =   {   level                   = domoticz.LOG_DEBUG,
                   marker                  = "put" },
	execute = function(domoticz, triggeredItem)
	                    local device = 29
                        local bridge = '192.xxx.x.xxx'
                        local tempUrl = 'http://'..bridge..'/api/xigTvboK2LNKIXpUViF/'.. device .. '/state'
			            domoticz.openURL({
				        url = tempUrl,
				        method = 'PUT',
				        postData = {on = false}
			            })
	end
}
In the log:

Code: Select all

 2020-03-29 19:36:00.738 Status: dzVents: Info: put: ------ Start internal script: Script #1:, trigger: "every minute"
2020-03-29 19:36:00.739 Status: dzVents: Debug: put: OpenURL: url = http://xxx.xxx.x.xxx/api/xigTvboK2fVo6ld4DLNKIXpUViF/29/state
2020-03-29 19:36:00.739 Status: dzVents: Debug: put: OpenURL: method = PUT
2020-03-29 19:36:00.739 Status: dzVents: Debug: put: OpenURL: post data = nil
2020-03-29 19:36:00.740 Status: dzVents: Debug: put: OpenURL: headers = nil
2020-03-29 19:36:00.740 Status: dzVents: Debug: put: OpenURL: callback = nil
2020-03-29 19:36:00.742 Status: dzVents: Info: put: ------ Finished Script #1 
postData returns nil and no response, am I missing something?

Re: methode = 'PUT'

Posted: Sunday 29 March 2020 19:56
by waaren
Maxx wrote: Sunday 29 March 2020 19:40 I noticed that since about a month the openURL also should support the PUT method. Also according the wiki.
postData returns nil and no response, am I missing something?
You are missing a small detail :) The put and delete options will be supported in dzVents 3.0.2 which is currently being tested. As soon as the tests are complete the extra options will become available in the next Beta.
I modified the wiki to emphasize when these options will be implemented.

Re: methode = 'PUT'

Posted: Sunday 29 March 2020 22:26
by Maxx
ok, great, good news . Can't wait

Re: methode = 'PUT'  [Solved]

Posted: Thursday 02 April 2020 14:18
by waaren
Maxx wrote: Sunday 29 March 2020 22:26 ok, great, good news . Can't wait
Waiting is over :D
It is implemented in Beta

Re: methode = 'PUT'

Posted: Thursday 02 April 2020 14:50
by fvdp80
That's some good news! Now i can get rid of some Hue scripts.

Re: methode = 'PUT'

Posted: Friday 03 April 2020 12:31
by Maxx
The test script is working, I can start rewriting now. Time enough :-)

THANKS