methode = 'PUT'  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Maxx
Posts: 58
Joined: Saturday 27 January 2018 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

methode = 'PUT'

Post 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?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: methode = 'PUT'

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Maxx
Posts: 58
Joined: Saturday 27 January 2018 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: methode = 'PUT'

Post by Maxx »

ok, great, good news . Can't wait
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: methode = 'PUT'  [Solved]

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
fvdp80
Posts: 70
Joined: Tuesday 14 August 2018 8:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10303
Contact:

Re: methode = 'PUT'

Post by fvdp80 »

That's some good news! Now i can get rid of some Hue scripts.
Maxx
Posts: 58
Joined: Saturday 27 January 2018 20:59
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: methode = 'PUT'

Post by Maxx »

The test script is working, I can start rewriting now. Time enough :-)

THANKS
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest