ich blicke irgendwie nicht durch ich benutze einen "fader" als Logik
den code habe ich hier aus dem forum kopiert.
Die Logik liegt als rgb.py im Logics Ordner und sieht wie folgt aus:
meine Logic.conf:
und hiermit versuche ich die Logic zu Schalten:
jedoch scheint die Visu die Logic nicht zu finden
beim starten von smarthome.py finde ich folgendes im Debug
kann mir da jemand helfen?
den code habe ich hier aus dem forum kopiert.
Die Logik liegt als rgb.py im Logics Ordner und sieht wie folgt aus:
Code:
#!/usr/bin/pyhton import random if trigger['value']: sh.Wohnung.Wohnbereich.RGBrot(random.randrange(5,255)) sh.Wohnung.Wohnbereich.RGBgruen(random.randrange(5,255)) sh.Wohnung.Wohnbereich.RGBblau(random.randrange(5,255)) sh.Wohnung.Wohnbereich.RGBweiß(random.randrange(5,255)) else: sh.Wohnung.Wohnbereich.RGBrot(0) sh.Wohnung.Wohnbereich.RGBgruen(0) sh.Wohnung.Wohnbereich.RGBblau(0) sh.Wohnung.Wohnbereich.RGBweiss(0)
Code:
# logic.conf [hello] filename = hello.py crontab = init [dummy] filename = dummy_series.py cycle = 300 [rgb] filename = rgb.py visu_acl = yes
Code:
</td> {{ basic.trigger('rgb', 'rgb', 'RGBstarten') }} </tr>
Code:
2014-03-23 19:28:58,060 DEBUG Main 192.168.1.7:50082 sent '{"cmd":"logic","name":"rgb","val":""}' -- __init__.py:json_parse:269 2014-03-23 19:28:58,065 WARNING Main Client 192.168.1.7:50082 requested invalid logic: rgb -- __init__.py:json_parse:304
Code:
2014-03-23 19:28:19,304 INFO Main Start Logics -- logic.py:__init__:33 2014-03-23 19:28:19,310 DEBUG Main Reading Logics from /usr/smarthome/lib/env/logic_conf -- logic.py:_read_logics:64 2014-03-23 19:28:19,338 DEBUG Main Reading Logics from /usr/smarthome/etc/logic.conf -- logic.py:_read_logics:64 2014-03-23 19:28:19,358 DEBUG Main Logic: dummy -- logic.py:__init__:44 2014-03-23 19:28:19,435 DEBUG Main dummy next time: 2014-03-23 19:28:34+01:00 -- scheduler.py:_next_time:289 2014-03-23 19:28:19,468 DEBUG Main Logic: rgb -- logic.py:__init__:44 2014-03-23 19:28:19,490 ERROR Main Exception: 'utf-8' codec can't decode byte 0xdf in position 256: invalid continuation byte -- logic.py:generate_bytecode:121 Traceback (most recent call last): File "/usr/smarthome/lib/logic.py", line 117, in generate_bytecode code = open(self.filename).read() File "/usr/lib/python3.2/codecs.py", line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdf in position 256: invalid continuation byte 2014-03-23 19:28:19,574 DEBUG Main Logic: env_stat -- logic.py:__init__:44 2014-03-23 19:28:19,607 DEBUG Main env_stat next time: 2014-03-23 19:28:31+01:00 -- scheduler.py:_next_time:289 2014-03-23 19:28:19,619 DEBUG Main Logic: hello -- logic.py:__init__:44
Kommentar