defmod WR_2_API HTTPMOD http://%IP-WR%/api/v1/auth/me 0
attr WR_2_API DbLogExclude .*
attr WR_2_API DbLogInclude Statistic_EnergyPv[1|2|3].*,Statistic_Yield.*
attr WR_2_API authRetries 1
attr WR_2_API comment Version 2021.04.27 16:00\
Passworte für die Abfrage des WR_2_API werden im storeKeyValue abgelegt:\
   {KeyValue("[read|store]","PW_<Device Name>_<Benutzer Name>","<passwort>")}\
   {KeyValue("store","PW_WR_2_API_user","<passwort>")}
attr WR_2_API disable 0
attr WR_2_API dontRequeueAfterAuth 0
attr WR_2_API enableControlSet 0
attr WR_2_API enableCookies 1
attr WR_2_API event-on-update-reading auth_.*,Statistic_EnergyPv[1|2|3].*,Statistic_Yield.*
attr WR_2_API get01Data %START%
attr WR_2_API get01Name 01_auth_start
attr WR_2_API get01URL http://%IP-WR%/api/v1/auth/start
attr WR_2_API get02Data %FINISH%
attr WR_2_API get02Name 02_auth_finish
attr WR_2_API get02URL http://%IP-WR%/api/v1/auth/finish
attr WR_2_API get03Data %SESSION%
attr WR_2_API get03Name 03_auth_create_session
attr WR_2_API get03URL http://%IP-WR%/api/v1/auth/create_session
attr WR_2_API get04-1Name auth_me_active
attr WR_2_API get04-2Name auth_me_locked
attr WR_2_API get04-3Name auth_me_authenticated
attr WR_2_API get04-4Name auth_me_anonymous
attr WR_2_API get04-5Name auth_me_role
attr WR_2_API get04-6Name auth_me_permissions
attr WR_2_API get04Header authorization: Session %auth_sessionId%
attr WR_2_API get04JSON .
attr WR_2_API get04Name 04_auth_me
attr WR_2_API get04URL http://%IP-WR%/api/v1/auth/me
attr WR_2_API get05-1Name info_api_version
attr WR_2_API get05-2Name info_hostname
attr WR_2_API get05-3Name info_name
attr WR_2_API get05-4Name info_sw_version
attr WR_2_API get05JSON .
attr WR_2_API get05Name 05_info_version
attr WR_2_API get05URL http://%IP-WR%/api/v1/info/version
attr WR_2_API get20-10Format %.2f
attr WR_2_API get20-10Name Statistic_EnergyChargeGrid_Month
attr WR_2_API get20-11Format %.2f
attr WR_2_API get20-11Name Statistic_EnergyChargeGrid_Total
attr WR_2_API get20-12Format %.2f
attr WR_2_API get20-12Name Statistic_EnergyChargeGrid_Year
attr WR_2_API get20-13Format %.2f
attr WR_2_API get20-13Name Statistic_EnergyChargeInvIn_Day
attr WR_2_API get20-14Format %.2f
attr WR_2_API get20-14Name Statistic_EnergyChargeInvIn_Month
attr WR_2_API get20-15Format %.2f
attr WR_2_API get20-15Name Statistic_EnergyChargeInvIn_Total
attr WR_2_API get20-16Format %.2f
attr WR_2_API get20-16Name Statistic_EnergyChargeInvIn_Year
attr WR_2_API get20-17Format %.2f
attr WR_2_API get20-17Name Statistic_EnergyChargePv_Day
attr WR_2_API get20-18Format %.2f
attr WR_2_API get20-18Name Statistic_EnergyChargePv_Month
attr WR_2_API get20-19Format %.2f
attr WR_2_API get20-19Name Statistic_EnergyChargePv_Total
attr WR_2_API get20-1Format %.2f
attr WR_2_API get20-1Name Statistic_Autarky_Day
attr WR_2_API get20-20Format %.2f
attr WR_2_API get20-20Name Statistic_EnergyChargePv_Year
attr WR_2_API get20-21Format %.2f
attr WR_2_API get20-21Name Statistic_EnergyDischarge_Day
attr WR_2_API get20-22Format %.2f
attr WR_2_API get20-22Name Statistic_EnergyDischarge_Month
attr WR_2_API get20-23Format %.2f
attr WR_2_API get20-23Name Statistic_EnergyDischarge_Total
attr WR_2_API get20-24Format %.2f
attr WR_2_API get20-24Name Statistic_EnergyDischarge_Year
attr WR_2_API get20-25Format %.2f
attr WR_2_API get20-25Name Statistic_EnergyDischargeGrid_Day
attr WR_2_API get20-26Format %.2f
attr WR_2_API get20-26Name Statistic_EnergyDischargeGrid_Month
attr WR_2_API get20-27Format %.2f
attr WR_2_API get20-27Name Statistic_EnergyDischargeGrid_Total
attr WR_2_API get20-28Format %.2f
attr WR_2_API get20-28Name Statistic_EnergyDischargeGrid_Year
attr WR_2_API get20-29Format %.2f
attr WR_2_API get20-29Name Statistic_EnergyHome_Day
attr WR_2_API get20-2Format %.2f
attr WR_2_API get20-2Name Statistic_Autarky_Month
attr WR_2_API get20-30Format %.2f
attr WR_2_API get20-30Name Statistic_EnergyHome_Month
attr WR_2_API get20-31Format %.2f
attr WR_2_API get20-31Name Statistic_EnergyHome_Total
attr WR_2_API get20-32Format %.2f
attr WR_2_API get20-32Name Statistic_EnergyHome_Year
attr WR_2_API get20-33Format %.2f
attr WR_2_API get20-33Name Statistic_EnergyHomeBat_Day
attr WR_2_API get20-34Format %.2f
attr WR_2_API get20-34Name Statistic_EnergyHomeBat_Month
attr WR_2_API get20-35Format %.2f
attr WR_2_API get20-35Name Statistic_EnergyHomeBat_Total
attr WR_2_API get20-36Format %.2f
attr WR_2_API get20-36Name Statistic_EnergyHomeBat_Year
attr WR_2_API get20-37Format %.2f
attr WR_2_API get20-37Name Statistic_EnergyHomeGrid_Day
attr WR_2_API get20-38Format %.2f
attr WR_2_API get20-38Name Statistic_EnergyHomeGrid_Month
attr WR_2_API get20-39Format %.2f
attr WR_2_API get20-39Name Statistic_EnergyHomeGrid_Total
attr WR_2_API get20-3Format %.2f
attr WR_2_API get20-3Name Statistic_Autarky_Total
attr WR_2_API get20-40Format %.2f
attr WR_2_API get20-40Name Statistic_EnergyHomeGrid_Year
attr WR_2_API get20-41Format %.2f
attr WR_2_API get20-41Name Statistic_EnergyHomeOwn_Total
attr WR_2_API get20-42Format %.2f
attr WR_2_API get20-42Name Statistic_EnergyHomePv_Day
attr WR_2_API get20-43Format %.2f
attr WR_2_API get20-43Name Statistic_EnergyHomePv_Month
attr WR_2_API get20-44Format %.2f
attr WR_2_API get20-44Name Statistic_EnergyHomePv_Total
attr WR_2_API get20-45Format %.2f
attr WR_2_API get20-45Name Statistic_EnergyHomePv_Year
attr WR_2_API get20-46Format %.2f
attr WR_2_API get20-46Name Statistic_EnergyPv1_Day
attr WR_2_API get20-47Format %.2f
attr WR_2_API get20-47Name Statistic_EnergyPv1_Month
attr WR_2_API get20-48Format %.2f
attr WR_2_API get20-48Name Statistic_EnergyPv1_Total
attr WR_2_API get20-49Format %.2f
attr WR_2_API get20-49Name Statistic_EnergyPv1_Year
attr WR_2_API get20-4Format %.2f
attr WR_2_API get20-4Name Statistic_Autarky_Year
attr WR_2_API get20-50Format %.2f
attr WR_2_API get20-50Name Statistic_EnergyPv2_Day
attr WR_2_API get20-51Format %.2f
attr WR_2_API get20-51Name Statistic_EnergyPv2_Month
attr WR_2_API get20-52Format %.2f
attr WR_2_API get20-52Name Statistic_EnergyPv2_Total
attr WR_2_API get20-53Format %.2f
attr WR_2_API get20-53Name Statistic_EnergyPv2_Year
attr WR_2_API get20-54Format %.2f
attr WR_2_API get20-54Name Statistic_EnergyPv3_Day
attr WR_2_API get20-55Format %.2f
attr WR_2_API get20-55Name Statistic_EnergyPv3_Month
attr WR_2_API get20-56Format %.2f
attr WR_2_API get20-56Name Statistic_EnergyPv3_Total
attr WR_2_API get20-57Format %.2f
attr WR_2_API get20-57Name Statistic_EnergyPv3_Year
attr WR_2_API get20-58Format %.2f
attr WR_2_API get20-58Name Statistic_OwnConsumptionRate_Day
attr WR_2_API get20-59Format %.2f
attr WR_2_API get20-59Name Statistic_OwnConsumptionRate_Month
attr WR_2_API get20-5Format %.2f
attr WR_2_API get20-5Name Statistic_CO2Saving_Day
attr WR_2_API get20-60Format %.2f
attr WR_2_API get20-60Name Statistic_OwnConsumptionRate_Total
attr WR_2_API get20-61Format %.2f
attr WR_2_API get20-61Name Statistic_OwnConsumptionRate_Year
attr WR_2_API get20-62Format %.2f
attr WR_2_API get20-62Name Statistic_Yield_Day
attr WR_2_API get20-63Format %.2f
attr WR_2_API get20-63Name Statistic_Yield_Month
attr WR_2_API get20-64Format %.2f
attr WR_2_API get20-64Name Statistic_Yield_Total
attr WR_2_API get20-65Format %.2f
attr WR_2_API get20-65Name Statistic_Yield_Year
attr WR_2_API get20-6Format %.2f
attr WR_2_API get20-6Name Statistic_CO2Saving_Month
attr WR_2_API get20-7Format %.2f
attr WR_2_API get20-7Name Statistic_CO2Saving_Total
attr WR_2_API get20-8Format %.2f
attr WR_2_API get20-8Name Statistic_CO2Saving_Year
attr WR_2_API get20-9Format %.2f
attr WR_2_API get20-9Name Statistic_EnergyChargeGrid_Day
attr WR_2_API get20Header authorization: Session %auth_sessionId%
attr WR_2_API get20JSON 01_processdata_.._value
attr WR_2_API get20Name 20_Statistic_EnergyFlow
attr WR_2_API get20URL http://%IP-WR%/api/v1/processdata/scb:statistic:EnergyFlow
attr WR_2_API get40Header01 authorization: Session %auth_sessionId%
attr WR_2_API get40Header02 Content-type: application/json, Accept: application/json, Connection: keep-alive
attr WR_2_API get40Name 40_Generator_ShadowMgmt
attr WR_2_API get40URL http://%IP-WR%/api/v1/settings/devices:local/Generator:ShadowMgmt:Enable
attr WR_2_API get59Data {"end":"%end_date%","begin":"%begin_date%"}
attr WR_2_API get59Header01 authorization: Session %auth_sessionId%
attr WR_2_API get59Header02 Content-type: application/json, Accept: application/json, Connection: keep-alive
attr WR_2_API get59Name 59_logdata_download
attr WR_2_API get59URL http://%IP-WR%/api/v1/logdata/download
attr WR_2_API get60Header authorization: Session %auth_sessionId%
attr WR_2_API get60Name 60_update_status
attr WR_2_API get60URL http://%IP-WR%/api/v1/update/status
attr WR_2_API getHeader01 Accept-Encoding: gzip,deflate
attr WR_2_API getHeader02 Content-type:application/json, Accept:application/json, Connection:keep-alive
attr WR_2_API group PV Eigenverbrauch
attr WR_2_API icon sani_solar
attr WR_2_API reAuthRegex "authenticated":false|"processdata":\[\]|wrong credentials|Not authorized
attr WR_2_API reading0101JSON nonce
attr WR_2_API reading0101Name auth_nonce
attr WR_2_API reading0102JSON rounds
attr WR_2_API reading0102Name auth_rounds
attr WR_2_API reading0103JSON salt
attr WR_2_API reading0103Name auth_salt
attr WR_2_API reading0104JSON transactionId
attr WR_2_API reading0104Name auth_transactionId
attr WR_2_API reading0201JSON signature
attr WR_2_API reading0201Name auth_signature
attr WR_2_API reading0202JSON token
attr WR_2_API reading0202Name auth_token
attr WR_2_API reading0301JSON message
attr WR_2_API reading0301Name info_message
attr WR_2_API reading0302JSON error
attr WR_2_API reading0302Name info_error
attr WR_2_API reading03JSON sessionId
attr WR_2_API reading03Name auth_sessionId
attr WR_2_API reading40Name Generator_ShadowMgmt
attr WR_2_API reading40Regex Generator:ShadowMgmt.*value":"(\d+)
attr WR_2_API replacement01Mode text
attr WR_2_API replacement01Regex %IP-WR%
attr WR_2_API replacement01Value 192.168.178.19
attr WR_2_API replacement02Mode expression
attr WR_2_API replacement02Regex %START%
attr WR_2_API replacement02Value {my $NAME="WR_2_API";; plenticore_auth("start","user","$NAME")}
attr WR_2_API replacement04Mode expression
attr WR_2_API replacement04Regex %FINISH%
attr WR_2_API replacement04Value {my $NAME="WR_2_API";; plenticore_auth("finish","user","$NAME",ReadingsVal("$NAME","auth_randomString64","missed"),ReadingsVal("$NAME","auth_nonce","missed"),ReadingsVal("$NAME","auth_salt","missed"),ReadingsVal("$NAME","auth_rounds","missed"),ReadingsVal("$NAME","auth_transactionId","missed"))}
attr WR_2_API replacement05Mode expression
attr WR_2_API replacement05Regex %SESSION%
attr WR_2_API replacement05Value {my $NAME="WR_2_API";; plenticore_auth("session","user","$NAME",ReadingsVal("$NAME","auth_randomString64","missed"),ReadingsVal("$NAME","auth_nonce","missed"),ReadingsVal("$NAME","auth_salt","missed"),ReadingsVal("$NAME","auth_rounds","missed"),ReadingsVal("$NAME","auth_transactionId","missed"),ReadingsVal("$NAME","auth_token","missed"))}
attr WR_2_API replacement06Mode reading
attr WR_2_API replacement06Regex %auth_signature%
attr WR_2_API replacement06Value auth_signature
attr WR_2_API replacement07Mode reading
attr WR_2_API replacement07Regex %auth_sessionId%
attr WR_2_API replacement07Value auth_sessionId
attr WR_2_API replacement08Mode expression
attr WR_2_API replacement08Regex %begin_date%
attr WR_2_API replacement08Value {POSIX::strftime("%Y-%m-%d",localtime(time))}
attr WR_2_API replacement09Mode expression
attr WR_2_API replacement09Regex %end_date%
attr WR_2_API replacement09Value {POSIX::strftime("%Y-%m-%d",localtime(time))}
attr WR_2_API room Strom->Photovoltaik
attr WR_2_API set06Header01 authorization: Session %auth_sessionId%
attr WR_2_API set06Header02 Content-type:application/json, Accept:application/json, Connection:keep-alive
attr WR_2_API set06Method POST
attr WR_2_API set06Name 06_auth_logout
attr WR_2_API set06NoArg 1
attr WR_2_API set06URL http://%IP-WR%/api/v1/auth/logout
attr WR_2_API set4002Data [{"moduleid":"devices:local","settings":[{"id":"Generator:ShadowMgmt:Enable","value":"$val"}]}]
attr WR_2_API set4002FollowGet 40_Generator_ShadowMgmt
attr WR_2_API set4002Header01 authorization: Session %auth_sessionId%
attr WR_2_API set4002Header02 Content-type:application/json, Accept:application/json, Connection:keep-alive
attr WR_2_API set4002Hint slider,0,1,3
attr WR_2_API set4002Method PUT
attr WR_2_API set4002Name 40_02_Generator_ShadowMgmt
attr WR_2_API set4002URL http://%IP-WR%/api/v1/settings
attr WR_2_API set4101Data [{"moduleid":"devices:local","settings":[{"id":"DigitalOutputs:Customer:ConfigurationFlags","value":"$val"},{"id":"DigitalOutputs:Customer:DelayTime","value":"5"},{"id":"DigitalOutputs:Customer:PowerMode:OnPowerThreshold","value":"100000"},{"id":"DigitalOutputs:Customer:TimeMode:MaxNoOfSwitchingCyclesPerDay","value":"24"},{"id":"DigitalOutputs:Customer:TimeMode:PowerThreshold","value":"1"},{"id":"DigitalOutputs:Customer:TimeMode:RunTime","value":"1440"},{"id":"DigitalOutputs:Customer:TimeMode:StableTime","value":"1"}]}]
attr WR_2_API set4101FollowGet 41_DigitalOutputs
attr WR_2_API set4101Header01 authorization: Session %auth_sessionId%
attr WR_2_API set4101Header02 Content-type:application/json, Accept:application/json, Connection:keep-alive
attr WR_2_API set4101Hint 0,9,13,14
attr WR_2_API set4101Method PUT
attr WR_2_API set4101Name 41_01_DigitalOutputs
attr WR_2_API set4101URL http://%IP-WR%/api/v1/settings
attr WR_2_API set50-10Name Event_02_code
attr WR_2_API set50-11Name Event_02_description
attr WR_2_API set50-12Name Event_02_end_time
attr WR_2_API set50-13Name Event_02_group
attr WR_2_API set50-14Name Event_02_is_active
attr WR_2_API set50-15Name Event_02_long_description
attr WR_2_API set50-16Name Event_02_start_time
attr WR_2_API set50-17Name Event_03_category
attr WR_2_API set50-18Name Event_03_code
attr WR_2_API set50-19Name Event_03_description
attr WR_2_API set50-1Name Event_01_category
attr WR_2_API set50-20Name Event_03_end_time
attr WR_2_API set50-21Name Event_03_group
attr WR_2_API set50-22Name Event_03_is_active
attr WR_2_API set50-23Name Event_03_long_description
attr WR_2_API set50-24Name Event_03_start_time
attr WR_2_API set50-25Name Event_04_category
attr WR_2_API set50-26Name Event_04_code
attr WR_2_API set50-27Name Event_04_description
attr WR_2_API set50-28Name Event_04_end_time
attr WR_2_API set50-29Name Event_04_group
attr WR_2_API set50-2Name Event_01_code
attr WR_2_API set50-30Name Event_04_is_active
attr WR_2_API set50-31Name Event_04_long_description
attr WR_2_API set50-32Name Event_04_start_time
attr WR_2_API set50-33Name Event_05_category
attr WR_2_API set50-34Name Event_05_code
attr WR_2_API set50-35Name Event_05_description
attr WR_2_API set50-36Name Event_05_end_time
attr WR_2_API set50-37Name Event_05_group
attr WR_2_API set50-38Name Event_05_is_active
attr WR_2_API set50-39Name Event_05_long_description
attr WR_2_API set50-3Name Event_01_description
attr WR_2_API set50-40Name Event_05_start_time
attr WR_2_API set50-4Name Event_01_end_time
attr WR_2_API set50-5Name Event_01_group
attr WR_2_API set50-6Name Event_01_is_active
attr WR_2_API set50-7Name Event_01_long_description
attr WR_2_API set50-8Name Event_01_start_time
attr WR_2_API set50-9Name Event_02_category
attr WR_2_API set50Data {"max":5,"language":"$val"}
attr WR_2_API set50Header01 authorization: Session %auth_sessionId%
attr WR_2_API set50Header02 Content-type:application/json, Accept:application/json, Connection:keep-alive
attr WR_2_API set50Hint en-gb,de-de
attr WR_2_API set50JSON .
attr WR_2_API set50Name 50_events_latest_5
attr WR_2_API set50ParseResponse 1
attr WR_2_API set50TextArg 1
attr WR_2_API set50URL http://%IP-WR%/api/v1/events/latest
attr WR_2_API set6001Header01 authorization: Session %auth_sessionId%
attr WR_2_API set6001Header02 Content-type:application/json, Accept:application/json, Connection:keep-alive
attr WR_2_API set6001Method POST
attr WR_2_API set6001Name 60_01_Reset_Wechselrichter
attr WR_2_API set6001NoArg 1
attr WR_2_API set6001URL http://%IP-WR%/api/v1/system/reboot
attr WR_2_API showBody 1
attr WR_2_API showError 1
attr WR_2_API sid01Data %START%
attr WR_2_API sid01ParseResponse 1
attr WR_2_API sid01URL http://%IP-WR%/api/v1/auth/start
attr WR_2_API sid02Data %FINISH%
attr WR_2_API sid02ParseResponse 1
attr WR_2_API sid02URL http://%IP-WR%/api/v1/auth/finish
attr WR_2_API sid03Data %SESSION%
attr WR_2_API sid03ParseResponse 1
attr WR_2_API sid03URL http://%IP-WR%/api/v1/auth/create_session
attr WR_2_API sidHeader01 Accept-Encoding: gzip,deflate
attr WR_2_API sidHeader02 Content-type: application/json, Accept: application/json, Connection: keep-alive
attr WR_2_API sortby 212
attr WR_2_API timeout 7
attr WR_2_API verbose 0