Page 4 of 7

Re: Python Plugin: MeteoAlarmEU

Posted: Sunday 24 November 2019 21:55
by ycahome
NvBgm wrote: Saturday 23 November 2019 18:28
tonbor wrote: Monday 12 August 2019 11:43 Only updates with a change, without a change the update date stays the same. No problem, solved. :mrgreen:
How did you solved this problem ?????
Please share it with us...

Sorry i did not understand.

Does the plugin only update when there is a change in conditions of the weather alarm ???
Hello,

the answer is yes. It will update only when something change in order notifications to be effective!!

Hope this helps!!

Re: Python Plugin: MeteoAlarmEU

Posted: Monday 02 December 2019 11:47
by ycahome
NvBgm wrote: Sunday 01 December 2019 20:31 I still get these error

2019-12-01 14:39:23.623 Error: MeteoAlarmEU hardware (10) thread seems to have ended unexpectedly
2019-12-01 14:39:37.629 Error: MeteoAlarmEU hardware (10) thread seems to have ended unexpectedly
2019-12-01 14:39:51.635 Error: MeteoAlarmEU hardware (10) thread seems to have ended unexpectedly
2019-12-01 14:40:07.492 Error: MeteoAlarmEU hardware (10) thread seems to have ended unexpectedly
2019-12-01 14:40:21.498 Error: MeteoAlarmEU hardware (10) thread seems to have ended unexpectedly
2019-12-01 14:40:35.503 Error: MeteoAlarmEU hardware (10) thread seems to have ended unexpectedly

Can someone give me some explanation about this error ???
-if you have modified the "Update every x minutes", revert it back to 60
-Data Timeout should be "Disabled"

Re: Python Plugin: MeteoAlarmEU

Posted: Wednesday 11 December 2019 16:47
by EdwinK
After a fresh install of Domoticz, I can't get this plugin to appear in the Hardware list. plugin.py is in the /domoticz/plugins/MeteoAlarmEU folder.

Maybe it was something with Python that made it work previously, but can't remember how.

FIXED

I reinstaled python3-dev and it worked.

Re: Python Plugin: MeteoAlarmEU

Posted: Wednesday 05 February 2020 16:29
by Vomera
Got error's with meteo alarm. There is a warning but doesnt appear in the devices. When i see the log i see the following:

Code: Select all

020-02-05 15:40:14.103 Status: (MeteoAlarm) Initialized version 1.0.2, author 'ycahome'
2020-02-05 15:40:24.157 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-05 15:40:24.174 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-05 15:40:24.174 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-05 15:40:24.503 (MeteoAlarm) Gathering Data for:Limburg
2020-02-05 15:40:24.503 (MeteoAlarm) ------FEEDPARSER OUTPUT for TODAY:------------------
2020-02-05 15:40:24.503 (MeteoAlarm) Icon:-tr>TODAY -/th>-/tr>-tr>-td width="28">-img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l2-t12.jpg" alt="awt:12 level:2">-/td>
2020-02-05 15:40:24.503 (MeteoAlarm) AWT Possitions Value 1:12
2020-02-05 15:40:24.503 (MeteoAlarm) Level Possitions Value 1:2>-/td>-td>-b>From: -/b>-i>05.02.2020 15:00 CET-/i>-b> Until: -/b>-i>06.02.2020 20:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Door de neerslag in de Ardennen en Noord-Frankrijk is de afvoer van de Maas verhoogd.
2020-02-05 15:40:24.503 (MeteoAlarm) Alarm(s) for today:Rain-Flood(2>-/td>-td>-b>From: -/b>-i>05.02.2020 15:00 CET-/i>-b> Until: -/b>-i>06.02.2020 20:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Door de neerslag in de Ardennen en Noord-Frankrijk is de afvoer van de Maas verhoogd.
2020-02-05 15:40:24.503 (MeteoAlarm) AWT:12
2020-02-05 15:40:24.503 (MeteoAlarm) Level:2
2020-02-05 15:40:24.503 (MeteoAlarm) Period:-b>From: -/b>-i>05.02.2020 15:00 CET-/i>-b> Until: -/b>-i>06.02.2020 20:59 CET-/i>-/tr>-tr>-td width="28">
2020-02-05 15:40:24.503 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2020-02-05 15:40:24.503 (MeteoAlarm) Awareness for Today Updated to:Rain-Flood(2>-/td>-td>-b>From: -/b>-i>05.02.2020 15:00 CET-/i>-b> Until: -/b>-i>06.02.2020 20:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Door de neerslag in de Ardennen en Noord-Frankrijk is de afvoer van de Maas verhoogd.
2020-02-05 15:40:24.503 Error: (MeteoAlarm) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: '2>-/td>-td>-b>From: -/b>-i>05.02.2020 15:00 CET-/i>-b> Until: -/b>-i>06.02.2020 20:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Door de neerslag in de Ardennen en Noord-Frankrijk is de '.
2020-02-05 15:40:24.503 Error: (MeteoAlarm) ----> Line 280 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-05 15:40:24.503 Error: (MeteoAlarm) ----> Line 189 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-05 15:40:34.159 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-05 15:40:34.176 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-05 15:40:34.176 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-05 15:40:44.161 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
Rss from the site:

Code: Select all


<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://meteoalarm.eu/documents/rss/nl/NL012.rss" rel="self" type="application/rss+xml"/>
		<title>Meteoalarm Netherlands, Limburg</title>
		<link>https://www.meteoalarm.eu/ne_NL/0/0/NL012.html</link>
		<description>Metoalarm actual warnings from Netherlands, Limburg</description>
		<ttl>10</ttl>
		<language>eng</language>
		<item>
			<title>Limburg</title>
			<link>https://www.meteoalarm.eu/ne_NL/0/0/NL012.html</link>
			<description><![CDATA[<table border="0" cellspacing="0" cellpadding="3"><tr><th colspan="3" align="left">Today</th></tr><tr><td width="28"><img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l2-t12.jpg" alt="awt:12 level:2"></td><td><b>From: </b><i>05.02.2020 15:00 CET</i><b> Until: </b><i>06.02.2020 20:59 CET</i></td></tr><tr><td width="28"></td><td>nederlands:  Door de neerslag in de Ardennen en Noord-Frankrijk is de afvoer van de Maas verhoogd.  
Meer informatie: https://www.rijkswaterstaat.nl/water/waterdata-en-waterberichtgeving/waterbericht/index.aspx 
english:  Increased discharge of the river Meuse due to precipitation in the  Ardennes region in Belgium and in northern France.  
More information: https://www.rijkswaterstaat.nl/water/waterdata-en-waterberichtgeving/waterbericht/index.aspx</td></tr><tr><th colspan="3" align="left"><br />Tomorrow</th></tr><tr><td width="28"><img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l2-t12.jpg" alt="awt:12 level:2"></td><td><b>From: </b><i>05.02.2020 15:00 CET</i><b> Until: </b><i>06.02.2020 20:59 CET</i></td></tr><tr><td width="28"></td><td>nederlands:  Door de neerslag in de Ardennen en Noord-Frankrijk is de afvoer van de Maas verhoogd.  
Meer informatie: https://www.rijkswaterstaat.nl/water/waterdata-en-waterberichtgeving/waterbericht/index.aspx 
english:  Increased discharge of the river Meuse due to precipitation in the  Ardennes region in Belgium and in northern France.  
More information: https://www.rijkswaterstaat.nl/water/waterdata-en-waterberichtgeving/waterbericht/index.aspx</td></tr></table>]]></description>
			<pubDate>Wed, 05 Feb 2020 15:10:56 +0100</pubDate>
			<guid isPermaLink="false">dd9871ef34acccce6df02e0a09cd7fb4</guid>
		</item>
	</channel>
</rss>


Version domoticz:

domoticz version 4.11426
python 3.6.9
link rss feed https://www.meteoalarm.eu/documents/rss/nl/NL012.rss

Re: Python Plugin: MeteoAlarmEU

Posted: Wednesday 05 February 2020 18:04
by EdwinK
I tried with the feed you posted above, and got the warning.
Screen Shot 2020-02-05 at 18.03.15.png
Screen Shot 2020-02-05 at 18.03.15.png (30.5 KiB) Viewed 2411 times

Re: Python Plugin: MeteoAlarmEU

Posted: Wednesday 05 February 2020 18:09
by ycahome
Vomera wrote: Wednesday 05 February 2020 16:29 Got error's with meteo alarm. There is a warning but doesnt appear in the devices. When i see the log i see the following:

EdwinK wrote: Wednesday 05 February 2020 18:04 I tried with the feed you posted above, and got the warning.
Screen Shot 2020-02-05 at 18.03.15.png

also tried myself with your link and was successful.
Make sure that you have fulfilled all prerequisites (python etc...)

Re: Python Plugin: MeteoAlarmEU

Posted: Wednesday 05 February 2020 18:15
by FireWizard
Hello EdwinK,

Your living too close to one of the rivers. :D

There is really a warning in 3 provinces for high water and for flooding's.

See the map

Screenshot_Meteo-Warning.png
Screenshot_Meteo-Warning.png (276.95 KiB) Viewed 2409 times

Regards

Re: Python Plugin: MeteoAlarmEU

Posted: Thursday 06 February 2020 0:32
by Vomera
I think it’s the feedparser going to check tomorrow! Tnx!

Re: Python Plugin: MeteoAlarmEU

Posted: Thursday 06 February 2020 10:06
by Vomera
Still dont getting it to work.

Python version

Code: Select all

pi@Domoticz:~$ python --version
Python 3.7.5
pi@Domoticz:~$

Feedparser version

Code: Select all

pi@Domoticz:~$ sudo apt list --installed|grep feed

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

python3-feedparser/bionic,bionic,now 5.2.1-1 all [installed]
pi@Domoticz:~$
Image

Code: Select all

"""
MeteoAlarmEU RSS Reader Plugin

Author: Ycahome, 2017

Version:    1.0.0: Initial Version
            1.0.1: Minor bug fixes
            1.0.2: Bug Correction
"""
"""


<plugin key="MeteoAlarmEU" name="Meteo Alarm EU RSS Reader" author="ycahome" version="1.0.2" wikilink="" externallink="http://www.domoticz.com/forum/viewtopic.php?f=65&t=19519">
    <params>
        <param field="Mode1" label="RSSFeed" width="400px" required="true" default="http://www.meteoalarm.eu/documents/rss/gr/GR011.rss"/>
        <param field="Mode3" label="Update every x minutes" width="200px" required="true" default="300"/>
        <param field="Mode4" label="Debug" width="75px">
            <options>
                <option label="True" value="Debug"/>
                <option label="False" value="Normal"  default="False" />
            </options>
        </param>
    </params>
</plugin>
"""




import Domoticz
import json
import urllib.request
import urllib.error

from os import path
import sys
sys.path
sys.path.append('/usr/lib/python3/dist-packages')

import feedparser

from math import radians, cos, sin, asin, sqrt
from datetime import datetime, timedelta


class BasePlugin:

    def __init__(self):
        self.debug = False
        self.error = False
        self.nextpoll = datetime.now()

        return

    def onStart(self):
        if Parameters["Mode4"] == 'Debug':
            self.debug = True
            Domoticz.Debugging(1)
            DumpConfigToLog()
        else:
            Domoticz.Debugging(0)

        Domoticz.Debug("onStart called")

        # check polling interval parameter
        try:
            temp = int(Parameters["Mode3"])
        except:
            Domoticz.Error("Invalid polling interval parameter")
        else:
            if temp < 5:
                temp = 5  # minimum polling interval
                Domoticz.Error("Specified polling interval too short: changed to 5 minutes")
            elif temp > 1440:
                temp = 1440  # maximum polling interval is 1 day
                Domoticz.Error("Specified polling interval too long: changed to 1440 minutes (1 day)")
            self.pollinterval = temp * 60
        Domoticz.Log("Using polling interval of {} seconds".format(str(self.pollinterval)))


        if Parameters["Mode4"] == 'Debug':
            self.debug = True
            Domoticz.Debugging(1)
            DumpConfigToLog()
        else:
            Domoticz.Debugging(0)


        # create the mandatory child devices if not yet exist
        if 1 not in Devices:
            Domoticz.Device(Name="Today", Unit=1, TypeName="Alert",Used=1).Create()
            Domoticz.Device(Name="Tomorrow", Unit=2, TypeName="Alert",Used=1).Create()
            Domoticz.Log("Devices created.")
        Devices[1].Update(0,"No Data")
        Devices[2].Update(0,"No Data")



    def onStop(self):
        Domoticz.Debug("onStop called")
        Domoticz.Debugging(0)


    def onCommand(self, Unit, Command, Level, Hue):
        Domoticz.Debug(
            "onCommand called for Unit " + str(Unit) + ": Parameter '" + str(Command) + "', Level: " + str(Level))

    def onHeartbeat(self):
        now = datetime.now()
        rss=""
        feed=""
        FeedValueFTd=""
        FeedValueFTm=""

        if now >= self.nextpoll:
          self.nextpoll = now + timedelta(seconds=self.pollinterval)
          rss=Parameters["Mode1"]
          feed = feedparser.parse(rss)
          for key in feed["entries"]: 
            FeedValue = str(key["description"])
            FeedValue = '<tr>TODAY ' + FeedValue.split('Today')[1]

            FeedValueFTd = FeedValue.split('Tomorrow')[0]
            FeedValueFTm = FeedValue.split('Tomorrow')[1]
            Domoticz.Log("Gathering Data for:"+str(key["title"]))

            if not (FeedValueFTd.strip().find('wflag-l1')==-1):
              Domoticz.Debug("Alarm(s) for Today: No special awareness required.")
              #Domoticz.Log("Data Of Warning:"+str(FeedValueFTd.strip()))
              Domoticz.Debug("Type Of Warning:"+str(FeedValueFTd.find('wflag-l1-t5.jpg')))
              Domoticz.Debug("Data:"+str(FeedValueFTd).replace('<','-'))
              ValueToUpdate="No special awareness required"
              #Devices[1].Update(1,ValueToUpdate, Image=Images[icon].ID)

              Domoticz.Debug("Current Awareness Status:" +  Devices[1].sValue + " with Level " + str(Devices[1].nValue))
              if (ValueToUpdate != Devices[1].sValue):
                Domoticz.Log("Awareness for Today Updated to:" + ValueToUpdate)
                Devices[1].Update(1,ValueToUpdate)
              else:
                Domoticz.Log("Awareness Remains Unchanged for Today.")
            else:
              Domoticz.Debug("------FEEDPARSER OUTPUT for TODAY:------------------")
              #Domoticz.Log("Type Of Warning:"+str(FeedValueFTd.find('wflag-l1-t5.jpg')))
              #Domoticz.Log("Data:"+str(FeedValueFTd).replace('<br>','').replace('</br>','').replace('<td>','').replace('</td>','').replace('<tr>','').replace('</tr>','').replace('<b>','').replace('</b>','').replace('<i>','').replace('</i>','').replace('<',''))
              FeedValueFTdPeriod = FeedValueFTd.split('<td>')[0]
              FeedValueFTdPeriod = FeedValueFTdPeriod.split('alt="')[1]
              FeedValueFTdPeriod = FeedValueFTdPeriod.split(':')

              Domoticz.Debug("Icon:"+FeedValueFTd.split('<td>')[0].replace('<','-'))
              AWTPossitions = FeedValueFTd.replace('<','-').split('awt:')
              #if AWTPossitions[2]: Domoticz.Log("AWT Possitions 2:"+AWTPossitions[2])
              WarningText = ""
              for AWTPos in range(1,len(AWTPossitions)):
                AWTvalue = ""
                LEVELvalue = ""
                AWTvalue = AWTPossitions[AWTPos].split('level')[0].strip()
                Domoticz.Debug("AWT Possitions Value "+str(AWTPos)+":"+AWTvalue)
                LEVELvalue = AWTPossitions[AWTPos].split('level:')[1].split('border')[0].replace('"','').strip()
                Domoticz.Debug("Level Possitions Value "+str(AWTPos)+":"+LEVELvalue)
				AWTtext =  AWTvalue
                if (AWTvalue == "1") : AWTtext = "Wind"
                if (AWTvalue == "2") : AWTtext = "Snow/Ice"
                if (AWTvalue == "3") : AWTtext = "ThunderStorm"
                if (AWTvalue == "4") : AWTtext = "Fog"
                if (AWTvalue == "5") : AWTtext = "High Temp"
                if (AWTvalue == "6") : AWTtext = "Low Temp"
                if (AWTvalue == "7") : AWTtext = "Coastal Event"
                if (AWTvalue == "8") : AWTtext = "Forestfire"
                if (AWTvalue == "9") : AWTtext = "Avalanches"
                if (AWTvalue == "10") : AWTtext = "Rain"
                if (AWTvalue == "11") : AWTtext = "Flood"
                if (AWTvalue == "12") : AWTtext = "Rain-Flood"
                if (AWTPos > 1): WarningText = WarningText + ", "
                WarningText = WarningText + AWTtext+"("+LEVELvalue+")"
                Domoticz.Debug("Alarm(s) for today:"+ str(WarningText))
              Domoticz.Debug("AWT:"+FeedValueFTdPeriod[1].split(' ')[0].replace('<','-').replace('>','-'))
              Domoticz.Debug("Level:"+FeedValueFTdPeriod[2].split('"')[0].strip().replace('<','-'))
              Domoticz.Debug("Period:"+FeedValueFTd.split('<td>')[1].strip().replace('<br>','').replace('</br>','').replace('<td>','').replace('</td>','').replace('<','-'))
              #Domoticz.Log("MessageLocal:"+FeedValueFTd.split('<td>')[2].split('.')[0].strip())
              #Domoticz.Log("MessageEn:"+FeedValueFTd.split('<td>')[2].split('.')[1].strip().replace('<','-'))
              #Domoticz.Log("MessageEn:"+FeedValueFTd.split('<td>')[2].split('.')[1].split('english:')[1].strip())
              #ValueToUpdate=FeedValueFTd.split('<td>')[2].split('.')[1].split('english:')[1].strip()
              if (LEVELvalue=="5"): LEVELvalue="1"

              Domoticz.Debug("Current Awareness Status:" +  Devices[1].sValue + " with Level " + str(Devices[1].nValue))
              if (WarningText != Devices[1].sValue) or (int(LEVELvalue) != Devices[1].nValue):
                Domoticz.Log("Awareness for Today Updated to:" + WarningText)
                Devices[1].Update(int(LEVELvalue),WarningText)
              else:
                Domoticz.Log("Awareness Remains Unchanged for Today.")

            if not (FeedValueFTm.strip().find('wflag-l1')==-1):
              Domoticz.Debug("Alarm(s) for Tomorrow: No special awareness required")
              #Domoticz.Log("Data Of Warning:"+str(FeedValueFTm.strip()))
              Domoticz.Debug("Type Of Warning:"+str(FeedValueFTm.find('wflag-l1-t5.jpg')))
              ValueToUpdate="No special awareness required"
              Domoticz.Debug("Current Awareness Status:" +  Devices[2].sValue + " with Level " + str(Devices[2].nValue))
              if (ValueToUpdate != Devices[2].sValue):
                Domoticz.Log("Awareness for Tomorrow Updated to:" + ValueToUpdate)
                Devices[2].Update(1,ValueToUpdate)
              else:
                Domoticz.Log("Awareness Remains Unchanged for Tomorrow.")
            else:
              #FeedValueFTm = FeedValueFTd.split('<tr>')
              Domoticz.Debug("------FEEDPARSER OUTPUT for TOMORROW:------------------")
              #Domoticz.Log("Type Of Warning:"+str(FeedValueFTm.find('awt:5')))
              FeedValueFTmPeriod = FeedValueFTm.split('<td>')[0]
              FeedValueFTmPeriod = FeedValueFTmPeriod.split('alt="')[1]
              FeedValueFTmPeriod = FeedValueFTmPeriod.split(':')

              Domoticz.Debug("Icon:"+FeedValueFTm.split('<td>')[0].replace('<','-'))
              AWTPossitions = FeedValueFTm.replace('<','-').split('awt:')
              #if AWTPossitions[2]: Domoticz.Log("AWT Possitions 2:"+AWTPossitions[2])
              WarningText = ""
              HLEVELvalue = 1
              for AWTPos in range(1,len(AWTPossitions)):
                AWTvalue = ""
                LEVELvalue = ""
                AWTvalue = AWTPossitions[AWTPos].split('level')[0].strip()
                Domoticz.Debug("AWT Possitions Value "+str(AWTPos)+":"+AWTvalue)
                LEVELvalue = AWTPossitions[AWTPos].split('level:')[1].split('border')[0].replace('"','').strip()
                Domoticz.Debug("Level Possitions Value "+str(AWTPos)+":"+LEVELvalue)
                AWTtext =  AWTvalue
                if (AWTvalue == "1") : AWTtext = "Wind"
                if (AWTvalue == "2") : AWTtext = "Snow/Ice"
                if (AWTvalue == "3") : AWTtext = "ThunderStorm"
                if (AWTvalue == "4") : AWTtext = "Fog"
                if (AWTvalue == "5") : AWTtext = "High Temp"
                if (AWTvalue == "6") : AWTtext = "Low Temp"
                if (AWTvalue == "7") : AWTtext = "Coastal Event"
                if (AWTvalue == "8") : AWTtext = "Forestfire"
                if (AWTvalue == "9") : AWTtext = "Avalanches"
                if (AWTvalue == "10") : AWTtext = "Rain"
                if (AWTvalue == "11") : AWTtext = "Flood"
                if (AWTvalue == "12") : AWTtext = "Rain-Flood"
                WarningText = WarningText + AWTtext+"("+LEVELvalue+")"
                if (AWTPos > 1): WarningText = WarningText + ", "
                Domoticz.Debug("Alarm(s) for Tomorrow:"+ str(WarningText))
                if (int(LEVELvalue) > HLEVELvalue): HLEVELvalue = int(LEVELvalue)

              Domoticz.Debug("Icon:"+FeedValueFTm.split('<td>')[0].replace('<','-'))
              Domoticz.Debug("AWT:"+FeedValueFTmPeriod[1].split(' ')[0].strip().replace('<','-'))
              Domoticz.Debug("Level:"+FeedValueFTmPeriod[2].split('"')[0].strip().replace('<','-'))
              #Domoticz.Log("Period:"+FeedValueFTm.split('<td>')[1].strip().replace('<','-'))
              #Domoticz.Log("MessageLocal:"+FeedValueFTm.split('<td>')[2].split('.')[0].strip().replace('<','-'))
              #Domoticz.Log("MessageEn:"+FeedValueFTm.split('<td>')[2].split('.')[1].split('english:')[1].strip().replace('<','-'))
              #Domoticz.Log(FeedValueFTm)
              #ValueToUpdate=FeedValueFTm.split('<td>')[2].split('.')[1].split('english:')[1].strip().replace('<','-')
              if (HLEVELvalue==5): HLEVELvalue=0

              Domoticz.Debug("Current Awareness Status:" +  Devices[2].sValue + " with Level " + str(Devices[2].nValue))
              if (WarningText != Devices[2].sValue) or (int(HLEVELvalue) != Devices[2].nValue):
                Domoticz.Log("Awareness for Tomorrow Updated to:" + WarningText)
                Devices[2].Update(HLEVELvalue,WarningText)
              else:
                Domoticz.Log("Awareness Remains Unchanged for Tomorrow.")

              Domoticz.Debug("----------------------------------------------------")



global _plugin
_plugin = BasePlugin()

def onStart():
    global _plugin
    _plugin.onStart()

def onStop():
    global _plugin
    _plugin.onStop()

def onCommand(Unit, Command, Level, Hue):
    global _plugin
    _plugin.onCommand(Unit, Command, Level, Hue)

def onHeartbeat():
    global _plugin
    _plugin.onHeartbeat()

#############################################################################
#                   Device specific functions                     #
#############################################################################


# Generic helper functions


def DumpConfigToLog():
    for x in Parameters:
      if Parameters[x] != "":
          Domoticz.Debug( "'" + x + "':'" + str(Parameters[x]) + "'")
    Domoticz.Debug("Device count: " + str(len(Devices)))
    for x in Devices:
      Domoticz.Debug("Device:           " + str(x) + " - " + str(Devices[x]))
      Domoticz.Debug("Device ID:       '" + str(Devices[x].ID) + "'")
      Domoticz.Debug("Device Name:     '" + Devices[x].Name + "'")
      Domoticz.Debug("Device nValue:    " + str(Devices[x].nValue))
      Domoticz.Debug("Device sValue:   '" + Devices[x].sValue + "'")
      Domoticz.Debug("Device LastLevel: " + str(Devices[x].LastLevel))
    return

#
# Parse an int and return None if no int is given
#

def parseIntValue(s):

        try:
            return int(s)
        except:
            return None

#
# Parse a float and return None if no float is given
#

def parseFloatValue(s):

        try:
            return float(s)
        except:
            return None



Image


Tried also different things here in the forum....

Tried also another rss link from iceland
https://www.meteoalarm.eu/documents/rss/is/IS010.rss


Tried also with another link:
Domoticz log

Code: Select all

2020-02-06 11:28:05.391 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-06 11:28:05.391 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-06 11:28:05.557 (MeteoAlarm) Gathering Data for:Šiaulių apskritis
2020-02-06 11:28:05.557 (MeteoAlarm) ------FEEDPARSER OUTPUT for TODAY:------------------
2020-02-06 11:28:05.557 (MeteoAlarm) Icon:-tr>TODAY -/th>-/tr>-tr>-td width="28">-img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l2-t2.jpg" alt="awt:2 level:2">-/td>
2020-02-06 11:28:05.557 (MeteoAlarm) AWT Possitions Value 1:2
2020-02-06 11:28:05.557 (MeteoAlarm) Level Possitions Value 1:2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis
2020-02-06 11:28:05.557 (MeteoAlarm) Alarm(s) for today:Snow/Ice(2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis
2020-02-06 11:28:05.557 (MeteoAlarm) AWT:2
2020-02-06 11:28:05.557 (MeteoAlarm) Level:2
2020-02-06 11:28:05.557 (MeteoAlarm) Period:-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/tr>-tr>-td width="28">
2020-02-06 11:28:05.557 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2020-02-06 11:28:05.557 (MeteoAlarm) Awareness for Today Updated to:Snow/Ice(2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis
2020-02-06 11:28:05.557 Error: (MeteoAlarm) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: '2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis \nenglish: In the evening icy roads.-/td>'.
2020-02-06 11:28:05.557 Error: (MeteoAlarm) ----> Line 280 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-06 11:28:05.557 Error: (MeteoAlarm) ----> Line 189 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-06 11:28:15.353 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-06 11:28:15.377 (MeteoAlarm) Processing 'onHeartbeatCallback' message
https://www.meteoalarm.eu/documents/rss/lt/LT006.rss
XML Code

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://meteoalarm.eu/documents/rss/lt/LT006.rss" rel="self" type="application/rss+xml"/>
		<title>Meteoalarm Lithuania, Šiaulių apskritis</title>
		<link>https://www.meteoalarm.eu/li_LT/0/0/LT006.html</link>
		<description>Metoalarm actual warnings from Lithuania, Šiaulių apskritis</description>
		<ttl>10</ttl>
		<language>eng</language>
		<item>
			<title>Šiaulių apskritis</title>
			<link>https://www.meteoalarm.eu/li_LT/0/0/LT006.html</link>
			<description><![CDATA[<table border="0" cellspacing="0" cellpadding="3"><tr><th colspan="3" align="left">Today</th></tr><tr><td width="28"><img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l2-t2.jpg" alt="awt:2 level:2"></td><td><b>From: </b><i>06.02.2020 00:00 CET</i><b> Until: </b><i>06.02.2020 23:59 CET</i></td></tr><tr><td width="28"></td><td>lietuviu:  vakare plikledis 
english:  In the evening icy roads.</td></tr><tr><th colspan="3" align="left"><br />Tomorrow</th></tr><tr><td width="28"><img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l1-t6.jpg" alt="awt:6 level:1"></td></tr><tr><td width="28"></td><td>No special awareness required</td></tr></table>]]></description>
			<pubDate>Thu, 06 Feb 2020 06:01:42 +0100</pubDate>
			<guid isPermaLink="false">ea30203f7c6f4d9ace658182f986230a</guid>
		</item>
	</channel>
</rss>


Does someone know another way to solve this ?

Re: Python Plugin: MeteoAlarmEU

Posted: Thursday 06 February 2020 11:17
by ycahome
please enable debugging and post a full log filtered by "MeteoAlarm"

seems that you have an incompatibility with your versions (either python or feedparser)

Re: Python Plugin: MeteoAlarmEU

Posted: Thursday 06 February 2020 11:53
by Vomera
ycahome wrote: Thursday 06 February 2020 11:17 please enable debugging and post a full log filtered by "MeteoAlarm"

seems that you have an incompatibility with your versions (either python or feedparser)

Here the log, changes also my previous post with some extra info

Code: Select all

2020-02-06 11:52:36.792 Status: (MeteoAlarm) Started.
2020-02-06 11:52:37.861 (MeteoAlarm) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-02-06 11:52:37.861 (MeteoAlarm) 'HardwareID':'21'
2020-02-06 11:52:37.861 (MeteoAlarm) 'HomeFolder':'/home/pi/domoticz/plugins/MeteoAlarmEU/'
2020-02-06 11:52:37.861 (MeteoAlarm) 'StartupFolder':'/home/pi/domoticz/'
2020-02-06 11:52:37.861 (MeteoAlarm) 'UserDataFolder':'/home/pi/domoticz/'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Database':'/home/pi/domoticz/domoticz.db'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Language':'en'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Version':'1.0.2'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Author':'ycahome'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Name':'MeteoAlarm'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Port':'0'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Key':'MeteoAlarmEU'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Mode1':'https://www.meteoalarm.eu/documents/rss/lt/LT006.rss'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Mode3':'60'
2020-02-06 11:52:37.861 (MeteoAlarm) 'Mode4':'Debug'
2020-02-06 11:52:37.861 (MeteoAlarm) 'DomoticzVersion':'4.11426'
2020-02-06 11:52:37.861 (MeteoAlarm) 'DomoticzHash':'1016549ac'
2020-02-06 11:52:37.861 (MeteoAlarm) 'DomoticzBuildTime':'2019-10-29 07:46:25'
2020-02-06 11:52:37.861 (MeteoAlarm) Device count: 2
2020-02-06 11:52:37.861 (MeteoAlarm) Device: 1 - ID: 9953, Name: 'Vandaag', nValue: 0, sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device ID: '9953'
2020-02-06 11:52:37.862 (MeteoAlarm) Device Name: 'Vandaag'
2020-02-06 11:52:37.862 (MeteoAlarm) Device nValue: 0
2020-02-06 11:52:37.862 (MeteoAlarm) Device sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device LastLevel: 0
2020-02-06 11:52:37.862 (MeteoAlarm) Device: 2 - ID: 9954, Name: 'Morgen', nValue: 0, sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device ID: '9954'
2020-02-06 11:52:37.862 (MeteoAlarm) Device Name: 'Morgen'
2020-02-06 11:52:37.862 (MeteoAlarm) Device nValue: 0
2020-02-06 11:52:37.862 (MeteoAlarm) Device sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device LastLevel: 0
2020-02-06 11:52:37.862 (MeteoAlarm) onStart called
2020-02-06 11:52:37.862 (MeteoAlarm) Using polling interval of 3600 seconds
2020-02-06 11:52:37.862 (MeteoAlarm) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-02-06 11:52:37.862 (MeteoAlarm) 'HardwareID':'21'
2020-02-06 11:52:37.862 (MeteoAlarm) 'HomeFolder':'/home/pi/domoticz/plugins/MeteoAlarmEU/'
2020-02-06 11:52:37.862 (MeteoAlarm) 'StartupFolder':'/home/pi/domoticz/'
2020-02-06 11:52:37.862 (MeteoAlarm) 'UserDataFolder':'/home/pi/domoticz/'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Database':'/home/pi/domoticz/domoticz.db'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Language':'en'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Version':'1.0.2'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Author':'ycahome'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Name':'MeteoAlarm'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Port':'0'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Key':'MeteoAlarmEU'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Mode1':'https://www.meteoalarm.eu/documents/rss/lt/LT006.rss'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Mode3':'60'
2020-02-06 11:52:37.862 (MeteoAlarm) 'Mode4':'Debug'
2020-02-06 11:52:37.862 (MeteoAlarm) 'DomoticzVersion':'4.11426'
2020-02-06 11:52:37.862 (MeteoAlarm) 'DomoticzHash':'1016549ac'
2020-02-06 11:52:37.862 (MeteoAlarm) 'DomoticzBuildTime':'2019-10-29 07:46:25'
2020-02-06 11:52:37.862 (MeteoAlarm) Device count: 2
2020-02-06 11:52:37.862 (MeteoAlarm) Device: 1 - ID: 9953, Name: 'Vandaag', nValue: 0, sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device ID: '9953'
2020-02-06 11:52:37.862 (MeteoAlarm) Device Name: 'Vandaag'
2020-02-06 11:52:37.862 (MeteoAlarm) Device nValue: 0
2020-02-06 11:52:37.862 (MeteoAlarm) Device sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device LastLevel: 0
2020-02-06 11:52:37.862 (MeteoAlarm) Device: 2 - ID: 9954, Name: 'Morgen', nValue: 0, sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device ID: '9954'
2020-02-06 11:52:37.862 (MeteoAlarm) Device Name: 'Morgen'
2020-02-06 11:52:37.862 (MeteoAlarm) Device nValue: 0
2020-02-06 11:52:37.862 (MeteoAlarm) Device sValue: 'No Data'
2020-02-06 11:52:37.862 (MeteoAlarm) Device LastLevel: 0
2020-02-06 11:52:37.468 Status: (MeteoAlarm) Entering work loop.
2020-02-06 11:52:37.468 Status: (MeteoAlarm) Initialized version 1.0.2, author 'ycahome'
2020-02-06 11:52:47.470 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-06 11:52:47.492 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-06 11:52:47.492 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-06 11:52:47.653 (MeteoAlarm) Gathering Data for:Šiaulių apskritis
2020-02-06 11:52:47.653 (MeteoAlarm) ------FEEDPARSER OUTPUT for TODAY:------------------
2020-02-06 11:52:47.653 (MeteoAlarm) Icon:-tr>TODAY -/th>-/tr>-tr>-td width="28">-img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l2-t2.jpg" alt="awt:2 level:2">-/td>
2020-02-06 11:52:47.653 (MeteoAlarm) AWT Possitions Value 1:2
2020-02-06 11:52:47.653 (MeteoAlarm) Level Possitions Value 1:2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis
2020-02-06 11:52:47.653 (MeteoAlarm) Alarm(s) for today:Snow/Ice(2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis
2020-02-06 11:52:47.653 (MeteoAlarm) AWT:2
2020-02-06 11:52:47.653 (MeteoAlarm) Level:2
2020-02-06 11:52:47.653 (MeteoAlarm) Period:-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/tr>-tr>-td width="28">
2020-02-06 11:52:47.653 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2020-02-06 11:52:47.653 (MeteoAlarm) Awareness for Today Updated to:Snow/Ice(2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis
2020-02-06 11:52:47.653 Error: (MeteoAlarm) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: '2>-/td>-td>-b>From: -/b>-i>06.02.2020 00:00 CET-/i>-b> Until: -/b>-i>06.02.2020 23:59 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>lietuviu: vakare plikledis \nenglish: In the evening icy roads.-/td>'.
2020-02-06 11:52:47.653 Error: (MeteoAlarm) ----> Line 280 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-06 11:52:47.653 Error: (MeteoAlarm) ----> Line 189 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-06 11:52:57.472 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-06 11:52:57.521 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-06 11:52:57.521 (MeteoAlarm) Calling message handler 'onHeartbeat'.

Re: Python Plugin: MeteoAlarmEU

Posted: Saturday 08 February 2020 10:46
by ycahome
here are my test ubuntu server's details:

Code: Select all

domoticz-test:~$ python --version
Python 2.7.12
domoticz-test:~$ python3 --version
Python 3.5.2
domoticz-test:~$ sudo apt list --installed|grep feed

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

python3-feedparser/xenial,xenial,now 5.1.3-3build1 all [installed]


seems that you have default python at version 3.

am not quite sure what the problem relies at.

Re: Python Plugin: MeteoAlarmEU

Posted: Sunday 09 February 2020 13:58
by Vomera
Revert to another snapshot before i was trouble shooting the issue with meteoalarm, went back to to original python versions of ubuntu and installed the feedparser only. But still the same issue..


log domoticz:

Code: Select all

2020-02-09 13:55:56.601 Status: (MeteoAlarm) Initialized version 1.0.2, author 'ycahome'
2020-02-09 13:55:57.210 (MeteoAlarm) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-02-09 13:55:57.210 (MeteoAlarm) 'HardwareID':'21'
2020-02-09 13:55:57.210 (MeteoAlarm) 'HomeFolder':'/home/pi/domoticz/plugins/MeteoAlarmEU/'
2020-02-09 13:55:57.210 (MeteoAlarm) 'StartupFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.210 (MeteoAlarm) 'UserDataFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Database':'/home/pi/domoticz/domoticz.db'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Language':'en'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Version':'1.0.2'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Author':'ycahome'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Name':'MeteoAlarm'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Port':'0'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Key':'MeteoAlarmEU'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Mode1':'http://www.meteoalarm.eu/documents/rss/nl/NL012.rss'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Mode3':'60'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Mode4':'Debug'
2020-02-09 13:55:57.210 (MeteoAlarm) 'DomoticzVersion':'4.11426'
2020-02-09 13:55:57.210 (MeteoAlarm) 'DomoticzHash':'1016549ac'
2020-02-09 13:55:57.210 (MeteoAlarm) 'DomoticzBuildTime':'2019-10-29 07:46:25'
2020-02-09 13:55:57.210 (MeteoAlarm) Device count: 2
2020-02-09 13:55:57.210 (MeteoAlarm) Device: 1 - ID: 9953, Name: 'Vandaag', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.210 (MeteoAlarm) Device ID: '9953'
2020-02-09 13:55:57.210 (MeteoAlarm) Device Name: 'Vandaag'
2020-02-09 13:55:57.210 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.210 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.210 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:55:57.210 (MeteoAlarm) Device: 2 - ID: 9954, Name: 'Morgen', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.210 (MeteoAlarm) Device ID: '9954'
2020-02-09 13:55:57.210 (MeteoAlarm) Device Name: 'Morgen'
2020-02-09 13:55:57.210 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:55:57.211 (MeteoAlarm) onStart called
2020-02-09 13:55:57.211 (MeteoAlarm) Using polling interval of 3600 seconds
2020-02-09 13:55:57.211 (MeteoAlarm) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-02-09 13:55:57.211 (MeteoAlarm) 'HardwareID':'21'
2020-02-09 13:55:57.211 (MeteoAlarm) 'HomeFolder':'/home/pi/domoticz/plugins/MeteoAlarmEU/'
2020-02-09 13:55:57.211 (MeteoAlarm) 'StartupFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.211 (MeteoAlarm) 'UserDataFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Database':'/home/pi/domoticz/domoticz.db'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Language':'en'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Version':'1.0.2'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Author':'ycahome'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Name':'MeteoAlarm'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Port':'0'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Key':'MeteoAlarmEU'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Mode1':'http://www.meteoalarm.eu/documents/rss/nl/NL012.rss'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Mode3':'60'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Mode4':'Debug'
2020-02-09 13:55:57.211 (MeteoAlarm) 'DomoticzVersion':'4.11426'
2020-02-09 13:55:57.211 (MeteoAlarm) 'DomoticzHash':'1016549ac'
2020-02-09 13:55:57.211 (MeteoAlarm) 'DomoticzBuildTime':'2019-10-29 07:46:25'
2020-02-09 13:55:57.211 (MeteoAlarm) Device count: 2
2020-02-09 13:55:57.211 (MeteoAlarm) Device: 1 - ID: 9953, Name: 'Vandaag', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device ID: '9953'
2020-02-09 13:55:57.211 (MeteoAlarm) Device Name: 'Vandaag'
2020-02-09 13:55:57.211 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device: 2 - ID: 9954, Name: 'Morgen', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device ID: '9954'
2020-02-09 13:55:57.211 (MeteoAlarm) Device Name: 'Morgen'
2020-02-09 13:55:57.211 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:56:06.720 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-09 13:56:06.744 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-09 13:56:06.744 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-09 13:56:15.728 (MeteoAlarm) Gathering Data for:Limburg
2020-02-09 13:56:15.728 (MeteoAlarm) ------FEEDPARSER OUTPUT for TODAY:------------------
2020-02-09 13:56:15.728 (MeteoAlarm) Icon:-tr>TODAY -/th>-/tr>-tr>-td width="28">-img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l3-t1.jpg" alt="awt:1 level:3">-/td>
2020-02-09 13:56:15.728 (MeteoAlarm) AWT Possitions Value 1:1
2020-02-09 13:56:15.728 (MeteoAlarm) Level Possitions Value 1:3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer zware windstoten van 100-120 km/uur.
2020-02-09 13:56:15.728 (MeteoAlarm) Alarm(s) for today:Wind(3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer zware windstoten van 100-120 km/uur.
2020-02-09 13:56:15.728 (MeteoAlarm) AWT:1
2020-02-09 13:56:15.728 (MeteoAlarm) Level:3
2020-02-09 13:56:15.728 (MeteoAlarm) Period:-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/tr>-tr>-td width="28">
2020-02-09 13:56:15.728 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2020-02-09 13:56:15.728 (MeteoAlarm) Awareness for Today Updated to:Wind(3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer zware windstoten van 100-120 km/uur.
2020-02-09 13:56:15.728 Error: (MeteoAlarm) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: '3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer'.
2020-02-09 13:56:15.728 Error: (MeteoAlarm) ----> Line 280 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-09 13:56:15.728 Error: (MeteoAlarm) ----> Line 189 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-09 13:56:25.230 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-09 13:56:25.249 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-09 13:56:25.249 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-09 13:56:35.232 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-09 13:56:35.268 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-09 13:56:35.268 (MeteoAlarm) Calling message handler 'onHeartbeat'.

Feedparser

Code: Select all

pi@Domoticz:~$ sudo apt list --installed|grep feed
[sudo] password for pi:

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

python3-feedparser/bionic,bionic,now 5.2.1-1 all [installed]
pi@Domoticz:~$
Version python

Code: Select all

pi@Domoticz:~$ python --version
Python 2.7.15+
pi@Domoticz:~$ python3 --version
Python 3.6.8
pi@Domoticz:~$

Re: Python Plugin: MeteoAlarmEU

Posted: Sunday 09 February 2020 14:37
by Vomera
Vomera wrote: Sunday 09 February 2020 13:58 Revert to another snapshot before i was trouble shooting the issue with meteoalarm, went back to to original python versions of ubuntu and installed the feedparser only. But still the same issue..

edit: Okay i deleted the feedparser, and i got the same error. so it seems its not using the feedparser at all


log domoticz:

Code: Select all

2020-02-09 13:55:56.601 Status: (MeteoAlarm) Initialized version 1.0.2, author 'ycahome'
2020-02-09 13:55:57.210 (MeteoAlarm) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-02-09 13:55:57.210 (MeteoAlarm) 'HardwareID':'21'
2020-02-09 13:55:57.210 (MeteoAlarm) 'HomeFolder':'/home/pi/domoticz/plugins/MeteoAlarmEU/'
2020-02-09 13:55:57.210 (MeteoAlarm) 'StartupFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.210 (MeteoAlarm) 'UserDataFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Database':'/home/pi/domoticz/domoticz.db'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Language':'en'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Version':'1.0.2'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Author':'ycahome'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Name':'MeteoAlarm'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Port':'0'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Key':'MeteoAlarmEU'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Mode1':'http://www.meteoalarm.eu/documents/rss/nl/NL012.rss'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Mode3':'60'
2020-02-09 13:55:57.210 (MeteoAlarm) 'Mode4':'Debug'
2020-02-09 13:55:57.210 (MeteoAlarm) 'DomoticzVersion':'4.11426'
2020-02-09 13:55:57.210 (MeteoAlarm) 'DomoticzHash':'1016549ac'
2020-02-09 13:55:57.210 (MeteoAlarm) 'DomoticzBuildTime':'2019-10-29 07:46:25'
2020-02-09 13:55:57.210 (MeteoAlarm) Device count: 2
2020-02-09 13:55:57.210 (MeteoAlarm) Device: 1 - ID: 9953, Name: 'Vandaag', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.210 (MeteoAlarm) Device ID: '9953'
2020-02-09 13:55:57.210 (MeteoAlarm) Device Name: 'Vandaag'
2020-02-09 13:55:57.210 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.210 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.210 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:55:57.210 (MeteoAlarm) Device: 2 - ID: 9954, Name: 'Morgen', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.210 (MeteoAlarm) Device ID: '9954'
2020-02-09 13:55:57.210 (MeteoAlarm) Device Name: 'Morgen'
2020-02-09 13:55:57.210 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:55:57.211 (MeteoAlarm) onStart called
2020-02-09 13:55:57.211 (MeteoAlarm) Using polling interval of 3600 seconds
2020-02-09 13:55:57.211 (MeteoAlarm) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-02-09 13:55:57.211 (MeteoAlarm) 'HardwareID':'21'
2020-02-09 13:55:57.211 (MeteoAlarm) 'HomeFolder':'/home/pi/domoticz/plugins/MeteoAlarmEU/'
2020-02-09 13:55:57.211 (MeteoAlarm) 'StartupFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.211 (MeteoAlarm) 'UserDataFolder':'/home/pi/domoticz/'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Database':'/home/pi/domoticz/domoticz.db'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Language':'en'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Version':'1.0.2'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Author':'ycahome'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Name':'MeteoAlarm'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Port':'0'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Key':'MeteoAlarmEU'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Mode1':'http://www.meteoalarm.eu/documents/rss/nl/NL012.rss'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Mode3':'60'
2020-02-09 13:55:57.211 (MeteoAlarm) 'Mode4':'Debug'
2020-02-09 13:55:57.211 (MeteoAlarm) 'DomoticzVersion':'4.11426'
2020-02-09 13:55:57.211 (MeteoAlarm) 'DomoticzHash':'1016549ac'
2020-02-09 13:55:57.211 (MeteoAlarm) 'DomoticzBuildTime':'2019-10-29 07:46:25'
2020-02-09 13:55:57.211 (MeteoAlarm) Device count: 2
2020-02-09 13:55:57.211 (MeteoAlarm) Device: 1 - ID: 9953, Name: 'Vandaag', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device ID: '9953'
2020-02-09 13:55:57.211 (MeteoAlarm) Device Name: 'Vandaag'
2020-02-09 13:55:57.211 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device: 2 - ID: 9954, Name: 'Morgen', nValue: 0, sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device ID: '9954'
2020-02-09 13:55:57.211 (MeteoAlarm) Device Name: 'Morgen'
2020-02-09 13:55:57.211 (MeteoAlarm) Device nValue: 0
2020-02-09 13:55:57.211 (MeteoAlarm) Device sValue: 'No Data'
2020-02-09 13:55:57.211 (MeteoAlarm) Device LastLevel: 0
2020-02-09 13:56:06.720 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-09 13:56:06.744 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-09 13:56:06.744 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-09 13:56:15.728 (MeteoAlarm) Gathering Data for:Limburg
2020-02-09 13:56:15.728 (MeteoAlarm) ------FEEDPARSER OUTPUT for TODAY:------------------
2020-02-09 13:56:15.728 (MeteoAlarm) Icon:-tr>TODAY -/th>-/tr>-tr>-td width="28">-img border="1" src="https://www.meteoalarm.eu/documents/rss/wflag-l3-t1.jpg" alt="awt:1 level:3">-/td>
2020-02-09 13:56:15.728 (MeteoAlarm) AWT Possitions Value 1:1
2020-02-09 13:56:15.728 (MeteoAlarm) Level Possitions Value 1:3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer zware windstoten van 100-120 km/uur.
2020-02-09 13:56:15.728 (MeteoAlarm) Alarm(s) for today:Wind(3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer zware windstoten van 100-120 km/uur.
2020-02-09 13:56:15.728 (MeteoAlarm) AWT:1
2020-02-09 13:56:15.728 (MeteoAlarm) Level:3
2020-02-09 13:56:15.728 (MeteoAlarm) Period:-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/tr>-tr>-td width="28">
2020-02-09 13:56:15.728 (MeteoAlarm) Current Awareness Status:No Data with Level 0
2020-02-09 13:56:15.728 (MeteoAlarm) Awareness for Today Updated to:Wind(3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer zware windstoten van 100-120 km/uur.
2020-02-09 13:56:15.728 Error: (MeteoAlarm) 'onHeartbeat' failed 'ValueError':'invalid literal for int() with base 10: '3>-/td>-td>-b>From: -/b>-i>09.02.2020 21:00 CET-/i>-b> Until: -/b>-i>10.02.2020 01:00 CET-/i>-/td>-/tr>-tr>-td width=28>-/td>-td>nederlands: Vooral tijdens de passage van een actief buiengebied zeer'.
2020-02-09 13:56:15.728 Error: (MeteoAlarm) ----> Line 280 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-09 13:56:15.728 Error: (MeteoAlarm) ----> Line 189 in '/home/pi/domoticz/plugins/MeteoAlarmEU/plugin.py', function onHeartbeat
2020-02-09 13:56:25.230 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-09 13:56:25.249 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-09 13:56:25.249 (MeteoAlarm) Calling message handler 'onHeartbeat'.
2020-02-09 13:56:35.232 (MeteoAlarm) Pushing 'onHeartbeatCallback' on to queue
2020-02-09 13:56:35.268 (MeteoAlarm) Processing 'onHeartbeatCallback' message
2020-02-09 13:56:35.268 (MeteoAlarm) Calling message handler 'onHeartbeat'.

Feedparser

Code: Select all

pi@Domoticz:~$ sudo apt list --installed|grep feed
[sudo] password for pi:

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

python3-feedparser/bionic,bionic,now 5.2.1-1 all [installed]
pi@Domoticz:~$
Version python

Code: Select all

pi@Domoticz:~$ python --version
Python 2.7.15+
pi@Domoticz:~$ python3 --version
Python 3.6.8
pi@Domoticz:~$

Re: Python Plugin: MeteoAlarmEU

Posted: Sunday 09 February 2020 21:31
by ycahome
Maybe it IS the feedparser.

can you try with a prior version of feedparser? (5.1.3 maybe?)

Re: Python Plugin: MeteoAlarmEU

Posted: Sunday 09 February 2020 21:56
by Vomera
I did compile it also from 5.1.3, but still the same issue.. i was thinking it was the feedparser also, but no solution. i think i have no solution for it..

Re: Python Plugin: MeteoAlarmEU

Posted: Monday 10 February 2020 14:35
by Vomera
I read all the post of this sub, and i see the problem is on the feed.

The error is not there if there is no warning issued for that area.

If there is a warning for the area the feed is different and will go trought the script.

Maybe something changed in the feed that's not compiled in the last version 1.0.2.

So if the maker of the script can look into this script to see if there is a difference in the feed.

Re: Python Plugin: MeteoAlarmEU

Posted: Monday 10 February 2020 14:54
by ycahome
Hello,

if you have read all post, the you probable noticed that am the author. :lol: :lol: :lol:
Already responded that i did tested with success (with your rss and with warnings).

i will try to upgrade all components now to see

Re: Python Plugin: MeteoAlarmEU

Posted: Monday 10 February 2020 14:55
by Vomera
manutremo wrote: Monday 11 February 2019 22:09 I reported the same issue back in November. Apparently the plug-in uses certain assumptions on the format of the rss responses to extract the information. In certain circumstances, the rss feed seems to use a slightly different format which causes the plug-in to fail. After some time the feed users the first format again and the plug-in works.
This one is the case im talking about

Re: Python Plugin: MeteoAlarmEU

Posted: Monday 10 February 2020 14:58
by Vomera
ycahome wrote: Monday 10 February 2020 14:54 Hello,

if you have read all post, the you probable noticed that am the author. :lol: :lol: :lol:
Already responded that i did tested with success (with your rss and with warnings).

i will try to upgrade all components now to see
haha sorry you are right about it.. it's so frustrating if you cant find the error but i really wanted to work this (weather lover :P)

i was even thinking to make a new vmware with the OS. python and feedparser version, to check if that would be the solution, but thats too much work. I think more its something to read out the feed..