Xiaomi set RGB error

Easy to use, 100% Lua-based event scripting framework.
Post Reply
devros
Posts: 191
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Xiaomi set RGB error

Post by devros » Monday 19 February 2018 23:07

hello i did simple script that change RGB colour (or change brightnes)
but in domoticz log i have this error (one for brightness and second for rgb (looks like in path is wrong character "¶"
im using latest beta domoticz version

Code: Select all

2018-02-19 22:02:23.438 Error: Error opening url: http://127.0.0.1:8050/json.htm?type=command¶m=brightnessdown&idx=385
2018-02-19 22:02:28.849 Error: Error opening url: http://127.0.0.1:8050/json.htm?type=command¶m=setcolbrightnessvalue&idx=385&hue=0&brightness=100&iswhite=false
dzvents code is

Code: Select all

return {
	active = true,
	on = {
		devices = {
			'XiaomSwitch2'
		}
	},
	execute = function(domoticz, switch)
		if (switch.state == 'Click' and domoticz.devices('Xiaomi RGB').state == 'Off') then
			domoticz.log('light Xiaomi RGB')
			domoticz.devices('Xiaomi RGB').switchOn()
		elseif (switch.state == 'Click' and domoticz.devices('Xiaomi RGB').state == 'On') then
			domoticz.log('dark Xiaomi RGB')
			domoticz.devices('Xiaomi RGB').switchOff()
		elseif (switch.state == 'Shake' and domoticz.devices('Xiaomi RGB').state == 'On') then
			domoticz.log('test')
			-- domoticz.devices('Xiaomi RGB').decreaseBrightness()
			domoticz.devices('Xiaomi RGB').setRGB(255, 0, 0)

		end
	end
}


devros
Posts: 191
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Xiaomi set RGB error

Post by devros » Tuesday 20 February 2018 1:21

ok right url should be json.htm?type=command&param= instead of json.htm?type=command¶m=

so looks like bug in dzvents..

dannybloe
Posts: 1486
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: Xiaomi set RGB error

Post by dannybloe » Tuesday 20 February 2018 8:13

Mm.. I don't think so. If you look at the sources you can see that all the urls are constructed correctly. Perhaps your install got corrupted somehow?
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

devros
Posts: 191
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Xiaomi set RGB error

Post by devros » Tuesday 20 February 2018 9:39

dannybloe wrote:
Tuesday 20 February 2018 8:13
Mm.. I don't think so. If you look at the sources you can see that all the urls are constructed correctly. Perhaps your install got corrupted somehow?
Weird
I did nothing changeďs in dzvents source ( im using precompiled domoticz on banana berry m2), i saw in domoticz github some source changes in encoding and & is special character, maybe that is the problem.

devros
Posts: 191
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Xiaomi set RGB error

Post by devros » Tuesday 20 February 2018 23:36

here is full output with debug... any idea what should i check?
checked rgbw_device.lua and function device.setRGB is ok

Code: Select all

2018-02-20 19:52:02.347 dzVents: Info: Handling events for: "XiaomSwitch2", value: "Shake"
2018-02-20 19:52:02.347 dzVents: Info: ------ Start external script: XiaomSwitch2.lua: Device: "XiaomSwitch2 (GW)", Index: 469
2018-02-20 19:52:02.349 dzVents: Debug: Processing device-adapter for Xiaomi_RGB: RGB(W) device adapter
2018-02-20 19:52:02.349 dzVents: Debug: Processing device-adapter for Xiaomi_RGB: Switch device adapter
2018-02-20 19:52:02.349 dzVents: Info: zesvetlit
2018-02-20 19:52:02.349 dzVents: Debug: OpenURL: url = http://127.0.0.1:8050/json.htm?type=command¶m=setcolbrightnessvalue&idx=385&hue=89.459459459459&brightness=91.372549019608&iswhite=false
2018-02-20 19:52:02.349 dzVents: Debug: OpenURL: method = GET
2018-02-20 19:52:02.349 dzVents: Debug: OpenURL: post data = nil
2018-02-20 19:52:02.349 dzVents: Debug: OpenURL: headers = nil
2018-02-20 19:52:02.349 dzVents: Debug: OpenURL: callback = nil
2018-02-20 19:52:02.350 dzVents: Info: ------ Finished XiaomSwitch2.lua

noticed this bugreport https://github.com/domoticz/domoticz/issues/2138
looks like similar problem

Post Reply

Who is online

Users browsing this forum: kmccor and 4 guests