dimto problems

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

Moderator: leecollings

Post Reply
leby
Posts: 98
Joined: Monday 28 July 2014 9:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Stockholm
Contact:

dimto problems

Post 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 779 times
/lennart
leby
Posts: 98
Joined: Monday 28 July 2014 9:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Stockholm
Contact:

Re: dimto problems

Post by leby »

Fund the error myself.... I had dimto(), with dimTo() it works as intended... capital T
/lennart
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest