Page 1 of 1

dimto problems

Posted: Monday 04 September 2017 20:44
by leby
sure it's my mistake, please someone point it out to me.

I have the following script

Code: Select all

return {
    active = true,
    on = {
        devices = {
            'Lägenhet scene ett'
        }
    },
    execute = function(domoticz)
local Lagenhet_badrum_spegel = domoticz.devices(41) ----- Lägenhet badrum spegel
local Lagenhet_bord = domoticz.devices(57) ----- Lägenhet bord
local Lagenhet_scene1 = domoticz.devices(69) ----- Lägenhet scene ett
local Lagenhet_scene2 = domoticz.devices(70) ----- Lägenhet scene två
local Lagenhet_spot_bord = domoticz.devices(39) ----- Lägenhet spot bord
local Lagenhet_spot_horn = domoticz.devices(213) ----- Lägenhet spot hörn
local Lagenhet_spot_center = domoticz.devices(38) ----- Lägenhet spot center

        if (Lagenhet_scene1.state == 'On' and (Lagenhet_spot_center.state ~= 'Off' or Lagenhet_spot_bord.state ~= 'Off' or Lagenhet_spot_horn.state ~= 'Off')) then
           Lagenhet_scene1.switchOff()
           Lagenhet_spot_horn.switchOff()
           Lagenhet_spot_bord.switchOff()
           Lagenhet_spot_center.switchOff()
           Lagenhet_scene2.switchOff()
        end
        
        if (Lagenhet_scene1.state == 'On' and Lagenhet_spot_center.state == 'Off' and Lagenhet_spot_bord.state == 'Off' and Lagenhet_spot_horn.state == 'Off') then
           Lagenhet_scene1.switchOff()
           Lagenhet_spot_horn.dimto(70)
           Lagenhet_spot_bord.dimto(60)
           Lagenhet_spot_center.dimto(30)
           Lagenhet_scene2.switchOff()
        end
    end
}
When I try it I get this error

Code: Select all

2017-09-04 20:37:33.307 Error: dzVents: Error: ...86)\Domoticz\scripts\dzVents\generated_scripts/Ellie.lua:27: attempt to call field 'dimto' (a nil value)
The Devices should be ok.
Skärmklipp.JPG
Skärmklipp.JPG (71.18 KiB) Viewed 781 times

Re: dimto problems

Posted: Monday 04 September 2017 21:57
by leby
Fund the error myself.... I had dimto(), with dimTo() it works as intended... capital T