Hallo zusammen,
habe vor ein paar Wochen smarthome entdeckt und bin noch immer begeistert. Gelegentlich treibt es mich aber auch in den Wahnsinn. Aktuell folgender Fall:
1 ABB Rolladenaktor 8fach, BuschJäger USB Schnittstelle 6186, Raspberry pi mit eibd und smarthome.py
Ich habe mittlerweile auf ein Minimalbeispiel reduziert und es zeigt sich, dass es ein Problem mit dem Zugriff auf die sh Objekte gibt. Ich habe eine Logik für die Orchideen (aktueller Name "test") geschreiben, die eine Datei test.py aufruft. Wenn die Sonne scheint (Info von Solaranlage) und der azimut in einem bestimmten Bereich ist, dann soll die Rollade halb runter fahren.
Ich habe das ganze jetzt auf ein Minimum reduziert, sodass alle 30 s die Rollade per Logik ganz nach oben und dann wieder auf 50% fährt, nur zum testen. Wenn ich die Rolladen über die Items anspreche, funktioniert nur das Lesen sauber, schreiben geht nur über sh.knx.groupwrite(ga, data, dpt) sicher.
Wenn ich die Items über
anspreche, tauch im Logfile auch der Befehl auf. Wenn ich über das item selbst gehe, dann taucht kein knx Eintrag in der Logdatei auf.
Hier das Logfile:
die etc/logic.conf
die Datei test.py
und die item.conf
Hat jemand eine Idee, woran das liegen kann? Meine Logik für Sonnenaufgang und Sonnenuntergang hat das gleiche Problem, außer, dass es hier manchmal funktioniert und meistens nicht.
Besten Dank und viele Grüße
Oliver
habe vor ein paar Wochen smarthome entdeckt und bin noch immer begeistert. Gelegentlich treibt es mich aber auch in den Wahnsinn. Aktuell folgender Fall:
1 ABB Rolladenaktor 8fach, BuschJäger USB Schnittstelle 6186, Raspberry pi mit eibd und smarthome.py
Ich habe mittlerweile auf ein Minimalbeispiel reduziert und es zeigt sich, dass es ein Problem mit dem Zugriff auf die sh Objekte gibt. Ich habe eine Logik für die Orchideen (aktueller Name "test") geschreiben, die eine Datei test.py aufruft. Wenn die Sonne scheint (Info von Solaranlage) und der azimut in einem bestimmten Bereich ist, dann soll die Rollade halb runter fahren.
Ich habe das ganze jetzt auf ein Minimum reduziert, sodass alle 30 s die Rollade per Logik ganz nach oben und dann wieder auf 50% fährt, nur zum testen. Wenn ich die Rolladen über die Items anspreche, funktioniert nur das Lesen sauber, schreiben geht nur über sh.knx.groupwrite(ga, data, dpt) sicher.
Wenn ich die Items über
Code:
sh.knx.groupwrite(ga, data, dpt)
Hier das Logfile:
Code:
2014-03-14 18:34:08,673 INFO Main Start SmartHome.py 1.0-32-gfd0043e+ -- smarthome.py:__init__:231 2014-03-14 18:34:08,677 DEBUG Main Python 3.2.3 -- smarthome.py:__init__:232 2014-03-14 18:34:08,682 INFO Main Init Scheduler -- scheduler.py:__init__:86 2014-03-14 18:34:08,688 INFO Main Init Plugins -- smarthome.py:start:274 2014-03-14 18:34:08,698 DEBUG Scheduler creating 5 workers -- scheduler.py:run:93 2014-03-14 18:34:08,704 DEBUG Main Plugin: knx -- plugin.py:__init__:43 2014-03-14 18:34:08,731 DEBUG Main Plugin: sql -- plugin.py:__init__:43 2014-03-14 18:34:08,772 DEBUG Main SQLite 3.7.13 -- __init__.py:__init__:62 2014-03-14 18:34:09,018 DEBUG Main SQLite: database integrity ok -- __init__.py:__init__:78 2014-03-14 18:34:09,044 DEBUG Main SQLite pack next time: 2014-03-15 03:02:00+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:09,049 INFO Main Init Items -- smarthome.py:start:280 2014-03-14 18:34:09,263 DEBUG Main Item env.core.memory = 12275712.0 via SQLite None None -- item.py:set:457 2014-03-14 18:34:09,324 DEBUG Main Item env.core.threads = 7.0 via SQLite None None -- item.py:set:457 2014-03-14 18:34:09,382 DEBUG Main Item env.core.garbage = 0.0 via SQLite None None -- item.py:set:457 2014-03-14 18:34:09,387 DEBUG Main Item env.core: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,427 DEBUG Main Item env.location: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,492 DEBUG Main Item env.system.load = 0.04 via SQLite None None -- item.py:set:457 2014-03-14 18:34:09,501 DEBUG Main Item env.system: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,505 DEBUG Main Item env: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,528 DEBUG Main Item Kueche.Rolladen.alle: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,548 DEBUG Main Item Kueche.Rolladen.alle_Erker: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,559 DEBUG Main KNX: Kueche.Rolladen.Spuele.Status listen on and init with 1/0/0 -- __init__.py:parse_item:247 2014-03-14 18:34:09,587 DEBUG Main Item Kueche.Rolladen.Spuele: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,599 DEBUG Main KNX: Kueche.Rolladen.Terasse.Status listen on and init with 1/0/1 -- __init__.py:parse_item:247 2014-03-14 18:34:09,624 DEBUG Main Item Kueche.Rolladen.Terasse: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,635 DEBUG Main KNX: Kueche.Rolladen.Erker_links.Status listen on and init with 1/0/2 -- __init__.py:parse_item:247 2014-03-14 18:34:09,661 DEBUG Main Item Kueche.Rolladen.Erker_links: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,673 DEBUG Main KNX: Kueche.Rolladen.Erker_mitte.Status listen on and init with 1/0/3 -- __init__.py:parse_item:247 2014-03-14 18:34:09,699 DEBUG Main Item Kueche.Rolladen.Erker_mitte: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,710 DEBUG Main KNX: Kueche.Rolladen.Erker_rechts.Status listen on and init with 1/0/4 -- __init__.py:parse_item:247 2014-03-14 18:34:09,737 DEBUG Main Item Kueche.Rolladen.Erker_rechts: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,741 DEBUG Main Item Kueche.Rolladen: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,744 DEBUG Main Item Kueche: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,774 DEBUG Main Item Wohnzimmer.Rolladen.Wiga_alle: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,793 DEBUG Main Item Wohnzimmer.Rolladen.alle: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,808 DEBUG Main KNX: Wohnzimmer.Rolladen.Wiga12.Status listen on and init with 1/0/5 -- __init__.py:parse_item:247 2014-03-14 18:34:09,838 DEBUG Main Item Wohnzimmer.Rolladen.Wiga12: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,850 DEBUG Main KNX: Wohnzimmer.Rolladen.Wiga34.Status listen on and init with 1/0/6 -- __init__.py:parse_item:247 2014-03-14 18:34:09,882 DEBUG Main Item Wohnzimmer.Rolladen.Wiga34: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,893 DEBUG Main KNX: Wohnzimmer.Rolladen.Fenster.Status listen on and init with 1/0/7 -- __init__.py:parse_item:247 2014-03-14 18:34:09,919 DEBUG Main Item Wohnzimmer.Rolladen.Fenster: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,922 DEBUG Main Item Wohnzimmer.Rolladen: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,925 DEBUG Main Item Wohnzimmer: no type specified. -- item.py:__init__:242 2014-03-14 18:34:09,934 INFO Main Start Plugins -- plugin.py:start:65 2014-03-14 18:34:09,941 INFO Main Start Logics -- logic.py:__init__:33 2014-03-14 18:34:09,944 DEBUG Main Reading Logics from /usr/local/smarthome/lib/env/logic_conf -- logic.py:_read_logics:64 2014-03-14 18:34:09,957 DEBUG Main Reading Logics from /usr/local/smarthome/etc/logic.conf -- logic.py:_read_logics:64 2014-03-14 18:34:09,968 DEBUG Main Logic: Sonnenaufgang -- logic.py:__init__:44 2014-03-14 18:34:10,026 DEBUG Main Sonnenaufgang next time: 2014-03-15 05:46:50.944921+00:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:10,030 DEBUG Main Logic: env_stat -- logic.py:__init__:44 2014-03-14 18:34:10,047 DEBUG Main env_stat next time: 2014-03-14 18:34:20+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:10,050 DEBUG Main Logic: test -- logic.py:__init__:44 2014-03-14 18:34:10,060 DEBUG Main test next time: 2014-03-14 18:34:25+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:10,064 DEBUG Main Logic: Sonnenuntergang -- logic.py:__init__:44 2014-03-14 18:34:10,085 DEBUG Main Sonnenuntergang next time: 2014-03-14 17:36:21.197518+00:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:10,064 DEBUG Main Logic: Sonnenuntergang -- logic.py:__init__:44 2014-03-14 18:34:10,085 DEBUG Main Sonnenuntergang next time: 2014-03-14 17:36:21.197518+00:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:10,089 DEBUG Main Logic: env_init -- logic.py:__init__:44 2014-03-14 18:34:10,099 DEBUG Main Logic: env_loc -- logic.py:__init__:44 2014-03-14 18:34:10,380 DEBUG Connections KNX: connected to 127.0.0.1:6720 -- connection.py:connect:386 2014-03-14 18:34:10,384 DEBUG Connections KNX: enable group monitor -- __init__.py:handle_connect:119 2014-03-14 18:34:10,388 DEBUG Connections KNX: init read -- __init__.py:handle_connect:125 2014-03-14 18:34:11,122 DEBUG Main KNX: 0.0.0 read 1/0/0 -- __init__.py:parse_telegram:206 2014-03-14 18:34:11,126 DEBUG Main KNX: 0.0.0 read 1/0/1 -- __init__.py:parse_telegram:206 2014-03-14 18:34:11,188 DEBUG Main knx: 1.1.1 set 1/0/0 to 0.0 -- __init__.py:parse_telegram:193 2014-03-14 18:34:11,198 DEBUG Main KNX: 0.0.0 read 1/0/2 -- __init__.py:parse_telegram:206 2014-03-14 18:34:11,346 DEBUG Main knx: 1.1.1 set 1/0/1 to 49.80392156862745 -- __init__.py:parse_telegram:193 2014-03-14 18:34:11,351 DEBUG Main Item Kueche.Rolladen.Terasse.Status = 49.80392156862745 via KNX 1.1.1 1/0/1 -- item.py:__update:363 2014-03-14 18:34:11,552 DEBUG Main knx: 1.1.1 set 1/0/2 to 100.0 -- __init__.py:parse_telegram:193 2014-03-14 18:34:11,557 DEBUG Main Item Kueche.Rolladen.Erker_links.Status = 100.0 via KNX 1.1.1 1/0/2 -- item.py:__update:363 2014-03-14 18:34:11,599 DEBUG Main KNX: 0.0.0 read 1/0/3 -- __init__.py:parse_telegram:206 2014-03-14 18:34:11,756 DEBUG Main knx: 1.1.1 set 1/0/3 to 100.0 -- __init__.py:parse_telegram:193 2014-03-14 18:34:11,761 DEBUG Main Item Kueche.Rolladen.Erker_mitte.Status = 100.0 via KNX 1.1.1 1/0/3 -- item.py:__update:363 2014-03-14 18:34:12,001 DEBUG Main KNX: 0.0.0 read 1/0/4 -- __init__.py:parse_telegram:206 2014-03-14 18:34:12,050 DEBUG Main knx: 1.1.1 set 1/0/4 to 100.0 -- __init__.py:parse_telegram:193 2014-03-14 18:34:12,055 DEBUG Main Item Kueche.Rolladen.Erker_rechts.Status = 100.0 via KNX 1.1.1 1/0/4 -- item.py:__update:363 2014-03-14 18:34:12,402 DEBUG Main KNX: 0.0.0 read 1/0/5 -- __init__.py:parse_telegram:206 2014-03-14 18:34:12,450 DEBUG Main knx: 1.1.1 set 1/0/5 to 75.29411764705883 -- __init__.py:parse_telegram:193 2014-03-14 18:34:12,455 DEBUG Main Item Wohnzimmer.Rolladen.Wiga12.Status = 75.29411764705883 via KNX 1.1.1 1/0/5 -- item.py:__update:363 2014-03-14 18:34:12,803 DEBUG Main KNX: 0.0.0 read 1/0/6 -- __init__.py:parse_telegram:206 2014-03-14 18:34:12,850 DEBUG Main knx: 1.1.1 set 1/0/6 to 75.29411764705883 -- __init__.py:parse_telegram:193 2014-03-14 18:34:12,855 DEBUG Main Item Wohnzimmer.Rolladen.Wiga34.Status = 75.29411764705883 via KNX 1.1.1 1/0/6 -- item.py:__update:363 2014-03-14 18:34:13,205 DEBUG Main KNX: 0.0.0 read 1/0/7 -- __init__.py:parse_telegram:206 2014-03-14 18:34:13,252 DEBUG Main knx: 1.1.1 set 1/0/7 to 20.784313725490197 -- __init__.py:parse_telegram:193 2014-03-14 18:34:13,258 DEBUG Main Item Wohnzimmer.Rolladen.Fenster.Status = 20.784313725490197 via KNX 1.1.1 1/0/7 -- item.py:__update:363 2014-03-14 18:34:15,333 DEBUG env_init Item env.core.version = 1.0-32-gfd0043e+ via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,400 DEBUG env_init Item env.core.start = 2014-03-14 18:34:15.397427+01:00 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,421 DEBUG sh.gc Garbage collector: collected 0 objects. -- smarthome.py:_garbage_collection:498 2014-03-14 18:34:15,425 DEBUG env_init Item env.system.name = raspberrypi via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,445 DEBUG env_loc Item env.location.sunrise = 2014-03-15 06:46:50.944921+01:00 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,476 DEBUG env_init Item env.system.start = 2014-03-14 12:54:51.472907+01:00 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,498 DEBUG env_loc Item env.location.sunset = 2014-03-14 18:36:21.197519+01:00 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,577 DEBUG env_loc Item env.location.moonrise = 2014-03-15 17:38:37.337991+01:00 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,659 DEBUG env_loc Item env.location.moonset = 2014-03-15 05:56:30.259542+01:00 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,700 DEBUG env_loc Item env.location.moonphase = 4 via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,746 DEBUG sh.gc Object references: 8680 -- smarthome.py:_maintenance:490 2014-03-14 18:34:15,765 DEBUG env_loc Item env.location.day = True via Logic None None -- item.py:__update:363 2014-03-14 18:34:15,919 DEBUG Scheduler sh.gc next time: 2014-03-15 02:04:00+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:15,986 DEBUG Scheduler env_loc next time: 2014-03-14 17:37:21.197524+00:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:20,085 DEBUG env_stat Item env.core.memory = 12201984 via Logic None None -- item.py:__update:363 2014-03-14 18:34:20,093 DEBUG env_stat Item env.system.load = 0.05 via Logic None None -- item.py:__update:363 2014-03-14 18:34:20,101 DEBUG env_stat Item env.location.moonlight = 96 via Logic None None -- item.py:__update:363 2014-03-14 18:34:20,531 DEBUG Scheduler env_stat next time: 2014-03-14 18:39:20+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:25,583 DEBUG Scheduler test next time: 2014-03-14 18:34:55+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:34:55,856 DEBUG Scheduler test next time: 2014-03-14 18:35:25+01:00 -- scheduler.py:_next_time:289 2014-03-14 18:35:25,613 DEBUG Scheduler test next time: 2014-03-14 18:35:55+01:00 -- scheduler.py:_next_time:289
Code:
[Sonnenaufgang] filename = sunrise.py crontab = sunrise [Sonnenuntergang] filename = sunset.py crontab = sunset [test] filename = test.py cycle = 30
Code:
#!/usr/bin/env python3 file=open('/usr/local/smarthome/test.log', 'a') a=sh.Kueche.Rolladen.Terasse.Status() file.write('Hoehe aktuell: ' + str(a) + '\r\n') if (a < 45): sh.Kueche.Rolladen.Terasse.Hoehe(50) #funktioniert nicht #sh.knx.groupwrite('1/3/1', 50, '5.001') #funktioniert file.write('Auf 50% fahren\r\n') else: sh.Kueche.Rolladen.Terasse.move(0) #funktioniert nicht #sh.knx.groupwrite('1/1/1', 0, '1') funktioniert file.write('Ganz nach oben fahren\r\n') file.close()
Code:
[Kueche] [[Rolladen]] [[[alle]]] [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/7/0 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/7/1 [[[alle_Erker]]] [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/7/2 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/7/3 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_send = 1/7/4 [[[Spuele]]] [[[[Status]]]] type = num knx_dpt = 5.001 knx_init = 1/0/0 [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/1/0 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/2/0 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_send = 1/3/0 #sqlite = yes [[[[Preset12]]]] type = bool knx_dpt = 1 knx_send = 1/5/0 [[[[Preset34]]]] type = bool knx_dpt = 1 knx_send = 1/6/0 [[[Terasse]]] [[[[Status]]]] type = num knx_dpt = 5.001 knx_init = 1/0/1 [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/1/1 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/2/1 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_send = 1/3/1 [[[[Preset12]]]] type = bool knx_dpt = 1 knx_send = 1/5/1 [[[[Preset34]]]] type = bool knx_dpt = 1 knx_send = 1/6/1 [[[Erker_links]]] [[[[Status]]]] type = num knx_dpt = 5.001 knx_init = 1/0/2 [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/1/2 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/2/2 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_dpt = 1 knx_send = 1/5/1 [[[[Preset34]]]] type = bool knx_dpt = 1 knx_send = 1/6/1 [[[Erker_links]]] [[[[Status]]]] type = num knx_dpt = 5.001 knx_init = 1/0/2 [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/1/2 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/2/2 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_send = 1/3/2 [[[[Preset12]]]] type = bool knx_dpt = 1 knx_send = 1/5/2 [[[[Preset34]]]] type = bool knx_dpt = 1 knx_send = 1/6/2 [[[Erker_mitte]]] [[[[Status]]]] type = num knx_dpt = 5.001 knx_init = 1/0/3 [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/1/3 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/2/3 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_send = 1/3/3 [[[[Preset12]]]] type = bool knx_dpt = 1 knx_send = 1/5/3 [[[[Preset34]]]] type = bool knx_dpt = 1 knx_send = 1/6/3 [[[Erker_rechts]]] [[[[Status]]]] type = num knx_dpt = 5.001 knx_init = 1/0/4 [[[[move]]]] type = bool knx_dpt = 1 knx_send = 1/1/4 [[[[stop]]]] type = bool knx_dpt = 1 knx_send = 1/2/4 [[[[Hoehe]]]] type = num knx_dpt = 5.001 knx_send = 1/3/4 [[[[Preset12]]]] type = bool knx_dpt = 1 knx_send = 1/5/4 [[[[Preset34]]]] type = bool knx_dpt = 1 knx_send = 1/6/4
Besten Dank und viele Grüße
Oliver
Kommentar