Python Plugin: MeteoAlarmEU

Python and python framework
misko903
Posts: 46
Joined: Thursday 27 September 2018 22:58
Target OS: Raspberry Pi
Domoticz version: Latest
Location: Trencin, Slovakia
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by misko903 » Friday 09 November 2018 22:50

ycahome wrote:
Thursday 08 November 2018 15:08
Then your problem is still feedparser that was not on your system.
If you have python 3.x try :

Code: Select all

sudo apt-get install python3-feedparser
tried. still does not work.

Code: Select all

2018-11-09 21:42:53.157 Error: (MeteoAlarmEU) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/MeteoAlarmEU/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2018-11-09 21:42:53.159 Error: (MeteoAlarm) Module Import failed, exception: 'ImportError'
2018-11-09 21:42:53.159 Error: (MeteoAlarm) Module Import failed: ' Name: feedparser'
2018-11-09 21:42:53.160 Error: (MeteoAlarm) Error Line details not available.
and later it repeats this:

Code: Select all

2018-11-09 21:44:21.572 Error: MeteoAlarm hardware (16) thread seems to have ended unexpectedly
to give some info:

Code: Select all

pi@raspberrypi:~ $ which python3
/usr/bin/python3
pi@raspberrypi:~ $ which python
/usr/bin/python
pi@raspberrypi:~ $ python --version
Python 3.5.3

drwxr-xrwx  4 root root 4096 okt 18 22:00 MeteoAlarmEU
is the owner ok?

User avatar
ycahome
Posts: 212
Joined: Sunday 12 February 2017 11:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by ycahome » Saturday 10 November 2018 0:33

Hello.

as I said, your problem is that feedparser is missing.

please post here the output of the following command

Code: Select all

 sudo apt list --installed|grep feed

manutremo
Posts: 53
Joined: Saturday 19 November 2016 18:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by manutremo » Saturday 10 November 2018 8:13

Hi,

I'm also installing the plugin into a Synology box. I managed to get it running adding the following line to plugin.py:

Code: Select all

sys.path.append('/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages')
Now I have a different errors in my domoticz log:

Code: Select all

2018-11-10 07:08:24.878 Error: (MeteoAlarm) 'onStart' failed 'KeyError'.
2018-11-10 07:08:24.878 Error: (MeteoAlarm) ----> Line 269 in '/usr/local/domoticz/var/plugins/MeteoAlarmEU/plugin.py', function onStart
2018-11-10 07:08:24.878 Error: (MeteoAlarm) ----> Line 96 in '/usr/local/domoticz/var/plugins/MeteoAlarmEU/plugin.py', function onStart

2018-11-10 07:08:35.110 Error: (MeteoAlarm) 'onHeartbeat' failed 'KeyError'.
2018-11-10 07:08:35.110 Error: (MeteoAlarm) ----> Line 281 in '/usr/local/domoticz/var/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2018-11-10 07:08:35.110 Error: (MeteoAlarm) ----> Line 137 in '/usr/local/domoticz/var/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
Any idea?

misko903
Posts: 46
Joined: Thursday 27 September 2018 22:58
Target OS: Raspberry Pi
Domoticz version: Latest
Location: Trencin, Slovakia
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by misko903 » Saturday 10 November 2018 10:38

ycahome wrote:
Saturday 10 November 2018 0:33
Hello.

as I said, your problem is that feedparser is missing.

please post here the output of the following command

Code: Select all

 sudo apt list --installed|grep feed
output:

Code: Select all

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

python3-feedparser/stable,now 5.1.3-3 all [installed]
looks like installed. is it the righr version?

in directory /usr/local/lib/python3.5/ i have only dist-packages, no site-packages
is it right?

EDIT:
changed the plugin.py paths like that:

Code: Select all

sys.path
#sys.path.append('/usr/lib/python/dist-packages')
sys.path.append('/usr/lib/python3/dist-packages')

