Only ?
Not followed by "Malformed JSON response, can't repair", just after ?
If you have this message alone, it mean it works.
Moderator: leecollings
Code: Select all
{"config":{"battery":100,"group":"23668","on":true,"reachable":true},"ep":2,"etag":"f07e6977718e74ae12260a59972ef20f","manufacturername":"Philips","mode":1,"modelid":"RWL021","name":"Switch Badrum Övre","state":{"buttonevent":4002,"lastupdated":"2019-06-21T03:31:26"},"swversion":"5.45.1.17846","type":"ZHASwitch","uniqueid":"00:17:88:01:04:f7:52:9e-02-fc00"}
Code: Select all
commandArray = {}
-- Philips Switch
if (devicechanged['deCONZ - Philips Switch']) then
print("deCONZ - Philips Switch")
local b = devicechanged[deCONZ - Philips Switch']
if b == 'B1' then
commandArray['deCONZ - Cordidor'] = 'Off'
end
if b == 'B2' then
commandArray['deCONZ - Coridor'] = 'On'
end
if b == 'B3' then
v = tonumber(otherdevices_svalues['deCONZ - Cordidor']) + 10
if v > 255 then
v = 255
end
commandArray['deCONZ - Cordidor'']='Set Level '..tostring(v)
end
if b == 'B4' then
v = tonumber(otherdevices_svalues['deCONZ - Cordidor']) - 10
if v < 0 then
v = 0
end
commandArray['deCONZ - Cordidor'']='Set Level '..tostring(v)
end
end
return commandArray
Code: Select all
2019-06-26 20:44:43.913 Status: LUA: ConBee USB - Dimmer Switch KÖK Underskåp
2019-06-26 20:45:30.575 Status: LUA: ConBee USB - Dimmer Switch KÖK Underskåp
2019-06-26 20:45:30.575 Status: LUA: ConBee USB - Dimmer Switch KÖK Underskåp OFF
Code: Select all
2019-06-27 18:24:23.081 (deCONZ) ### WebSocket Data : {'uniqueid': '00:15:8d:00:02:7c:f6:bf-02-0012', 'e': 'changed', 'id': '8', 'state': {'buttonevent': 7000, 'lastupdated': '2019-06-27T16:24:23'}, 't': 'event', 'r': 'sensors'}
Lol, I think 50% of users want this feature, it's a long story but to resume the plugin works with separating devices, so to group them there is 2 ways, take a look here https://github.com/Smanar/Domoticz-deCO ... ame-sensor . You will find a bad one with LUA and at the bottom a better one with dzevent with all automatic, you can hide the 3 first device to have only 1 working and mixing the 3 firsts.
I have Oram lamps and Ikea lamps, at osram this does not work at ikea.Thorgal789 wrote: ↑Thursday 25 July 2019 18:34 I think more or less.
Only some bulb support this features and ikea one not. Wich one bulb have you ?
If you have bulb that support that (and I think yes, with your screenshoot), there is lot of way to do that.
1 - with command line (like this one https://github.com/Smanar/Domoticz-deCO ... on-the-fly. ) I can make the command if you want to test.
2 - with scene editor in phoscon with a real switch
3 - with scene editor in phoscon with a fake switch
Idk yet what to do with that, but if you have the good bulbs, I can explain you how to make a switch in domoticz to launch a color cycle with some settings, using the solution 1.
Code: Select all
curl -H 'Content-Type: application/json' -X PUT -d '{"effect" : "colorloop", "on" : true}' http://192.168.1.1:80/api/36E138295E/lights/16/state
Code: Select all
-- Color loop test
commandArray = {}
function SendJson(url,json)
local curl = "/usr/bin/curl"
local cmd = curl .. ' -X PUT -d '..json..' '..url
local vac = os.execute(cmd)
if vac ~= true then
print('Send JSON Error')
end
end
--color loop switch
if devicechanged['colorloop'] then
if devicechanged['colorloop'] == 'On' then
print('Start colorloop')
SendJson('http://192.168.178.93/api/D279EE0F45/lights/50/state','\'{"effect":"colorloop","on":true}\'')
else
print('Stop colorloop')
SendJson('http://192.168.178.93/api/D279EE0F45/lights/50/state','\'{"effect":"none","on":true}\'')
end
end
return commandArray
Users browsing this forum: Google [Bot] and 1 guest