Page 1 of 1

Set a data value which has no value! Stumped

Posted: Sunday 05 May 2024 17:58
by paul402
So this is what I wrote

Code: Select all

return {
    active = true,
    
    logging = {
            level = domoticz.LOG_DEBUG,
            marker = 'Solar Shade' 
            },
    on = {
        timer = {'Every minute'}
    },
data = {
        eastsolarblindsmoved = {initial=10}
    },
    
        execute = function(domoticz)
            domoticz.log('log marker ==============')
            if (eastsolarblindsmoved~=nil) then
                local texttest
                texttest=tonumber(eastsolarblindsmoved)
                domoticz.log('east solar blinks moved value ' .. texttest)
            else
                domoticz.log('not a value.... '  .. 'no value texttest')    
            end
        end
}
and this is the debug

Code: Select all

 2024-05-05 17:53:00.482 Status: dzVents: Info: Solar Shade: log marker ==============
2024-05-05 17:53:00.482 Status: dzVents: Info: Solar Shade: not a value.... no value texttest 
But I set the initial value to 10!
Any ideas where my error is are welcome.

Re: Set a data value which has no value! Stumped

Posted: Sunday 05 May 2024 18:33
by waltervl
Check the documentation on data objects https://www.domoticz.com/wiki/DzVents:_ ... stent_data

You have to call them differently:

Code: Select all

if (domoticz.data.eastsolarblindsmoved~=nil) then

Re: Set a data value which has no value! Stumped

Posted: Monday 06 May 2024 9:29
by paul402
Thank you!