Skip to content

Instantly share code, notes, and snippets.

@imaginator
Created July 8, 2022 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaginator/10e13502dad180d7f17f83cdf7c12aa3 to your computer and use it in GitHub Desktop.
Save imaginator/10e13502dad180d7f17f83cdf7c12aa3 to your computer and use it in GitHub Desktop.
[2022-07-08 08:10:49,699] [ HABApp] INFO | HABApp Version 0.31.3 Dev
[2022-07-08 08:10:49,700] [ HABApp.files.watcher] DEBUG | Adding watcher for /etc/habapp with <FileEndingFilter ending: .yml>
[2022-07-08 08:10:49,700] [ HABApp] DEBUG | Added event listener for "HABApp.Files" (filter=EventFilter(type=RequestFileUnloadEvent))
[2022-07-08 08:10:49,700] [ HABApp] DEBUG | Added event listener for "HABApp.Files" (filter=EventFilter(type=RequestFileLoadEvent))
[2022-07-08 08:10:49,701] [ HABApp.openhab.plugin] DEBUG | Starting setup
[2022-07-08 08:10:49,701] [ HABApp.openhab.plugin] DEBUG | Setup LoadAllOpenhabItems complete
[2022-07-08 08:10:49,701] [ HABApp.openhab.ping] DEBUG | Ping stopped
[2022-07-08 08:10:49,702] [ HABApp] DEBUG | Added event listener for "HABApp_Ping" (filter=EventFilter(type=ItemStateEvent))
[2022-07-08 08:10:49,702] [ HABApp.openhab.plugin] DEBUG | Setup PingOpenhab complete
[2022-07-08 08:10:49,702] [ HABApp.openhab.plugin] DEBUG | Setup ThingOverview complete
[2022-07-08 08:10:49,702] [ HABApp.openhab.plugin] DEBUG | Setup ManualThingConfig complete
[2022-07-08 08:10:49,702] [ HABApp.files.watcher] DEBUG | Adding recursive watcher for /etc/habapp/rules with <FileEndingFilter ending: .py>
[2022-07-08 08:10:49,703] [ HABApp.mqtt.connection] INFO | MQTT disabled
[2022-07-08 08:10:49,703] [HABApp.openhab.connection] INFO | Verify ssl set to False!
[2022-07-08 08:10:49,704] [HABApp.openhab.connection] DEBUG | Trying to connect to OpenHAB ...
[2022-07-08 08:10:49,833] [HABApp.openhab.connection] INFO | Connected to OpenHAB version 3.3.0 (Release Build)
[2022-07-08 08:10:49,885] [HABApp.openhab.connection] INFO | Waiting for openHAB startup to be complete
[2022-07-08 08:10:49,886] [HABApp.openhab.connection] DEBUG | Startlevel: 70
[2022-07-08 08:11:01,698] [ HABApp.file.events] DEBUG | <FileModifiedEvent: event_type=modified, src_path='/etc/habapp/rules/bbb.py', is_directory=False>
[2022-07-08 08:11:01,699] [ HABApp.file.events] DEBUG | <FileClosedEvent: event_type=closed, src_path='/etc/habapp/rules/bbb.py', is_directory=False>
[2022-07-08 08:11:02,307] [ HABApp.files] DEBUG | rules/bbb.py added
[2022-07-08 08:11:02,610] [ HABApp.files] DEBUG | rules/bbb.py changed to DEPENDENCIES_OK
[2022-07-08 08:11:02,611] [ HABApp.Rules] DEBUG | Loading file: rules/bbb.py
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | Error "Item AstroSunPositionElevation does not exist!" in load:
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | Could not load /etc/habapp/rules/bbb.py!
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | File "/usr/lib/python3.10/runpy.py", line 269 in run_path
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 245 | def run_path(path_name, init_globals=None, run_name=None):
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | (...)
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 264 | is_NullImporter = True
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 265 | if isinstance(importer, type(None)) or is_NullImporter:
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 266 | # Not a valid sys.path entry, so run the code directly
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 267 | # execfile() doesn't help as we want to allow compiled files
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 268 | code, fname = _get_code_from_file(run_name, path_name)
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | --> 269 | return _run_module_code(code, init_globals, run_name,
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 270 | pkg_name=pkg_name, script_name=fname)
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 271 | else:
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 272 | # Finder is defined for path, so add it to
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | 273 | # the start of sys.path
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | sys.path = ['/opt/habapp/bin', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/opt/habapp/lib/python3.10/site-packages']
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | code = <code object bbb.py at 0x7f23f112f890, file "/etc/habapp/rules/bbb.py", line 1>
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | code, fname = (<code object bbb.py at 0x7f23f112f890, file "/etc/habapp/rules/bbb.py", line 1>, '/etc/habapp/rules/bbb.py')
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | fname = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | importer = None
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | init_globals = {'__HABAPP__HOOK__': <HABApp.rule.rule_hook.HABAppRuleHook object at 0x7f23f11351b0>}
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | is_NullImporter = False
[2022-07-08 08:11:02,729] [ HABApp.Rules] ERROR | path_name = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | pkg_name = '/etc/habapp/rules/bbb'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | run_name = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | File "/usr/lib/python3.10/runpy.py", line 96 in _run_module_code
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 89 | def _run_module_code(code, init_globals=None,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 90 | mod_name=None, mod_spec=None,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 91 | pkg_name=None, script_name=None):
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | (...)
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 93 | fname = script_name if mod_spec is None else mod_spec.origin
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 94 | with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname):
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 95 | mod_globals = temp_module.module.__dict__
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | --> 96 | _run_code(code, mod_globals, init_globals,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 97 | mod_name, mod_spec, pkg_name, script_name)
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 98 | # Copy the globals of the temporary module, as they
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 99 | # may be cleared when the temporary module goes away
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | temp_module = <runpy._TempModule object at 0x7f23f1135240>
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | temp_module.module.__dict__ = {'__name__': '/etc/habapp/rules/bbb.py', '__doc__': None, '__package__': '/etc/habapp/rules/bbb', '__loader__': None, '__spec__': None, '__HABAPP__HOOK__': <HABApp.rule.rule_hook.HABAppRuleHook object at 0x7f23f11351b0>, '__file__': '/etc/habapp/rules/bbb.py', '__cached__': None, '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'aiter': <built-in function aiter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'anext': <built-in function anext>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'EncodingWarning': <class 'EncodingWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2022 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}, 'Rule': <class 'HABApp.rule.rule.Rule'>, 'ValueUpdateEvent': <class 'HABApp.core.events.events.ValueUpdateEvent'>, 'ValueChangeEvent': <class 'HABApp.core.events.events.ValueChangeEvent'>, 'ItemStateChangedEvent': <class 'HABApp.openhab.events.item_events.ItemStateChangedEvent'>, 'ItemStateChangedEventFilter': <class 'HABApp.openhab.events.event_filters.ItemStateChangedEventFilter'>, 'NumberItem': <class 'HABApp.openhab.items.number_item.NumberItem'>, 'OpenhabItem': <class 'HABApp.openhab.items.base_item.OpenhabItem'>, 'MyRule': <class '/etc/habapp/rules/bbb.py.MyRule'>}
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | code = <code object bbb.py at 0x7f23f112f890, file "/etc/habapp/rules/bbb.py", line 1>
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | fname = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | init_globals = {'__HABAPP__HOOK__': <HABApp.rule.rule_hook.HABAppRuleHook object at 0x7f23f11351b0>}
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | mod_globals = {'__name__': '/etc/habapp/rules/bbb.py', '__doc__': None, '__package__': '/etc/habapp/rules/bbb', '__loader__': None, '__spec__': None, '__HABAPP__HOOK__': <HABApp.rule.rule_hook.HABAppRuleHook object at 0x7f23f11351b0>, '__file__': '/etc/habapp/rules/bbb.py', '__cached__': None, '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'aiter': <built-in function aiter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'anext': <built-in function anext>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'EncodingWarning': <class 'EncodingWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2022 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}, 'Rule': <class 'HABApp.rule.rule.Rule'>, 'ValueUpdateEvent': <class 'HABApp.core.events.events.ValueUpdateEvent'>, 'ValueChangeEvent': <class 'HABApp.core.events.events.ValueChangeEvent'>, 'ItemStateChangedEvent': <class 'HABApp.openhab.events.item_events.ItemStateChangedEvent'>, 'ItemStateChangedEventFilter': <class 'HABApp.openhab.events.event_filters.ItemStateChangedEventFilter'>, 'NumberItem': <class 'HABApp.openhab.items.number_item.NumberItem'>, 'OpenhabItem': <class 'HABApp.openhab.items.base_item.OpenhabItem'>, 'MyRule': <class '/etc/habapp/rules/bbb.py.MyRule'>}
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | mod_name = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | mod_spec = None
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | pkg_name = '/etc/habapp/rules/bbb'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | script_name = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | File "/usr/lib/python3.10/runpy.py", line 86 in _run_code
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 63 | def _run_code(code, run_globals, init_globals=None,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 64 | mod_name=None, mod_spec=None,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 65 | pkg_name=None, script_name=None):
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | (...)
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 77 | if pkg_name is None:
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 78 | pkg_name = mod_spec.parent
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 79 | run_globals.update(__name__ = mod_name,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | 80 | __file__ = fname,
[2022-07-08 08:11:02,730] [ HABApp.Rules] ERROR | (...)
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 84 | __package__ = pkg_name,
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 85 | __spec__ = mod_spec)
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | --> 86 | exec(code, run_globals)
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 87 | return run_globals
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | cached = None
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | code = <code object bbb.py at 0x7f23f112f890, file "/etc/habapp/rules/bbb.py", line 1>
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | fname = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | init_globals = {'__HABAPP__HOOK__': <HABApp.rule.rule_hook.HABAppRuleHook object at 0x7f23f11351b0>}
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | loader = None
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | mod_name = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | mod_spec = None
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | pkg_name = '/etc/habapp/rules/bbb'
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | run_globals = {'__name__': '/etc/habapp/rules/bbb.py', '__doc__': None, '__package__': '/etc/habapp/rules/bbb', '__loader__': None, '__spec__': None, '__HABAPP__HOOK__': <HABApp.rule.rule_hook.HABAppRuleHook object at 0x7f23f11351b0>, '__file__': '/etc/habapp/rules/bbb.py', '__cached__': None, '__builtins__': {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <built-in function input>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'aiter': <built-in function aiter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'anext': <built-in function anext>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'EncodingWarning': <class 'EncodingWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-D (i.e. EOF) to exit, 'exit': Use exit() or Ctrl-D (i.e. EOF) to exit, 'copyright': Copyright (c) 2001-2022 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.}, 'Rule': <class 'HABApp.rule.rule.Rule'>, 'ValueUpdateEvent': <class 'HABApp.core.events.events.ValueUpdateEvent'>, 'ValueChangeEvent': <class 'HABApp.core.events.events.ValueChangeEvent'>, 'ItemStateChangedEvent': <class 'HABApp.openhab.events.item_events.ItemStateChangedEvent'>, 'ItemStateChangedEventFilter': <class 'HABApp.openhab.events.event_filters.ItemStateChangedEventFilter'>, 'NumberItem': <class 'HABApp.openhab.items.number_item.NumberItem'>, 'OpenhabItem': <class 'HABApp.openhab.items.base_item.OpenhabItem'>, 'MyRule': <class '/etc/habapp/rules/bbb.py.MyRule'>}
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | script_name = '/etc/habapp/rules/bbb.py'
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | init_globals is not None = True
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | File "/etc/habapp/rules/bbb.py", line 21 in bbb.py
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 17 | print("GOT EVENT")
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 18 | print(f'{event.name} changed from "{event.old_value}" to "{event.value}"')
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 19 | print(f'Last change of {self.my_item.name}: {self.my_item.last_change}')
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | --> 21 | MyRule()
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | File "/etc/habapp/rules/bbb.py", line 10 in __init__
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 7 | def __init__(self):
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 8 | super().__init__()
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 9 | # Get the item or create it if it does not exist
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | --> 10 | self.my_item = OpenhabItem.get_item('AstroSunPositionElevation')
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 11 | print(self.my_item)
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | self = <MyRule>
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | File "/opt/habapp/lib/python3.10/site-packages/HABApp/core/items/base_item.py", line 31 in get_item
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 24 | @classmethod
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 25 | def get_item(cls, name: str):
[2022-07-08 08:11:02,731] [ HABApp.Rules] ERROR | 26 | """Returns an already existing item. If it does not exist or has a different item type an exception will occur.
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 27 |
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 28 | :param name: Name of the item
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 29 | """
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 30 | assert isinstance(name, str), type(name)
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | --> 31 | item = get_item(name)
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 32 | assert isinstance(item, cls), f'{cls} != {type(item)}'
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | cls = <class 'HABApp.openhab.items.base_item.OpenhabItem'>
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | name = 'AstroSunPositionElevation'
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/opt/habapp/lib/python3.10/site-packages/HABApp/core/internals/item_registry/item_registry.py", line 29 in get_item
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 25 | def get_item(self, name: str) -> _HINT_ITEM_OBJ:
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 26 | try:
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 27 | return self._items[name]
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | 28 | except KeyError:
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | --> 29 | raise ItemNotFoundException(name) from None
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | self = <HABApp.core.internals.item_registry.item_registry.ItemRegistry object at 0x7f23f1134460>
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | self._items = {}
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | name = 'AstroSunPositionElevation'
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | ------------------------------------------------------------
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR |
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | --------------------------------------------------------------------------------
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | Traceback (most recent call last):
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/opt/habapp/lib/python3.10/site-packages/HABApp/rule_manager/rule_file.py", line 77, in load
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | self.create_rules(created_rules)
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/opt/habapp/lib/python3.10/site-packages/HABApp/rule_manager/rule_file.py", line 67, in create_rules
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | runpy.run_path(str(self.path), run_name=str(self.path), init_globals=init_globals)
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/usr/lib/python3.10/runpy.py", line 269, in run_path
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | return _run_module_code(code, init_globals, run_name,
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | _run_code(code, mod_globals, init_globals,
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | exec(code, run_globals)
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/etc/habapp/rules/bbb.py", line 21, in bbb.py
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | MyRule()
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/etc/habapp/rules/bbb.py", line 10, in __init__
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | self.my_item = OpenhabItem.get_item('AstroSunPositionElevation')
[2022-07-08 08:11:02,732] [ HABApp.Rules] ERROR | File "/opt/habapp/lib/python3.10/site-packages/HABApp/core/items/base_item.py", line 31, in get_item
[2022-07-08 08:11:02,733] [ HABApp.Rules] ERROR | item = get_item(name)
[2022-07-08 08:11:02,733] [ HABApp.Rules] ERROR | File "/opt/habapp/lib/python3.10/site-packages/HABApp/core/internals/item_registry/item_registry.py", line 29, in get_item
[2022-07-08 08:11:02,733] [ HABApp.Rules] ERROR | raise ItemNotFoundException(name) from None
[2022-07-08 08:11:02,733] [ HABApp.Rules] ERROR | HABApp.core.errors.ItemNotFoundException: Item AstroSunPositionElevation does not exist!
[2022-07-08 08:11:02,733] [ HABApp.Rules] WARNING | Failed to load /etc/habapp/rules/bbb.py!
[2022-07-08 08:11:02,733] [ HABApp.files] DEBUG | rules/bbb.py changed to FAILED
[2022-07-08 08:11:18,129] [ HABApp.files] DEBUG | Worker done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment