lrybak / domoticz-airly Goto Github PK
View Code? Open in Web Editor NEWA Python plugin for Domoticz to access airly API for smog information in Poland
License: MIT License
A Python plugin for Domoticz to access airly API for smog information in Poland
License: MIT License
hej
following the upgrade to Buster on Raspbian, domoticz is failing with segemnantion fault, see log:
2019-07-02 22:45:34.893 Error: Thread 4 (Thread 0x74d98220 (LWP 24290)):
2019-07-02 22:45:34.893 Error: #0 __waitpid (options=0, stat_loc=0x74d958b8, pid=24316) at ../sysdeps/unix/sysv/linux/waitpid.c:30
2019-07-02 22:45:34.893 Error: #1 __waitpid (pid=24316, stat_loc=0x74d958b8, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:25
2019-07-02 22:45:34.893 Error: #2 0x00112a10 in dumpstack_gdb(bool) ()
2019-07-02 22:45:34.893 Error: #3 0x00112ffc in signal_handler(int, siginfo_t*, void*) ()
2019-07-02 22:45:34.893 Error: #4
2019-07-02 22:45:34.893 Error: #5 raise (sig=11) at ../sysdeps/unix/sysv/linux/raise.c:50
2019-07-02 22:45:34.893 Error: #6
2019-07-02 22:45:34.893 Error: #7 0x76de1a1c in __pthread_rwlock_wrlock_full (abstime=0x0, rwlock=0x0) at pthread_rwlock_common.c:576
2019-07-02 22:45:34.893 Error: #8 __GI___pthread_rwlock_wrlock (rwlock=0x0) at pthread_rwlock_wrlock.c:27
2019-07-02 22:45:34.893 Error: #9 0x6925fd58 in CRYPTO_THREAD_write_lock () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1
2019-07-02 22:45:34.894 Error: #10 0x6928bf40 in ?? () from /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1
Segmentation fault
as per some analisys, issue is purly related to this plugin - see domoticz forum post
I've tried a little to analyze the code of plugin .. but no time for deeper investigation...
mozesz pomoc Kolego :)
pozdr
m.
PS. Airly is one of the important plugin, lovely working to provide data from system during bad air in the world
Better handling of exceptions in situation of invalid credentials (api key), api rate limit exceeded, json decode error
Przy uzyciu data push'a do influxdb wartosc procentowe UNIT_{PM10,PM25}_PERCENTAGE oraz UNIT_AIR_QUALITY_INDEX muszą być liczbami całkowitymi, influxdb dla percentage potrzebuje integera. Prosba o zmiane:
~/domoticz/plugins/domoticz-airly-v2 $ head -n 436 plugin.py |tail -1
self.variables[self.UNIT_PM10_PERCENTAGE]['sValue'] = str(round((values["PM10"]/self.UNIT_PM10_NORM) * 100))
~/domoticz/plugins/domoticz-airly-v2 $ head -n 442 plugin.py |tail -1
self.variables[self.UNIT_PM25_PERCENTAGE]['sValue'] = str(round((values["PM25"] / self.UNIT_PM25_NORM) * 100))
~/domoticz/plugins/domoticz-airly-v2 $ head -n 452 plugin.py |tail -1
self.variables[self.UNIT_AIR_QUALITY_INDEX]['sValue'] = str(round(res["indexes"][0]["value"]))
Hej.
Otrzymuję w logach taki oto błąd: (Airly) Nierozpoznany błąd: type NoneType doesn't define round method
i dane się nie aktualizują.
Czym to może być spowodowane?
EDIT:
dzieję się to tylko na jednym czujniku (najbliżej mojej lokalizacji) 7938. Na stronie i w aplikacji airly jest online i pokazuje dane.
Na innych w dalszej okolicy np.: 7817 jest OK
Witam.
Wykonałem wszystko według instrukcji i po tym od razu nie miałem dostępu do panelu domoticza.
Restarty domoticza i raspberry nie pomagały. Dopiero fizyczne usuniecie katalogu z plugins ożywiło domoticza.
Nie wiem co źle wykonałem.
Pozdrawiam
Sebastian
2019-12-01 17:52:26.462 (Myslenicka) Debug logging mask set to: NONE
2019-12-01 17:52:26.458 Status: (Myslenicka) Entering work loop.
2019-12-01 17:52:26.458 Status: (Myslenicka) Initialized version 0.3.0, author 'fisher'
2019-12-01 17:52:26.857 Error: (Myslenicka) 301: Installation was replaced with another one
2019-12-01 17:52:26.859 Error: (Myslenicka) 'onStart' failed 'AttributeError'.
2019-12-01 17:52:26.859 Error: (Myslenicka) ----> Line 669 in '/home/domoticz/domoticz/plugins/domoticz-airly/plugin.py'
2019-12-01 17:52:26.859 Error: (Myslenicka) ----> Line 286 in '/home/domoticz/domoticz/plugins/domoticz-airly/plugin.py'
2019-12-01 17:52:26.859 Error: (Myslenicka) ----> Line 417 in '/home/domoticz/domoticz/plugins/domoticz-airly/plugin.py'
ID 6885 - Kraków Myślenicka
Nie dodaje żadnego czujnika IDX, tylko ten błąd w logach.
Add compatibility with new api v2
2018-11-02 09:02:51.176 (Airly) onStop called
2018-11-02 09:02:51.176 (Airly) Debug logging mask set to: NONE
2018-11-02 09:02:51.771 (Airly) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2018-11-02 09:02:51.771 (Airly) 'Mode1':'IA1kIUtbdp44qBRqxVjlxh8CYfOCxmd3'
2018-11-02 09:02:51.771 (Airly) 'DomoticzHash':'a3a45906'
2018-11-02 09:02:51.771 (Airly) 'Key':'AIRLY'
2018-11-02 09:02:51.771 (Airly) 'Author':'fisher'
2018-11-02 09:02:51.771 (Airly) 'Name':'Airly'
2018-11-02 09:02:51.771 (Airly) 'Version':'0.3.0'
2018-11-02 09:02:51.771 (Airly) 'DomoticzVersion':'4.9700'
2018-11-02 09:02:51.771 (Airly) 'HomeFolder':'/home/pi/domoticz/plugins/domoticz-airly/'
2018-11-02 09:02:51.771 (Airly) 'HardwareID':'32'
2018-11-02 09:02:51.771 (Airly) 'DomoticzBuildTime':'2018-06-23 16:24:51'
2018-11-02 09:02:51.771 (Airly) 'Port':'0'
2018-11-02 09:02:51.771 (Airly) 'Mode3':'15'
2018-11-02 09:02:51.772 (Airly) 'Mode2':'i2531'
2018-11-02 09:02:51.772 (Airly) 'Mode6':'Debug'
2018-11-02 09:02:51.772 (Airly) Device count: 0
2018-11-02 09:02:51.772 (Airly) Pushing 'PollIntervalDirective' on to queue
2018-11-02 09:02:51.772 (Airly) onHeartbeat called
2018-11-02 09:02:51.772 (Airly) Processing 'PollIntervalDirective' message
2018-11-02 09:02:51.772 (Airly) Heartbeat interval set to: 20.
2018-11-02 09:02:51.157 Status: (Airly) Stop directive received.
2018-11-02 09:02:51.357 Status: (Airly) Stopping threads.
2018-11-02 09:02:51.410 Status: (Airly) Exiting work loop.
2018-11-02 09:02:51.410 Status: (Airly) Stopped.
2018-11-02 09:02:51.410 Status: (Airly) Started.
2018-11-02 09:02:51.769 Status: (Airly) Initialized version 0.3.0, author 'fisher'
2018-11-02 09:02:51.769 Status: (Airly) Entering work loop.
2018-11-02 09:02:51.772 Error: (Airly) 'onStart' failed 'AttributeError'.
2018-11-02 09:02:51.772 Error: (Airly) ----> Line 669 in /home/pi/domoticz/plugins/domoticz-airly/plugin.py, function onStart
2018-11-02 09:02:51.772 Error: (Airly) ----> Line 286 in /home/pi/domoticz/plugins/domoticz-airly/plugin.py, function onStart
2018-11-02 09:02:51.772 Error: (Airly) ----> Line 417 in /home/pi/domoticz/plugins/domoticz-airly/plugin.py, function onHeartbeat
If Airly sensor connection fails plugin will never update Domoticz since we set variable self.inProgress = True and never change it to False.
Proposed fix in function OnHeartbeat around line 360:
except SensorNotFoundException as snfe:
self.inProgress = False
Domoticz.Error(("Sensor id (%(sensor_id)d) not exists") % {'sensor_id': int(Parameters["Mode2"])})
except UnauthorizedException as ue:
self.inProgress = False
Domoticz.Error(("Not authorized"))
As you can see I added "self.inProgress = False" when exception is caught.
Cześć,
na początek - świetna wtyczka - nie maiłem problemów z dodaniem i obsługą.
Mam natomiast pytanie odnośnie pobierania danych z innych czujników niż Airly : Stacje Państwowego Monitoringu Powietrza. Chodzi o NOx i SOx i O3. Jest szansa że takie stacje tez byłyby obsłużone?
Mam jeszcze mały problem z którym nie mogę sobie poradzić, może to tez nie jest dobre miejsce na takie pytania: jak pobrać dane z procentowych wskaźników przekroczenia normy? Próbowałem 'domoticz.devices('Airly - PM10 Norma').PM10_PERCENTAGE' ale bez rezultatu. Chciałem użyć w powiadomieniach, resztę danych udąło mi się odczytać.
z góry dzięki za odpowiedź.
Witam,
W mojej okolicy jest kilka czujników smogu które są zarejestrowane w Airly,
często zdarza się że czujniki ulegają awarii i dane w domoticz są nie aktualne,
Czy można dodać np 3 stacje w konfiguracji i domoticz będzie sobie wybierał pierwszą która działa?
Lub aby przedstawiał średnią z 2/3 czujników Airly?
Witam,
mam problem z eksportem danych z witrualnych sensorów do bazy influx. Zgłaszałem to na forum domoticza, podobne objawy są u innych uzytkowników.
Dane z sensorów temperatury i ciśnienia eksportują się prawidłowo. Niestety dane dotyczące jakości powietrza już nie.
Wątek omówiony jest tutaj: https://www.domoticz.com/forum/viewtopic.php?f=6&t=35830&p=279581&hilit=airly#p279581
Czy da się to jakoś sprawdzić/poprawić?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.