import feedparser
#sys.path.append('/usr/local/lib/python3.5/site-packages')
sys.path.append('/home/pi/.local/lib/python3.5/site-packages')
after that, 2 devices were created, but
syslog wrote this:

Code: Select all

2018-11-10 11:24:17.179 Status: (MeteoAlarm) Entering work loop.
2018-11-10 11:24:17.179 Status: (MeteoAlarm) Initialized version 1.0.2, author 'ycahome'
2018-11-10 11:24:17.265 Status: dzVents: Error (2.4.7): Discarding device. No last update info found: {["id"]=101, ["signalLevel"]=0, ["baseType"]="device", ["switchTypeValue"]=0, ["data"]={["_state"]="No Data", ["icon"]="Alert", ["_nValue"]=0, ["hardwareType"]="Meteo Alarm EU RSS Reader", ["protected"]=false, ["unit"]=1, ["hardwareTypeValue"]=94, ["hardwareName"]="MeteoAlarm", ["hardwareID"]=16}, ["changed"]=true, ["switchType"]="On/Off", ["lastLevel"]=255, ["rawData"]={"No Data"}, ["timedOut"]=true, ["description"]="", ["batteryLevel"]=0, ["deviceID"]="", ["subType"]="Alert", ["lastUpdate"]="", ["deviceType"]="General", ["name"]="MeteoAlarm - Today"}
2018-11-10 11:24:17.465 Status: dzVents: Error (2.4.7): Discarding device. No last update info found: {["id"]=102, ["signalLevel"]=0, ["baseType"]="device", ["switchTypeValue"]=0, ["data"]={["_state"]="No Data", ["icon"]="Alert", ["_nValue"]=0, ["hardwareType"]="Meteo Alarm EU RSS Reader", ["protected"]=false, ["unit"]=2, ["hardwareTypeValue"]=94, ["hardwareName"]="MeteoAlarm", ["hardwareID"]=16}, ["changed"]=true, ["switchType"]="On/Off", ["lastLevel"]=255, ["rawData"]={"No Data"}, ["timedOut"]=false, ["description"]="", ["batteryLevel"]=0, ["deviceID"]="", ["subType"]="Alert", ["lastUpdate"]="", ["deviceType"]="General", ["name"]="MeteoAlarm - Tomorrow"}
2018-11-10 11:24:25.061 (Xiaomi Gateway) Light/Switch (Obývačka Pohyb)
2018-11-10 11:24:27.181 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:24:27.182 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:24:27.184 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:24:27.463 (MeteoAlarm) Gathering Data for:Attiki
2018-11-10 11:24:27.463 (MeteoAlarm) Alarm(s) for Today: No special awareness required.
2018-11-10 11:24:27.464 (MeteoAlarm) Type Of Warning:-1
2018-11-10 11:24:27.464 (MeteoAlarm) Data:-tr>TODAY -/th>-/tr>-tr>-td width="28">-img alt="awt:3 level:1" border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l1-t3.jpg" />-/td>-/tr>-tr>-td width="28">-/td>-td>No special awareness required-/td>-/tr>-tr>-th align="left" colspan="3">-br />
2018-11-10 11:24:27.464 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2018-11-10 11:24:27.464 (MeteoAlarm) Awareness for Today Updated to:No special awareness required
2018-11-10 11:24:27.464 (MeteoAlarm - Today) Updating device from 0:'No Data' to have values 1:'No special awareness required'.
2018-11-10 11:24:27.470 (MeteoAlarm) Alarm(s) for Tomorrow: No special awareness required
2018-11-10 11:24:27.470 (MeteoAlarm) Type Of Warning:-1
2018-11-10 11:24:27.470 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2018-11-10 11:24:27.470 (MeteoAlarm) Awareness for Tomorrow Updated to:No special awareness required
2018-11-10 11:24:27.470 (MeteoAlarm - Tomorrow) Updating device from 0:'No Data' to have values 1:'No special awareness required'.
2018-11-10 11:24:37.183 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:24:37.211 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:24:37.211 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:24:44.030 Error: Python Plugins hardware (15) thread seems to have ended unexpectedly
2018-11-10 11:24:44.031 Error: Python Plugins hardware (18) thread seems to have ended unexpectedly
2018-11-10 11:24:47.185 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:24:47.230 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:24:47.230 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:24:57.187 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:24:57.199 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:24:57.199 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:25:00.515 Status: LUA: Domoticz alive !
2018-11-10 11:25:07.189 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:25:07.222 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:25:07.222 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:25:17.192 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:25:17.241 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:25:17.241 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:25:27.194 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:25:27.209 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:25:27.209 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:25:37.196 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:25:37.227 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:25:37.227 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:25:47.198 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:25:47.246 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:25:47.246 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:25:57.200 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:25:57.214 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:25:57.214 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:26:00.466 Status: LUA: Domoticz alive !
2018-11-10 11:26:07.202 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:26:07.241 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:26:07.241 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:26:17.204 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:26:17.209 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:26:17.209 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:26:24.767 (Xiaomi Gateway) Light/Switch (Obývačka Pohyb)
2018-11-10 11:26:27.206 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:26:27.227 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:26:27.227 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:26:37.207 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:26:37.246 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:26:37.246 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:26:47.209 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:26:47.214 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:26:47.215 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2018-11-10 11:26:57.211 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 11:26:57.233 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2018-11-10 11:26:57.233 (MeteoAlarm) Calling message handler 'onHeartbeat'.
looks like it works now, but every second calling is maybe too often?

