From 53da565e9e217e87177cf6fc016b4c2ac88b1bd2 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Mon, 16 Sep 2019 05:24:24 +0000 Subject: [PATCH] httpmod.template: add missing model and room attributes git-svn-id: https://svn.fhem.de/fhem/trunk@20166 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/httpmod.template | 44 ++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/httpmod.template b/fhem/FHEM/lib/AttrTemplate/httpmod.template index e554bedf0..c36b0d8ec 100644 --- a/fhem/FHEM/lib/AttrTemplate/httpmod.template +++ b/fhem/FHEM/lib/AttrTemplate/httpmod.template @@ -21,6 +21,7 @@ desc: Forum linkDefine a HTTPMOD device like
defmod DEVICE HTTPMOD http://www.clever-tanken.de/tankstelle_details/29092 1800
Change station ID to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01Regex reading02Name reading02Regex reading03Name reading03Regex readingOExpr attr DEVICE enableControlSet 1 attr DEVICE reading01Name Diesel @@ -33,6 +34,7 @@ attr DEVICE readingOExpr $val =~ tr/,/./;;$val attr DEVICE stateFormat E5: SuperE5 € / E10: SuperE10 € / D: Diesel € attr DEVICE timeout 10 attr DEVICE verbose 2 +attr DEVICE room WHICHROOM attr DEVICE model A_01a_clever_tanken_single_station #defmod FileLogSpritE5 FileLog ./log/SpritE5-%Y.log TankeJetRueckmarsdorfer:SuperE5:.*|DEVICE:SuperE5:.* @@ -41,6 +43,7 @@ attr DEVICE model A_01a_clever_tanken_single_station name:A_01a_clever_tanken_multi_station filter:TYPE=HTTPMOD desc: Get prices for one product as environment search.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD https://www.clever-tanken.de/tankstelle_liste?spritsorte=3&r=10&ort=52152 1800
Change PLZ, radius and product to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE reading01Name Tankstellenname attr DEVICE reading01Regex
(.*)<\/div> attr DEVICE reading01RegOpt g @@ -55,7 +58,8 @@ attr DEVICE reading04Regex
(.*)<\/div> attr DEVICE reading04RegOpt g attr DEVICE reading05Name Entfernung attr DEVICE reading05Regex
(.*)<\/div> -attr DEVICE reading05RegOpt g +attr DEVICE reading05RegOpt g +attr DEVICE room WHICHROOM attr DEVICE model A_01a_clever_tanken_multi_station #German weather warnings from DWD, Forum: https://forum.fhem.de/index.php/topic,45176.msg905879.html#msg905879 @@ -63,17 +67,20 @@ name:A_02a_DWD_weather_warnings filter:TYPE=HTTPMOD desc: Get weather warnings from DWD.
Define a HTTPMOD device like
defmod Wetterwarner HTTPMOD https://www.dwd.de/DWD/warnungen/warnapp/json/warnings.json 0
Change region to your needs
Source: Forum par:REGIONCODE;Get region code from https://www.dwd.de/DE/leistungen/opendata/help/warnungen/cap_warncellids_csv.csv?__blob=publicationFile&v=3;{ undef } +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE enableControlSet 1 attr DEVICE extractAllJSON 1 attr DEVICE extractAllJSONFilter REGIONCODE attr DEVICE readingEncode UTF-8 attr DEVICE preProcessRegex s/warnWetter..............|\);;|\t|\n|\r//g +attr DEVICE room WHICHROOM attr DEVICE model A_02a_DWD_weather_warnings #German river water levels, Wiki: https://wiki.fhem.de/wiki/Flusspegel name:A_02d_pegelonline filter:TYPE=HTTPMOD desc: Get water level infor for german rivers from www.pegelonline.wsv.de.
Define a HTTPMOD device like
defmod Pegelstaende HTTPMOD https://www.pegelonline.wsv.de/webservices/rest-api/v2/stations/070b1eb4-3872-4e07-b2e5-e25fd9251b93/W/currentmeasurement.json 3600
Change station argument to your needs
Source: Wiki
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE enableControlSet 1 attr DEVICE extractAllJSON 1 attr DEVICE event-on-change-reading value,stateMnwMhw,stateNswHsw,timestamp,trend @@ -81,6 +88,7 @@ attr DEVICE event-on-update-reading value attr DEVICE sortby 1 attr DEVICE stateFormat {sprintf("%.0f",ReadingsVal("DEVICE","value",0))} attr DEVICE timeout 5 +attr DEVICE room WHICHROOM attr DEVICE model A_02d_pegelonline #Austrian weather, Forum: https://forum.fhem.de/index.php/topic,94110.msg868080.html#msg868080; enhanced by JoeALLb: https://forum.fhem.de/index.php/topic,97694.msg912164.html#msg912164 @@ -89,6 +97,7 @@ filter:TYPE=HTTPMOD desc: Get austrian weather.
Define a HTTPMOD device like
defmod weatherORF HTTPMOD none 1800
You will be asked to provide a MAINURL like https://wetter.orf.at/steiermark/ and a stationname like grazuniversitaet
Source: Enhanced version in FHEM Forum par:MAINURL;First part of the URL. Example: https://wetter.orf.at/steiermark/;{ AttrVal("DEVICE","get02URL","") =~ m,(https://wetter.orf.at/[^/]+[/]).*, ? $1 : undef } par:STATIONNAME;Name of the respective weather station as written in the last part of the URL. Examples: grazuniversitaet or innerestadt;{ AttrVal("DEVICE","get01URL","") =~ m,https://wetter.orf.at/[^/]+[/]([^/]+)[/], ? $1 : undef } +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr get01Name get01Poll:0,1 get01URL get02-1Name get02-2Name get02-3Name get02-4Name get02-5Name get02-6Name get02-7Name get02-8Name get02Name get02Poll:0,1 get02Regex get02URL reading01-1Name reading01-2Name reading01-3Name reading01-4Name reading01-5Name reading01Regex attr DEVICE enableControlSet 1 attr DEVICE get01Name Wetterdaten @@ -108,7 +117,7 @@ attr DEVICE get02Poll 1 attr DEVICE get02Regex Sonnenaufgang um <\/span>(.*)(.*)(\d\d:\d\d)(\d\d:\d\d)]+>(\d\d:\d\d)&[\w\W]*Morgen<\/span>: <\/span>(\d\d:\d\d)&[\w\W]*Abend:<\/span><\/span>(\d\d:\d\d) attr DEVICE get02URL MAINURL attr DEVICE reading01Regex (?s)Temperatur.*?.*?>.*?(?[\d,]+)&thinsp.*?Taupunkt.*?.*?>.*?(?[\d,]+)&thinsp.*?Wind.*?>\n\s*(?[^<]+)\s\n\s*(?[^<]+)\s\n\s*(?[^<]+)\s\n\s*(?[^<]+)\s\n\s*(?[^<]+)\s\n\s*(?[^<\n]+).*?Messwerte[^<\n]+) -attr DEVICE room Wetter +attr DEVICE room WHICHROOM attr DEVICE stateFormat W: wind, H: humidity%rH, T: temperature°C attr DEVICE model A_02m_ORF_weather @@ -116,12 +125,14 @@ attr DEVICE model A_02m_ORF_weather name:A_03a_blitzer filter:TYPE=HTTPMOD desc: Get austrian weather.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD https://cdn2.atudo.net/api/1.0/vl.php?type=0,1,2,3,4,5,6&box=52.xxxxxx,8.xxxxxx,53.xxxxxx,9.xxxxxx 0
Change city to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr getData getHeader1 getHeader2 getURL reading01DeleteIfUnmatched reading01JSON reading01Name reading01Regex reading02Name reading02RegOpt reading02Regex reading03JSON reading03Name readingEncode requestHeader1 requestHeader2 setParseResponse:0,1 attr DEVICE enableControlSet 1 attr DEVICE extractAllJSON 1 attr DEVICE getHeader1 Content-Type: application/json attr DEVICE getHeader2 Accept: */* attr DEVICE readingEncode utf8 +attr DEVICE room WHICHROOM attr DEVICE model A_03a_blitzer @@ -130,6 +141,7 @@ name:A_02c_homebridge_videodoorbell filter:TYPE=HTTPMOD desc: Controll your homebridge-videodoorbell.
Define a HTTPMOD device like
define Video_Doorbell HTTPMOD none 0
Source: Forum par:IP_PORT;Enter IP:Port as configured in your doorbell, like 123.456.7.8:5005;{undef } +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE get01Name klingel2homekitget attr DEVICE get01URL http://IP_PORT/ attr DEVICE get01Data ding=dong&dong=ding @@ -143,22 +155,27 @@ attr DEVICE set01Header02 User-Agent: curl/7.38.0 attr DEVICE set01Header04 Accept: */* attr DEVICE set01Header06 Content-Type: application/x-www-form-urlencoded attr DEVICE set01NoArg 1 +attr DEVICE room WHICHROOM attr DEVICE model A_02c_homebridge_videodoorbell # Pihole Statistics, Website: https://wolf-u.li/5987/einbindung-der-pihole-statistiken-in-fhem/ name:A_02e_pihole_statistics filter:TYPE=HTTPMOD desc: Get Statistics from your pihole instance.
Define a HTTPMOD device like
define DEVICE HTTPMOD http://192.168.133.7/admin/api.php 300
Change IP to your needs
Source: Website +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr getURL attr DEVICE extractAllJSON 1 attr DEVICE getURL http://dns/admin/api.php attr DEVICE stateFormat DNS Anfragen: dns_queries_today
Geblockte Seiten: ads_blocked_today (ads_blocked_today_formatted %) attr DEVICE userReadings ads_blocked_today_formatted {round(ReadingsNum($name,"ads_percentage_today",0),0)} +attr DEVICE room WHICHROOM +attr DEVICE model A_02e_pihole_statistics # Pharmacy Emergency Service Germany, Forum: https://forum.fhem.de/index.php?topic=87234.0 name:A_02f_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 http://apothekenfinder.mobi/interface/json.php?device=web&source=not&search=1337 0
Change the postalcode (1337 in this example) to yours
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.5.43/DevMgmt/ProductConfigDyn.xml 3600
Change IP to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict attr DEVICE httpVersion 1.1 attr DEVICE reading01Name Model @@ -219,12 +239,14 @@ attr DEVICE reading05Name Available_Memory attr DEVICE reading05XPath-Strict //dd:AvailableMemory/text() attr DEVICE stateFormat Modell: Model SN: Serial_Number attr DEVICE userReadings Memory_Usage {100-(ReadingsNum("DEVICE","Available_Memory","")/2.56)} +attr DEVICE room WHICHROOM attr DEVICE model B_01a_hp_printer_config # Printer cartridge states name:B_01a_hp_printer_cartridge_status filter:TYPE=HTTPMOD desc: Get cartridge states of your HP printer.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.5.43/DevMgmt/ConsumableConfigDyn.xml 3600
Change IP to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict reading06Name reading06XPath-Strict$ attr DEVICE httpVersion 1.1 attr DEVICE reading01Name Cyan @@ -244,12 +266,14 @@ attr DEVICE reading07XPath-Strict //ccdyn:ConsumableInfo[4]/dd:ConsumableSelecti attr DEVICE reading08Name BlackCatridgeModel attr DEVICE reading08XPath-Strict //ccdyn:ConsumableInfo[5]/dd:ConsumableSelectibilityNumber/text() attr DEVICE stateFormat C: Cyan% M: Magenta% Y: Yellow% B: Black% +attr DEVICE room WHICHROOM attr DEVICE model B_01a_hp_printer_cartridge_status # Printer statistics name:B_01a_hp_printer_statistics filter:TYPE=HTTPMOD desc: Gets various statistics from your HP printer.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.5.43/DevMgmt/ProductUsageDyn.xml 3600
Change IP to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict reading06Name reading06XPath-Strict reading07Name reading07XPath-Strict reading08Name reading08XPath-Strict reading09Name reading09XPath-Strict reading10Name reading10XPath-Strict reading11Name reading11XPath-Strict reading20Name reading20XPath-Strict reading30Name reading30XPath-Strict reading40Name reading40XPath-Strict reading41Name reading41XPath-Strict reading50Name reading50XPath-Strict reading51Name reading51XPath-Strict attr DEVICE httpVersion 1.1 attr DEVICE reading01Name Printer_Pages_Total @@ -291,17 +315,20 @@ attr DEVICE reading50XPath-Strict //pudyn:Consumable[dd:MarkerColor='Black']/dd: attr DEVICE reading51Name InkBlackPercentRemaining attr DEVICE reading51XPath-Strict //pudyn:Consumable[dd:MarkerColor='Black']/dd:ConsumableRawPercentageLevelRemaining/text() attr DEVICE stateFormat Total: Printer_Pages_Total Monochrome: Printer_Pages_Monochrome Color: Printer_Pages_Color +attr DEVICE room WHICHROOM attr DEVICE model B_01a_hp_printer_statistics # Printer status name:B_01a_hp_printer_status filter:TYPE=HTTPMOD desc: Get status of your hp printer.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.5.43/DevMgmt/ProductStatusDyn.xml 60
Change IP to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01XPath-Strict attr DEVICE httpVersion 1.1 attr DEVICE reading01Name Status attr DEVICE reading01XPath-Strict //psdyn:LocString[@lang='de']/text() attr DEVICE stateFormat Status +attr DEVICE room WHICHROOM attr DEVICE model B_01a_hp_printer_status @@ -314,6 +341,7 @@ attr DEVICE model B_01a_hp_printer_status name:B_01b_epson_printer_cartridge_status filter:TYPE=HTTPMOD desc: Get cartridge states of your Epson printer.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.188.25/PRESENTATION/HTML/TOP/PRTINFO.HTML 3600
Change IP to your needs
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE reading01Name Yellow attr DEVICE reading01Regex Ink_Y.*?='([\d]+)' attr DEVICE reading02Name Cyan @@ -323,6 +351,7 @@ attr DEVICE reading03Regex Ink_M.*?='([\d]+)' attr DEVICE reading04Name Black attr DEVICE reading04Regex Ink_B.*?='([\d]+)' attr DEVICE stateFormat C: Cyan% M: Magenta% Y: Yellow% B: Black% +attr DEVICE room WHICHROOM attr DEVICE model B_01b_epson_printer_cartridge_status ################################# @@ -334,6 +363,7 @@ attr DEVICE model B_01b_epson_printer_cartridge_status name:B_01c_brother_printer_cartridge_status filter:TYPE=HTTPMOD desc: Get cartridge states of your Brother printer.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.178.6/general/information.html 3600
Change IP to your needs
Source: Forum
Tested with MFC-9142CDN, should work with DCP-9015 CDW DCP-9020 HL-3140 CW HL-3150 CDN HL-3170 MFC-9130 MFC-9140 MFC-9330 MFC-9340 +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01Regex reading02Name reading02Regex reading03Name reading03Regex reading04Name reading04Regex attr DEVICE httpVersion 1.1 attr DEVICE reading01Name Yellow @@ -344,7 +374,7 @@ attr DEVICE reading03Name Magenta attr DEVICE reading03Regex \(M\)\*\*.{9}\((\d{1,3}\.\d{1,2})%\) attr DEVICE reading04Name Black attr DEVICE reading04Regex \(BK\)\*\*.{9}\((\d{1,3}\.\d{1,2})%\) -attr DEVICE room Steuerung->Unused_Devices +attr DEVICE room WHICHROOM attr DEVICE stateFormat C: Cyan% M: Magenta% Y: Yellow% B: Black% attr DEVICE reading05Name Status attr DEVICE reading05RegOpt gm @@ -358,6 +388,7 @@ attr DEVICE model B_01c_brother_printer_cartridge_status name:B_02a_brother_scanner_ads_status filter:TYPE=HTTPMOD desc: Get status of your Brother scanner.
Define a HTTPMOD device like
defmod DEVICE HTTPMOD http://192.168.133.7/ft/gen_maintenance 3600
Change IP to your needs
Source: Website.
Tested to work with ADS-1700W, possibly others. +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01XPath-Strict reading02Name reading02XPath-Strict reading03Name reading03XPath-Strict reading04Name reading04XPath-Strict reading05Name reading05XPath-Strict reading06Name reading06XPath-Strict reading07Name reading07XPath-Strict reading08Name reading08XPath reading08XPath-Strict reading09Name reading09XPath-Strict reading10Name reading10XPath-Strict reading11Name reading11XPath-Strict reading12Name reading12XPath-Strict attr DEVICE httpVersion 1.1 attr DEVICE reading01Name Model @@ -385,12 +416,15 @@ attr DEVICE reading11XPath-Strict //RollerReplace/text() attr DEVICE reading12Name PaperJams attr DEVICE reading12XPath-Strict //PaperJams/text() attr DEVICE stateFormat Pages: ScannedPagesTotal Modell: Model SN: Serial_Number +attr DEVICE room WHICHROOM +attr DEVICE model B_02a_brother_scanner_ads_status ################################# #RESOL Solaranlage, Forum: https://forum.fhem.de/index.php/topic,86678.0.html name:C_01a_resol_solar filter:TYPE=HTTPMOD desc: Get data from your RESOL solar installation
Define a HTTPMOD device like
define Solar HTTPMOD http://192.178.002.112/dl2/live/data 300
Source: Forum +par:WHICHROOM;Actual room of the device, defaults to HTTPMOD; {AttrVal("DEVICE","room","HTTPMOD" )} attr DEVICE userattr reading01Name reading01Regex reading02Name reading02Regex reading03Name reading03Regex reading04Name reading04Regex reading05Name reading05Regex reading06Name reading06Regex timeout attr DEVICE group A_Energy attr DEVICE reading01Name Temperatur_Sensor1 @@ -405,7 +439,7 @@ attr DEVICE reading05Name Drehzahl_Pumpe attr DEVICE reading05Regex Drehzahl Pumpe 1[^0-9]+([0-9\.]+) attr DEVICE reading06Name Betriebsstunden attr DEVICE reading06Regex Betriebsstunden Relais 1[^0-9]+([0-9\.]+) -attr DEVICE room 01 Heizungsraum +attr DEVICE room WHICHROOM attr DEVICE stateFormat Dachtemperatur: Temperatur_Sensor1 Drehzahl Pumpe: Drehzahl_Pumpe Laufzeit Heute: Tageslaufzeit attr DEVICE timeout 5ercent="([\d\.]+) attr DEVICE model C_01a_resol_solar @@ -415,7 +449,7 @@ attr DEVICE model C_01a_resol_solar name:X_01a_CUL_HM_firmware_update_downloader filter:TYPE=HTTPMOD desc: Check eQ3 homepage for available new firmware files; provides also links for direct downloads
Define a HTTPMOD device like
define eq3 HTTPMOD https://www.eq-3.de/ajax/downloads/downloads_eq3.php 604800
Source: Forum
Wiki -par:WHICHROOM;Room of the calling device; {AttrVal("DEVICE","room","CUL_HM" )} +par:WHICHROOM;Actual room of the device; {AttrVal("DEVICE","room","CUL_HM" )} defmod DEVICE HTTPMOD https://www.eq-3.de/ajax/downloads/downloads_eq3.php 604800 attr DEVICE userattr enableControlSet event-on-change-reading event-on-update-reading reading01AutoNumLen reading01Format reading01Name reading01RegOpt reading01RegOpt:s,i,g reading01Regex readingMaxAge readingMaxAgeReplacementMode readingMaxAgeReplacementMode:text,expression,delete readingMaxAgeReplacementMode:text,reading,internal,expression,delete requestData.* showError showMatched stateFormat userReadings webCmd attr DEVICE alignTime 00:45