From 3cef8c223739114361c80b5b8260297cfa4f8aca Mon Sep 17 00:00:00 2001
From: amenomade <>
Date: Wed, 2 Dec 2020 00:01:21 +0000
Subject: [PATCH] httpmod.template: minor changes in homematic, add aponet
pharmacy emergency
git-svn-id: https://svn.fhem.de/fhem/trunk@23273 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/FHEM/lib/AttrTemplate/httpmod.template | 43 +++++++++++++++------
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/fhem/FHEM/lib/AttrTemplate/httpmod.template b/fhem/FHEM/lib/AttrTemplate/httpmod.template
index 2f8be4440..6b5816b49 100644
--- a/fhem/FHEM/lib/AttrTemplate/httpmod.template
+++ b/fhem/FHEM/lib/AttrTemplate/httpmod.template
@@ -401,6 +401,29 @@ attr DEVICE room WHICHROOM
attr DEVICE model pharmacy_emergency_service_germany
setreading DEVICE attrTemplateVersion 20201129
+#Pharmacy emergency service Germany - aponet, Forum https://forum.fhem.de/index.php/topic,87234.0.html
+name:aponet_pharmacy_emergency_service_germany
+filter:TYPE=HTTPMOD
+desc: Gets the current emergency service of a pharmacy closeby your postal code
Define a HTTPMOD device like
define DEVICE HTTPMOD https://www.aponet.de/apotheke/notdienstsuche?tx_aponetpharmacy_search[action]=result&tx_aponetpharmacy_search[controller]=Search&tx_aponetpharmacy_search[search][plzort]=91320&tx_aponetpharmacy_search[search][date]=&tx_aponetpharmacy_search[search][street]=&tx_aponetpharmacy_search[search][radius]=15&tx_aponetpharmacy_search[search][lat]=&tx_aponetpharmacy_search[search][lng]=&type=1982 0
Change the postalcode (91320 in this example) and the radius (15 in this example) to yours
Source: Forum
+order:DIV02
+par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )}
+attr DEVICE reading01Name NotName
+attr DEVICE reading01Regex class="name">(.*?)<\/h4>
+attr DEVICE reading02Name NotdienstVon
+attr DEVICE reading02Regex Notdienst vom(.*?Uhr)
+attr DEVICE reading03Name NotdienstBis
+attr DEVICE reading03Regex Notdienst vom.*?Uhr bis(.*?Uhr)
+attr DEVICE reading04Name NotdienstTelefon
+attr DEVICE reading04Regex href="tel:(.*?)"
+attr DEVICE reading05Name NotdienstAdresse
+attr DEVICE reading05Regex (?s)strasse">([\sa-zA-Z0-9äöüÄÖÜß.;_-]+).*?plz">(\d+).*?ort">([\sa-zA-Z0-9äöüÄÖÜß.;_-]+)<
+attr DEVICE reading06Name DatumVon
+attr DEVICE reading06Regex Notdienst vom ([ 0-9.:;_-]+)
+attr DEVICE stateFormat NotName, NotdienstTelefon, NotdienstAdresse-1 in NotdienstAdresse-2 NotdienstAdresse-3
+attr DEVICE model aponet_pharmacy_emergency_service_germany
+setreading DEVICE attrTemplateVersion 20201202
+
+
#################################
#HP Printers
#
@@ -658,7 +681,6 @@ par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE",
par:INTERVAL;Actual interval for updating, defaults to one day (86400s); {InternalVal("DEVICE","Interval",86400)}
defmod DEVICE HTTPMOD https://update.homematic.com/firmware/api/firmware/search/\DEVICE INTERVAL
attr DEVICE userattr reading01AutoNumLen reading01Name reading01RegOpt reading01Regex reading02AutoNumLen reading02Name reading02RegOpt reading02Regex readingMaxAge readingMaxAgeReplacementMode:text,reading,internal,expression,delete showNewFWOnly:yes,no
-attr DEVICE userattr reading01AutoNumLen reading01Name reading01RegOpt reading01Regex reading02AutoNumLen reading02Name reading02RegOpt reading02Regex readingMaxAge readingMaxAgeReplacementMode:text,reading,internal,expression,delete showNewFWOnly:yes,no
attr DEVICE do_not_notify 1
attr DEVICE enableControlSet 1
attr DEVICE icon hm_ccu
@@ -672,7 +694,6 @@ attr DEVICE reading02RegOpt g
attr DEVICE reading02Regex (?si)"version":"(\d+[.]\d+[.]\d+)
attr DEVICE readingMaxAge 10
attr DEVICE readingMaxAgeReplacementMode delete
-attr DEVICE room WHICHROOM
attr DEVICE showError 1
attr DEVICE showMatched 1
attr DEVICE showNewFWOnly yes
@@ -680,7 +701,7 @@ attr DEVICE stateFormat { my $ret ="";;\
my $lastCheck = POSIX::strftime("%d.%m. %H:%M",localtime(time_str2num(ReadingsTimestamp($name,"MATCHED_READINGS","2000-01-01 00:00:00"))));;\
my $nextCheck = POSIX::strftime("%d.%m. %H:%M",localtime(time_str2num(InternalVal($name,"TRIGGERTIME_FMT","2000-01-01 00:00:00"))));;\
my $cellstyle = "padding:3pt;;border-bottom:1px dotted lightgray;;";;\
- $ret .= '