System-Wide Variables?

Quick question here that I can’t seem to find the answer to. If I have multiple .rules files, are the variables and timers set within one rule file accessible system-wide from other .rules files? For example, would a timer or variable created in livingRoom.rules be modifiable from code in bedRoom.rules?

Thanks!

No. “global” variables are unavailable outside of the rules file it resides in. If you need to share either merge or reorganize your files (I’ve organized mine by function rather than room, e.g. lighting, presence, etc.) for this very reason. If it is just a value (e.g. a flag or a number) you can put it into a Item. For stuff like Timers you are stuck.

And also I have noticed strange effects, if I have been using the same variable name in different rule files.

Hi

Have a look at the wiki about strange effects: Rules

Regards
Dieter

Thanks, did know that there is a offical documentation about these problems.

Thanks! Guess it’s time to get creative in the way I organise things.