This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Save data to storage
#1
Dear All,
I have a small problem. I have a KNX device that does keep in memory its previuos humidity setpoint what power shut down. Hence I would like to write a script in order to save the setpoint in homelynk Schneider and write it when power comes back.

I wrote this on event script on 2/4/51 address:

storage.set ('myobjectdata', '2/4/51')

Then in init script I wrote the following:

mydata = storage.get('myobjectdata')

grp.write ('2/4/51', mydata)


It seems everything works but the value sent on bus is 0% (Umidity). What is wrong?

When I save a data to storage, there is a time after that data is saved? Or the saving is immediate?

Thank you for your help.

HomeLynk firmware version is 1.3.1

Thanks.

Claudio Lauriola
Reply
#2
Hi Claudio,

You save now the object address as string to the storage and get back '2/4/51' as string
and you send that as value to the address. The object dont understand that so result = nothing (:

use this to save the value correct to the storage: storage.set('myobjectdata', grp.getvalue('2/4/51'))

BR,

Erwin van der Zwart
Reply
#3
There's no point in saving it to storage as you can just do grp.getvalue to get the latest value stored in the database, so your init script should look like this:
Code:
value = grp.getvalue('2/4/51')
grp.write ('2/4/51', value)

Database, storage and everything else is saved to the SD card each 30 minutes to prolong its lifespan.
Reply
#4
Thank you but I can do the following:

Event script: eg 5/2/31

Value = grp.getvalue (5/2/31)
If value ==

Sorry

If value == 1 then
Grp.write (0/0/36 = true)
Else
End.

It does not work. Thanks.
Reply
#5
True (:

If you need faster time then 30 minutes, maybe you have a spare channel on a dimmer or another device where you can store your value.

Create a new groupaddress to that object and perform a grp.read to that object (somehwere in the field) during init. Make sure the read flag is enable on that object.

BR,

Erwin

Hi,

Don't use capitals in commands, 'If' 'Then' 'Else' 'End' "Grp.write' is not correct, use if, then, else, end, grp.write etc.

You can see it on the color, if a command stays black it's wrong.

Also what do you compare with '== 1' ? A bit object? You must use false and true on boolean values (bit objects)

BR,

Erwin
Reply


Forum Jump: