Hallo Marcus,
vielen Dank für deine Unterstützung, einiges bekomme ich inzwischen schon hin mit SH
Man freut sich über die kleinsten Dinge wie ein Schneekönig 
Nun wollte ich mich mal an das erstellen eine Logic stoße aber recht schnell auf ein kleines Problem. Ich wollte überwachen ob mein VDR gerade läuft und erstmal nur eine Meldung im Log ausgeben, ohne die "Ping" Prüfung sehe ich die Meldungen auch im Log.
vdr.conf
logic.conf
Log
Ich denke hier ist der Übeltäter
Entweder rufe ich sh.tools.ping nicht richtig auf oder es gibt einen Fehler darin. Ein Tippfehler sollte es diesmal nicht sein, hoffentlich.
Gruß Felix
vielen Dank für deine Unterstützung, einiges bekomme ich inzwischen schon hin mit SH


Nun wollte ich mich mal an das erstellen eine Logic stoße aber recht schnell auf ein kleines Problem. Ich wollte überwachen ob mein VDR gerade läuft und erstmal nur eine Meldung im Log ausgeben, ohne die "Ping" Prüfung sehe ich die Meldungen auch im Log.
vdr.conf
Code:
#!/usr/bin/env python if sh.tools.ping('192.168.1.4'): print "VDR ist an" else: print "VDR ist aus"
Code:
[VDR] filename = vdr.conf cycle = 5
Code:
2013-01-27 17:16:44,631 SmartHome.py INFO Init SmartHome.py v0.64 -- smarthome.py:__init__:163 2013-01-27 18:16:44,645 SmartHome.py INFO No latitude/longitude specified => you could not use the sun object. -- smarthome.py:__init__:191 2013-01-27 18:16:44,650 SmartHome.py INFO Init Scheduler -- scheduler.py:__init__:51 2013-01-27 18:16:44,655 SmartHome.py INFO Init plugins -- smarthome.py:__init__:196 2013-01-27 18:16:44,659 SmartHome.py INFO Init Plugins -- plugin.py:__init__:34 2013-01-27 18:16:44,672 SmartHome.py DEBUG Plugin: visu -- plugin.py:__init__:43 2013-01-27 18:16:44,662 Scheduler DEBUG creating 5 workers -- scheduler.py:run:57 2013-01-27 18:16:44,776 SmartHome.py DEBUG Plugin: knx -- plugin.py:__init__:43 2013-01-27 18:16:44,791 SmartHome.py DEBUG Plugin: cli -- plugin.py:__init__:43 2013-01-27 18:16:44,805 SmartHome.py INFO Init items -- smarthome.py:__init__:198 2013-01-27 18:16:44,825 SmartHome.py DEBUG knx: Steckdosen Wohnzimmer listen on 0/1/1 -- __init__.py:parse_item:207 2013-01-27 18:16:44,829 SmartHome.py DEBUG knx: Steckdosen Wohnzimmer listen on and init with 0/1/1 -- __init__.py:parse_item:216 2013-01-27 18:16:44,837 SmartHome.py DEBUG knx: Deckenbeleuchtung Wohnzimmer listen on 0/1/2 -- __init__.py:parse_item:207 2013-01-27 18:16:44,841 SmartHome.py DEBUG knx: Deckenbeleuchtung Wohnzimmer listen on and init with 0/1/2 -- __init__.py:parse_item:216 2013-01-27 18:16:44,846 SmartHome.py DEBUG Item 'Wohnzimmer': No type specified. -- item.py:__init__:98 2013-01-27 18:16:44,855 SmartHome.py INFO KNX: connected to 127.0.0.1:6720 -- my_asynchat.py:connect:55 2013-01-27 18:16:44,862 SmartHome.py INFO Start Plugins -- plugin.py:start:64 2013-01-27 18:16:44,873 knx DEBUG knx: init ga -- __init__.py:run:184 2013-01-27 18:16:44,884 SmartHome.py INFO Starting logics -- logic.py:__init__:41 2013-01-27 18:16:44,899 SmartHome.py DEBUG reading logics from /usr/local/smarthome/etc/logic.conf -- logic.py:__init__:50 2013-01-27 18:16:44,955 SmartHome.py DEBUG 0.0.251 read 0/1/1 -- __init__.py:parse_telegram:174 2013-01-27 18:16:44,962 SmartHome.py DEBUG 0.0.2 set 0/1/1 to False -- __init__.py:parse_telegram:161 2013-01-27 18:16:44,968 SmartHome.py DEBUG 0.0.251 read 0/1/2 -- __init__.py:parse_telegram:174 2013-01-27 18:16:44,983 SmartHome.py DEBUG 0.0.2 set 0/1/2 to False -- __init__.py:parse_telegram:161 2013-01-27 18:16:46,433 SmartHome.py DEBUG Websocket: incoming connection from 192.168.1.54:50517 -- __init__.py:handle_accept:103 2013-01-27 18:16:46,452 SmartHome.py DEBUG 192.168.1.54:50517 sent '["SmartHome.py",1]' -- __init__.py:json_parse:184 2013-01-27 18:16:46,457 SmartHome.py DEBUG 192.168.1.54:50517 sent '["monitor",["VDR"]]' -- __init__.py:json_parse:184 2013-01-27 18:16:52,016 VDR WARNING Logic VDR exception: global name 'subprocess' is not defined -- scheduler.py:_task:229 2013-01-27 18:16:52,202 Scheduler DEBUG VDR next time: 2013-01-27 18:16:57+01:00 -- scheduler.py:_next_time:195 2013-01-27 18:16:57,080 VDR WARNING Logic VDR exception: global name 'subprocess' is not defined -- scheduler.py:_task:229 2013-01-27 18:16:57,244 Scheduler DEBUG VDR next time: 2013-01-27 18:17:02+01:00 -- scheduler.py:_next_time:195 ^C2013-01-27 18:17:01,832 SmartHome.py INFO Stop Plugins -- plugin.py:stop:69 2013-01-27 18:17:01,836 SmartHome.py DEBUG Closing listen -- __init__.py:stop:119 2013-01-27 18:17:01,841 SmartHome.py INFO KNX: connection to 127.0.0.1:6720 closed -- my_asynchat.py:handle_close:70 2013-01-27 18:17:02,472 SmartHome.py INFO SmartHome.py stopped -- smarthome.py:stop:265
Code:
2013-01-27 18:16:52,016 VDR WARNING Logic VDR exception: global name 'subprocess' is not defined -- scheduler.py:_task:229
Gruß Felix
Kommentar