Set a data value which has no value! Stumped

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

Moderator: leecollings

Post Reply
paul402
Posts: 96
Joined: Monday 23 May 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Set a data value which has no value! Stumped

Post 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.
User avatar
waltervl
Posts: 5902
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

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

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
paul402
Posts: 96
Joined: Monday 23 May 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by paul402 »

Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest