Page 1 of 1

hebrew named devices in lua

Posted: Monday 09 January 2017 15:02
by abrasha9
hello
i use domoticz in hebrew (cheers to the translator, whoever he is) and of course i name my devices in hebrew name (i use it in my work so other people who arent good in english can use it)

now, i want to start using lua scripts instead of blockly and when i put the device name the code messes up:

Code: Select all

if (datetimedifferencenow(otherdevices_lastupdate['	חממה 1 גמלון 22-23 ']) > 300 then
    
if (datetimedifferencenow(otherdevices_lastupdate['     ']) >300 ) then 
the secod line is an example of the first line before i enter the hebrew word inside the colon field - ' '.
of course the compiler inside domoticz marks this line as an error.
do i have a solution for this? like using script files instead of the events window? or only use english letters in device name?

i tried both typing inside the brackets, and pasting from the device list ("show current states" button)

Re: hebrew named devices in lua

Posted: Monday 09 January 2017 15:21
by abrasha9
ok found a solution:

Code: Select all

t = otherdevices_lastupdate['מזוט ביניים 1']
if  datetimedifferencenow(t) > 300  then
the only problem is with the combination of the two kinds of brackets [ and ( .
so using a "mediator variable" to prevent this collision made the trick