In the beginning I have to apologize that I am writing in english. I am using smartVISU and smarthome.py to control my home. It is working very well. Now I would like to write some logics. Here is one sample that I made, but I get errors from the logic file.
Here are the config files:
/items/knx.conf (part of it):
/etc/logic.conf:
/logics/autotallix.py:
This is what i get from SH.py log:
If I use this kind of logic file. Everything works.
What I have made wrong?
Here are the config files:
/items/knx.conf (part of it):
Code:
[1-ker] [[tv-huone]] [[[wc-kattovalo]]] type = bool visu = yes knx_dpt = 1 knx_listen = 0/6/1 knx_send = 0/6/0 [[[wc-seina]]] type = bool visu = yes knx_dpt = 1 knx_listen = 0/6/3 knx_send = 0/6/2
Code:
[autotallin_ovi] filename = autotallix.py watch_item = 1-ker.tv-huone.wc-seina # monitor for changes
Code:
#!/usr/bin/env python if not sh.1-ker.tv-huone.wc-seina(): sh.1-ker.tv-huone.wc-kattovalo('on')
Code:
2013-07-09 08:28:07,899 SmartHome.py DEBUG reading logics from /usr/local/smarthome/etc/logic.conf -- logic.py:__init__:38 2013-07-09 08:28:07,900 SmartHome.py DEBUG Logic: autotallin_ovi -- logic.py:__init__:45 2013-07-09 08:28:07,905 SmartHome.py WARNING Exception: invalid syntax (autotallix.py, line 2) -- logic.py:generate_bytecode:111
Code:
#!/usr/bin/env python for item in sh: print item for child_item in item: print child_item
Kommentar