Closed saria974 closed 2 years ago
Szia, meg kellene csinálnom a dokumentációt végre, csak mind idő.
Az adatbázis kapcsolódással lesz a gond (elsőnek), mariaDB-t használsz? Host-hoz ip alapján kapcsolódjon. Ha valamiért nem érné el a 3306 porton, akkor a container-nek (mariaDB add-on configuration fülön) engedélyezni kell.
így:
Szia! Úgy látom, hogy az adatbázis kapcsolódás már rendben (a belsőn vagyok), de most ezt az üzenetet kapom:
2022-08-08 23:10:52.225114 INFO AppDaemon: Reading config 2022-08-08 23:10:52.239714 INFO AppDaemon: /config/appdaemon/apps/apps.yaml added or modified 2022-08-08 23:10:52.243769 INFO AppDaemon: Found 3 total apps Error handling request Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 334, in data_received messages, upgraded, tail = self._request_parser.feed_data(data) File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'" 2022-08-08 23:12:07.797723 INFO AppDaemon: New client Admin Client connected 2022-08-08 23:12:42.094445 INFO AppDaemon: Client disconnection from Admin Client
valaminek itt még lennie kell, mert még csak az appdaemon indulna el és indítaná az app-okat 3db-ot talált, de már előtte elpusztul talán protokoll hibával. Nincs több üzenet? Az egész appdaemon -ra nyomj egy restart-ot.
Nyomtam neki egyet, most ezt látom: cont-init: info: running /etc/cont-init.d/appdaemon.sh Looking in links: https://wheels.home-assistant.io/musllinux/ Requirement already satisfied: paho-mqtt in /usr/lib/python3.10/site-packages (1.6.1) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Looking in links: https://wheels.home-assistant.io/musllinux/ Collecting bs4 Downloading https://wheels.home-assistant.io/musllinux/bs4-0.0.1-py3-none-any.whl (1.3 kB) Collecting beautifulsoup4 Downloading beautifulsoup4-4.11.1-py3-none-any.whl (128 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.2/128.2 kB 4.4 MB/s eta 0:00:00 Collecting soupsieve>1.2 Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB) Installing collected packages: soupsieve, beautifulsoup4, bs4 Successfully installed beautifulsoup4-4.11.1 bs4-0.0.1 soupsieve-2.3.2.post1 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv Looking in links: https://wheels.home-assistant.io/musllinux/ Collecting pymysql Downloading PyMySQL-1.0.2-py3-none-any.whl (43 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.8/43.8 kB 7.7 MB/s eta 0:00:00 Installing collected packages: pymysql Successfully installed pymysql-1.0.2 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting services-up: info: copying legacy longrun appdaemon (no readiness notification) s6-rc: info: service legacy-services successfully started [23:29:17] INFO: Starting AppDaemon... 2022-08-08 23:29:24.666135 INFO AppDaemon: AppDaemon Version 4.2.1 starting 2022-08-08 23:29:24.668698 INFO AppDaemon: Python version is 3.10.5 2022-08-08 23:29:24.668897 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml 2022-08-08 23:29:24.669064 INFO AppDaemon: Added log: AppDaemon 2022-08-08 23:29:24.669270 INFO AppDaemon: Added log: Error 2022-08-08 23:29:24.669484 INFO AppDaemon: Added log: Access 2022-08-08 23:29:24.669650 INFO AppDaemon: Added log: Diag 2022-08-08 23:29:25.086458 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2022-08-08 23:29:25.524306 INFO HASS: HASS Plugin Initializing 2022-08-08 23:29:25.524747 INFO HASS: HASS Plugin initialization complete 2022-08-08 23:29:25.526111 INFO AppDaemon: Initializing HTTP 2022-08-08 23:29:25.526859 INFO AppDaemon: Using 'ws' for event stream 2022-08-08 23:29:25.535995 INFO AppDaemon: Starting API 2022-08-08 23:29:25.540872 INFO AppDaemon: Starting Admin Interface 2022-08-08 23:29:25.542821 INFO AppDaemon: Starting Dashboards 2022-08-08 23:29:25.621967 INFO HASS: Connected to Home Assistant 2022.8.2 2022-08-08 23:29:25.656055 INFO AppDaemon: App 'hello_world' added 2022-08-08 23:29:25.659872 INFO AppDaemon: App 'Eon' added 2022-08-08 23:29:25.663262 INFO AppDaemon: App 'normalized_energy_usage' added 2022-08-08 23:29:25.668569 INFO AppDaemon: Found 3 total apps 2022-08-08 23:29:25.669734 INFO AppDaemon: Starting Apps with 3 workers and 3 pins 2022-08-08 23:29:25.673165 INFO AppDaemon: Running on port 5050 2022-08-08 23:29:25.741761 INFO HASS: Evaluating startup conditions 2022-08-08 23:29:25.760666 INFO HASS: Startup condition met: hass state=RUNNING 2022-08-08 23:29:25.761313 INFO HASS: All startup conditions met 2022-08-08 23:29:25.838956 INFO AppDaemon: Got initial state from namespace default 2022-08-08 23:29:27.682591 INFO AppDaemon: Scheduler running in realtime 2022-08-08 23:29:27.687176 INFO AppDaemon: Adding /config/appdaemon/apps to module import path 2022-08-08 23:29:27.689658 INFO AppDaemon: Adding /config/appdaemon/apps/eon to module import path 2022-08-08 23:29:27.693165 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py 2022-08-08 23:29:27.941790 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/eon/read_eon.py 2022-08-08 23:29:28.545062 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello 2022-08-08 23:29:28.547849 INFO AppDaemon: Initializing app Eon using class Eon from module read_eon 2022-08-08 23:29:28.731886 INFO hello_world: Hello from AppDaemon 2022-08-08 23:29:28.733691 INFO hello_world: You are now ready to run Apps! 2022-08-08 23:29:28.753043 INFO AppDaemon: App initialization complete 2022-08-08 23:29:29.011082 INFO Eon: Starting E.ON reader 2022-08-08 23:29:29.222719 INFO Eon: get verification token from E.ON portal 2022-08-08 23:29:29.452409 INFO Eon: Start receiving data 2022-08-08 23:29:29.572975 WARNING Eon: ------------------------------------------------------------ 2022-08-08 23:29:29.574157 WARNING Eon: Unexpected error in worker for App Eon: 2022-08-08 23:29:29.574737 WARNING Eon: Worker Ags: {'id': '78dcdf5dc55a4019a07cbf7f81148ffe', 'name': 'Eon', 'objectid': 'd67b445dc34d42868e9f3eff46aacf08', 'type': 'scheduler', 'function': <bound method Eon.read_data of <read_eon.Eon object at 0x7f2e8efe5ae0>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'interval': 3600, '__thread_id': 'thread-1'}} 2022-08-08 23:29:29.575180 WARNING Eon: ------------------------------------------------------------ 2022-08-08 23:29:29.576164 WARNING Eon: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/pymysql/connections.py", line 613, in connect sock = socket.create_connection( File "/usr/lib/python3.10/socket.py", line 845, in create_connection raise err File "/usr/lib/python3.10/socket.py", line 833, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 904, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/eon/read_eon.py", line 33, in read_data eon_1_8_0_report, eon_2_8_0_report = self.get_report_data(profile_data_url, session) File "/config/appdaemon/apps/eon/read_eon.py", line 120, in get_report_data self.collect_daily_data(eon_1_8_0_data, sensor_1_8_0_sensor, eon_1_8_0_report, "EON consumption energy total") File "/config/appdaemon/apps/eon/read_eon.py", line 142, in collect_daily_data rows = self.get_states(eon_sensor, extra_parameter) File "/config/appdaemon/apps/eon/read_eon.py", line 230, in get_states connection = pymysql.connect(host=self.args['host'], File "/usr/lib/python3.10/site-packages/pymysql/connections.py", line 353, in init self.connect() File "/usr/lib/python3.10/site-packages/pymysql/connections.py", line 664, in connect raise exc pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.1.11' ([Errno 111] Connection refused)") 2022-08-08 23:29:29.576561 WARNING Eon: ------------------------------------------------------------
Ez viszonylag egyértelmű: ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred:
De ott van a végén is: pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '192.168.1.11' ([Errno 111] Connection refused)")
Vagy nincs nyitva a port vagy valamit elírtál. Elsőnek mi volt a config-ba, mert ott látszólag a db-hez legalább tudott csatlakozni csak nem találta a táblát.
Hogy fut a HA és az adatbázis kezelő? Supervised HA + add-on?
Home Assistant 2022.8.2 Supervisor 2022.07.0 Operating System 8.4 Kezelőfelület 20220802.0 - latest Nincs külső/külön adatbázis...SQLite Kivettem a 2db másik APP-ot, úg ylátom megint nem találja a táblát.
2022-08-09 01:59:47.924411 INFO AppDaemon: Found 1 total apps 2022-08-09 01:59:47.928827 INFO AppDaemon: Terminating Eon 2022-08-09 01:59:47.930223 INFO AppDaemon: Initializing app Eon using class Eon from module read_eon 2022-08-09 01:59:48.007440 INFO Eon: Starting E.ON reader 2022-08-09 01:59:48.203346 INFO Eon: get verification token from E.ON portal 2022-08-09 01:59:48.401678 INFO Eon: Start receiving data 2022-08-09 01:59:48.507373 ERROR Eon: Error - get_states: (1146, "Table 'homeassistant.states' doesn't exist") 2022-08-09 01:59:48.509684 WARNING Eon: ------------------------------------------------------------ 2022-08-09 01:59:48.510243 WARNING Eon: Unexpected error in worker for App Eon: 2022-08-09 01:59:48.510758 WARNING Eon: Worker Ags: {'id': 'e0dc298af3074111883d5e4c1bdacc9a', 'name': 'Eon', 'objectid': 'ee1aa99052a84d71ab8da05e44852db4', 'type': 'scheduler', 'function': <bound method Eon.read_data of <read_eon.Eon object at 0x7fd64b5bd8a0>>, 'pin_app': True, 'pin_thread': 0, 'kwargs': {'interval': 3600, '__thread_id': 'thread-0'}} 2022-08-09 01:59:48.511457 WARNING Eon: ------------------------------------------------------------ 2022-08-09 01:59:48.512397 WARNING Eon: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 904, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/eon/read_eon.py", line 33, in read_data eon_1_8_0_report, eon_2_8_0_report = self.get_report_data(profile_data_url, session) File "/config/appdaemon/apps/eon/read_eon.py", line 120, in get_report_data self.collect_daily_data(eon_1_8_0_data, sensor_1_8_0_sensor, eon_1_8_0_report, "EON consumption energy total") File "/config/appdaemon/apps/eon/read_eon.py", line 142, in collect_daily_data rows = self.get_states(eon_sensor, extra_parameter) File "/config/appdaemon/apps/eon/read_eon.py", line 250, in get_states return rows UnboundLocalError: local variable 'rows' referenced before assignment 2022-08-09 01:59:48.513710 WARNING Eon: ------------------------------------------------------------
Visszatettem a Normalized APP-ot és most egyben ez az üzenet: 2022-08-09 17:04:17.010078 INFO Eon: Starting E.ON reader 2022-08-09 17:04:17.212860 INFO Eon: get verification token from E.ON portal 2022-08-09 17:04:17.410258 INFO Eon: Start receiving data 2022-08-09 17:04:17.505702 ERROR Eon: Error - get_states: (1146, "Table 'homeassistant.states' doesn't exist") 2022-08-09 17:04:17.506464 WARNING Eon: ------------------------------------------------------------ 2022-08-09 17:04:17.506971 WARNING Eon: Unexpected error in worker for App Eon: 2022-08-09 17:04:17.507374 WARNING Eon: Worker Ags: {'id': '8f993d73852142fca7c9ffa5914e6346', 'name': 'Eon', 'objectid': '710e1c2959504722a6b3b70a911db577', 'type': 'scheduler', 'function': <bound method Eon.read_data of <read_eon.Eon object at 0x7f4cc20fc2b0>>, 'pin_app': True, 'pin_thread': 0, 'kwargs': {'interval': 3600, 'thread_id': 'thread-0'}} 2022-08-09 17:04:17.507736 WARNING Eon: ------------------------------------------------------------ 2022-08-09 17:04:17.508377 WARNING Eon: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 904, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/eon/read_eon.py", line 33, in read_data eon_1_8_0_report, eon_2_8_0_report = self.get_report_data(profile_data_url, session) File "/config/appdaemon/apps/eon/read_eon.py", line 120, in get_report_data self.collect_daily_data(eon_1_8_0_data, sensor_1_8_0_sensor, eon_1_8_0_report, "EON consumption energy total") File "/config/appdaemon/apps/eon/read_eon.py", line 142, in collect_daily_data rows = self.get_states(eon_sensor, extra_parameter) File "/config/appdaemon/apps/eon/read_eon.py", line 250, in get_states return rows UnboundLocalError: local variable 'rows' referenced before assignment 2022-08-09 17:04:17.508783 WARNING Eon: ------------------------------------------------------------ 2022-08-09 17:06:54.010645 INFO normalized_energy_usage: Normalizing energy usage 2022-08-09 17:06:54.011245 WARNING normalized_energy_usage: ------------------------------------------------------------ 2022-08-09 17:06:54.011583 WARNING normalized_energy_usage: Unexpected error in worker for App normalized_energy_usage: 2022-08-09 17:06:54.011879 WARNING normalized_energy_usage: Worker Ags: {'id': '3968ab578e6745ebb27978398d755908', 'name': 'normalized_energy_usage', 'objectid': 'd8dd7c23bac747a991e5d3e98b1fad40', 'type': 'scheduler', 'function': <bound method NormalizedEnergyUsage.setup of <normalized_energy_usage.NormalizedEnergyUsage object at 0x7f4cc0bf3700>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'interval': 3600, 'thread_id': 'thread-1'}} 2022-08-09 17:06:54.012602 WARNING normalized_energy_usage: ------------------------------------------------------------ 2022-08-09 17:06:54.013345 WARNING normalized_energy_usage: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 904, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/normalized_energy_usage/normalized_energy_usage.py", line 22, in setup self.fix_statistics_data(self.args["1_8_0_sensor"], date.date()) File "/config/appdaemon/apps/normalized_energy_usage/normalized_energy_usage.py", line 29, in fix_statistics_data rows = self.get_statistics_by_date(eon_type, date) File "/config/appdaemon/apps/normalized_energy_usage/normalized_energy_usage.py", line 77, in get_statistics_by_date user=self.args['username'], KeyError: 'username' 2022-08-09 17:06:54.014004 WARNING normalized_energy_usage: ------------------------------------------------------------
A "username" problémát sikerült megugrani, nem kell hozzá a Normalized APP-ban a _db, se a felhasználóhoz, se a jelszóhoz. Itt tartok most:
2022-08-10 00:03:37.486922 INFO Eon: Starting E.ON reader 2022-08-10 00:03:37.877413 INFO Eon: get verification token from E.ON portal 2022-08-10 00:03:38.091751 INFO Eon: Start receiving data 2022-08-10 00:03:38.371049 ERROR Eon: Error - get_states: (1146, "Table 'homeassistant.states' doesn't exist") 2022-08-10 00:03:38.371714 WARNING Eon: ------------------------------------------------------------ 2022-08-10 00:03:38.371986 WARNING Eon: Unexpected error in worker for App Eon: 2022-08-10 00:03:38.372295 WARNING Eon: Worker Ags: {'id': '6e29406d5b0d42b382dc130ea8164a8e', 'name': 'Eon', 'objectid': '3e6a1bd00e8a4479a72d5c7f3dd2bde3', 'type': 'scheduler', 'function': <bound method Eon.read_data of <read_eon.Eon object at 0x7f918d8a9f00>>, 'pin_app': True, 'pin_thread': 0, 'kwargs': {'interval': 3600, '__thread_id': 'thread-0'}} 2022-08-10 00:03:38.372585 WARNING Eon: ------------------------------------------------------------ 2022-08-10 00:03:38.373936 WARNING Eon: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 904, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/eon/read_eon.py", line 33, in read_data eon_1_8_0_report, eon_2_8_0_report = self.get_report_data(profile_data_url, session) File "/config/appdaemon/apps/eon/read_eon.py", line 120, in get_report_data self.collect_daily_data(eon_1_8_0_data, sensor_1_8_0_sensor, eon_1_8_0_report, "EON consumption energy total") File "/config/appdaemon/apps/eon/read_eon.py", line 142, in collect_daily_data rows = self.get_states(eon_sensor, extra_parameter) File "/config/appdaemon/apps/eon/read_eon.py", line 250, in get_states return rows UnboundLocalError: local variable 'rows' referenced before assignment 2022-08-10 00:03:38.374935 WARNING Eon: ------------------------------------------------------------
A mariaDB fut, a felhasználó, jelszó, adatbázis, port többször ellenőrzive. MIt nézek be?
Nincs külső/külön adatbázis...SQLite
Szia, ez mindenképpen probléma, hiszen csak a MariaDB-re használatára van megírva a script. Viszont később írod, hogy még is csak MariaDB fut?
Elsőnek csak az EON-os legyen beüzemelve, addig nem kell foglalkozni a normalizedApp-al (az adatok rendberakásáért felel a DB csak).
Tehát elsőnek legyen az EON-os app beüzemelve, amihez mariaDB kell. Itt is van egy példa beállítás: https://github.com/amargo/appdeamon-scripts/issues/2#issuecomment-1166215261
MySQL-el meg tudod nézni, hogy az adatbázisban létezik-e a tábla és homeassistant az adatbázisod neve. Ezeket kellene ellenőrizni.
Köszi az idődet, de sajna nem boldogulok. MariaDB feltéve , jelszavak rendben, de valamiért továbbra sem tudja a táblákat létrehozni. A log ugyanaz mint korábban. A MariaDB táblához tudok kívülről csatlakozni a lenti paraméterekkel. A "/MariaDB/Databases/homeassistant/Tables" üres.
Mutatom mi van, hátha észreveszel valami turpisságot. MariaDB konfig: databases:
apps.yaml: Eon: module: read_eon class: Eon eon_url: 'https://energia.eon-hungaria.hu/W1000' username: 'eon_usr' password: 'eon_psw' report_id: '2xxxxx' chart_id: '21xxx' last_reset: "2020-09-14T11:25:00+00:00" every_hour: 1 hyphen: '166xxxxxxx' offset: -2 host: xxx.xxx.xxx.xxx database: homeassistant username_db: db_usr password_db: db_psw 1_8_0_sensor: sensor.eon_1_8_0_energy_total 2_8_0_sensor: sensor.eon_2_8_0_energy_total normalized_energy_usage: class: NormalizedEnergyUsage module: normalized_energy_usage host: xxx.xxx.xxx.xxx database: homeassistant username_db: db_usr password_db: db_psw offset: -2 numdays: 4 every_hour: 1 1_8_0_sensor: sensor.eon_1_8_0_energy_total 2_8_0_sensor: sensor.eon_2_8_0_energy_total
Esetleg van további ötleted?
Ezek alapján én nem látom, hogy a HA is használná a MariaDB-t. Tehát, a Hassio-nak is meg kell adni, hogy SQLlight helyett MariaDB-t használjon, utána leszenek ott táblák is, amit a script tud használni :)
https://github.com/home-assistant/addons/blob/master/mariadb/DOCS.md
Köszi szépen, így már érthető a problémám. Zárhatod a jegyet, a migiráláshos nagyobb levegő fog kelleni. Megpróbálom az MQTT-vel feléleszteni, ha gondom van, ott kereslek. Köszi mégegszer az idődet és a fáradozásodat, különben remek hiánypótló progi. :)
Nincs mit 😊, az mqtt-s verzió sokkal kevesebbet tud, ott tényleg csak leszedi az aktuális fogyasztást, de az időbeli elhelyezése is attól függ mikor jöttek le az adatok.
Szia @amargo ! Elöszőr is remek munka, gratulálok, de valamiért az enyémet nem sikerül működésre bírni. Tudnál segíteni? A HA-t Synology-kon használom virtuális gépen, minden a legfrissebb. Eddig jutottam, az AppDemon a következő hibaüzenetet adja:
2022-08-08 15:54:38.554810 WARNING Eon: ------------------------------------------------------------ 2022-08-08 16:54:38.017345 INFO Eon: Starting E.ON reader 2022-08-08 16:54:38.321503 INFO Eon: get verification token from E.ON portal 2022-08-08 16:54:38.607321 INFO Eon: Start receiving data 2022-08-08 16:54:38.724469 ERROR Eon: Error - get_states: (1146, "Table 'homeassistant.states' doesn't exist") 2022-08-08 16:54:38.725698 WARNING Eon: ------------------------------------------------------------ 2022-08-08 16:54:38.726397 WARNING Eon: Unexpected error in worker for App Eon: 2022-08-08 16:54:38.727006 WARNING Eon: Worker Ags: {'id': '4df4407dc31e47879b9c7f31b8df17a6', 'name': 'Eon', 'objectid': 'eabeb27e792b4543ad1fd4d3b687ad57', 'type': 'scheduler', 'function': <bound method Eon.read_data of <read_eon.Eon object at 0x7f9bb4a2fe50>>, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'interval': 3600, '__thread_id': 'thread-1'}} 2022-08-08 16:54:38.727546 WARNING Eon: ------------------------------------------------------------ 2022-08-08 16:54:38.728338 WARNING Eon: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 904, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/eon/read_eon.py", line 33, in read_data eon_1_8_0_report, eon_2_8_0_report = self.get_report_data(profile_data_url, session) File "/config/appdaemon/apps/eon/read_eon.py", line 120, in get_report_data self.collect_daily_data(eon_1_8_0_data, sensor_1_8_0_sensor, eon_1_8_0_report, "EON consumption energy total") File "/config/appdaemon/apps/eon/read_eon.py", line 142, in collect_daily_data rows = self.get_states(eon_sensor, extra_parameter) File "/config/appdaemon/apps/eon/read_eon.py", line 250, in get_states return rows UnboundLocalError: local variable 'rows' referenced before assignment
Az apps.yaml-om így néz ki: Eon: module: read_eon class: Eon eon_url: 'https://energia.eon-hungaria.hu/W1000' username: 'xxxxxxx@xxxxxxxxx' password: 'xxxxxxxxxxxx' report_id: 'xxxxxx' chart_id: 'xxxxxxx' last_reset: "2020-09-14T11:25:00+00:00" every_hour: 1 hyphen: '-' offset: -2 host: xxxxxxxxx username_db: xxxxxxxxx password_db: xxxxxxxxx database: xxxxxxxxx 1_8_0_sensor: sensor.eon_1_8_0_energy_total 2_8_0_sensor: sensor.eon_2_8_0_energy_total
Az EON felületén összraktam egy munkalapot, ahogy írtad és megnéztem F12-vel amit írtál. A report_id ok, chart_id-t és a hyphen-t valmiért nem találom. További kérdés, hogy az adatbázis paraméteréhez mit kellene megadnom ha a HA saját adatbázisát használom? (host, username_db, psw_db) Köszi a segítséget!