Usability of modules

For instance if i want to use a method from module Archive Control in a module i am developing locally, is it possible and how to do it ?

You can use all the available AC_* function if you need Archive functionality. If you want to see the source code → Then the answer is no. All native modules are compiled natively into the binary. If you want to see check our Module Store modules, you can have a look at our GitHub page: Symcon GmbH · GitHub

paresy

Sorry for not putting it right. I meant to ask that can i use a function AC_SetLoggingStatus () in my module script which i am developing to be used locally and if not is there any work around.

Yes, you can use that function to enable or disable logging of a variable. You can find the corresponding documentation here: AC_SetLoggingStatus — IP-Symcon :: Automation Software

Just a friendly reminder in case you want to develop a module for the Module Store: A user needs to be notified about the logging as archive settings are usually in the supremacy of the user.

I tried using the function in my script but when i try adding instance of my module. It says cannot find method AC_SetLoggingStatus

Ps Thank you for the reminder

Can you show us, how and where you try to call the function? It should work, both in scripts and in modules

This is a part of function SaveValues()

$rs = pg_query($con, $query) or die(„Cannot execute query: $query\n“);

         while ($row = pg_fetch_row($rs)) 
         {
            if($row[1] == 1)

            
           $this->AC_SetLoggingStatus(21357,$this->GetIDForIdent($row[0]),true);

and then i call savevalues to the apply changes . But this is not working . I know i am doing it wrong but not getting how to correct.

Remove the $this-> in front of the AC_ function. It is not part of your module!

1 „Gefällt mir“

PS: You should not use hardcoded IDs in your modules. The ID 21357 is only on your system the right archive control instance! Ask the system for it!

1 „Gefällt mir“