I am little bit worried about the code like
If you really need to use $SESSION (the MUC might be cleaner), let me suggest to properly namespace all your session variables in a common object, like $SESSION->mod_domoscio->foobar
Please avoid non-english inline comments (taky by se vám nelíbilo, kdybych vám psal komentáře jako je tento to help others to understand your code.
Finally, things like this are valid in PHP, yet it does not mean they help to understand your intention:
Note you declare the parameter as integer, set boolean false as its default value and finally compare it with a string. Please do not do such things, it hurts