Page 1 of 1

A minor bug?

Posted: Friday 04 August 2017 9:39
by leby
Hi, think I encountered a minor bug, no big deal but anyhow.

I'm running 3.8155 on Win10.

I have just started to do my first attempts with dzVents instead of normal lua to see if it's easier.
I started with a very simple script

Code: Select all

return {
    active = true,
    on = {
        timer = {'Every minute'}
    },
    execute = function(domoticz)
        if (domoticz.devices('1st floor Bathroom Fan').lastUpdate.minutesAgo > 70) then
            domoticz.devices('1st floor Bathroom Fan').switchOff()
        end
    end
}
And named it in Swedish.. that's ware I think the bug could be. If I have swedish letters in the name suchs as 'å, ä, ö' the log looks like this

Code: Select all

2017-08-04 09:29:15.707 Error: dzVents: Error: module '�-1st floor Bathroom Fan' not found:
no field package.preload['�-1st floor Bathroom Fan']
no file 'C:\Program Files (x86)\Domoticz\lua\�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\lua\�-1st floor Bathroom Fan\init.lua'
no file 'C:\Program Files (x86)\Domoticz\�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\�-1st floor Bathroom Fan\init.lua'
no file '.\�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\runtime/�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\runtime/device-adapters/�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\dzVents/�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\scripts/�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\generated_scripts/�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\data/�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\scripts\dzVents\�-1st floor Bathroom Fan.lua'
no file 'C:\Program Files (x86)\Domoticz\�-1st floor Bathroom Fan.dll'
no file 'C:\Program Files (x86)\Domoticz\loadall.dll'
no file '.\�-1st floor Bathroom Fan.dll'
If I remove the swedish letters it all seems to work well and the log show

Code: Select all

2017-08-04 09:30:00.312 dzVents: Info: ------ Start internal script: 1st floor Bathroom Fan:, trigger: every minute
2017-08-04 09:30:00.339 dzVents: Info: ------ Finished 1st floor Bathroom Fan

Re: A minor bug?

Posted: Friday 04 August 2017 15:42
by dannybloe
Ah.. seems like an encoding issue indeed. Can you exactly describe how I should reproduce this?

Re: A minor bug?

Posted: Friday 04 August 2017 18:14
by leby
I had the name 'Stäng fläkt övervåning' on the script, I used the web gui to create the script, and the code was the one above.
I then tried several different things and realised that I had used swedish letters so I changed the script name to
'1st floor Bathroom Fan' and it worked. Just to verify I then added a letter in front of the script name to
'Ö1st floor Bathroom Fan' mean nothing but just to test and then I got the error again so I think you can use any of åäöÅÄÖ in the name to reproduce the error.

thx/lennart