User avatar
ycahome
Posts: 212
Joined: Sunday 12 February 2017 11:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by ycahome » Saturday 10 November 2018 19:04

Glad to hear that this plugin worked for your.

As forthe Log Messages, are you sure that you don't have "Debug=True"?

misko903
Posts: 46
Joined: Thursday 27 September 2018 22:58
Target OS: Raspberry Pi
Domoticz version: Latest
Location: Trencin, Slovakia
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by misko903 » Saturday 10 November 2018 20:39

ycahome wrote:
Saturday 10 November 2018 19:04
Glad to hear that this plugin worked for your.

As forthe Log Messages, are you sure that you don't have "Debug=True"?
You are right, it was turned on. Thanks for help and for the plugin :) Looking forward to first alert :P

User avatar
ycahome
Posts: 212
Joined: Sunday 12 February 2017 11:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by ycahome » Sunday 11 November 2018 1:39

Make sure that you have set your country's/city RSS Feed,otherwise it will report Athens's alerts.

User avatar
EdwinK
Posts: 1382
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by EdwinK » Sunday 11 November 2018 19:39

ycahome wrote:
Sunday 11 November 2018 1:39
Make sure that you have set your country's/city RSS Feed,otherwise it will report Athens's alerts.

Yes... Well... I forgot that, and I was wondering about the things it showed, later I realized you needed to add the right RSS in it :)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | RFxcom | Dashticz V2

misko903
Posts: 46
Joined: Thursday 27 September 2018 22:58
Target OS: Raspberry Pi
Domoticz version: Latest
Location: Trencin, Slovakia
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by misko903 » Tuesday 13 November 2018 10:57

note to myself:
Trencin, Slovakia:
http://www.meteoalarm.eu/documents/rss/sk/SK309.rss

misko903
Posts: 46
Joined: Thursday 27 September 2018 22:58
Target OS: Raspberry Pi
Domoticz version: Latest
Location: Trencin, Slovakia
Contact:

Re: Python Plugin: MeteoAlarmEU

Post by misko903 » Tuesday 13 November 2018 11:37

Idea for upgrade:
- show icons of warnings
- after click - display the meteoalarm webpage, for example: https://www.meteoalarm.eu/sl_SK/0/0/SK309.html

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests