verbesserte Abfrage ob fhemServerIP vorhanden ist, wenn nicht wird gestoppt

This commit is contained in:
Marko Oldenburg
2016-04-07 22:13:54 +02:00
parent cde7e74285
commit 0365f365ce
2 changed files with 92 additions and 66 deletions

View File

@ -280,7 +280,7 @@ sub AMAD_statusRequest($) {
timeout => 30,
hash => $hash,
method => "GET",
header => "fhemIP: $fhemip\r\nfhemDevice: $name\r\nactiveTask: $activetask\r\napSSID: $apssid\r\nbport: $bport",
header => "fhemip: $fhemip\r\nfhemdevice: $name\r\nactivetask: $activetask\r\napssid: $apssid\r\nbport: $bport",
doTrigger => 1,
callback => \&AMAD_statusRequestErrorHandling,
}

View File

@ -462,6 +462,20 @@ irname=getString("name")</extras>
<name>Expression: global_activetask != "none"</name>
<expression>global_activetask != "none"</expression>
</condition>
<condition type="expression">
<useDefaultName>true</useDefaultName>
<name>Expression: global_bridgeport == null or global_fhemip == null or global_fhemdevice == null or global_activetask == null or global_apssid == null</name>
<expression> global_bridgeport == null
or global_fhemip == null
or global_fhemdevice == null
or global_activetask == null
or global_apssid == null</expression>
</condition>
<condition type="expression">
<useDefaultName>true</useDefaultName>
<name>Expression: global_fhemip != null</name>
<expression>global_fhemip != null</expression>
</condition>
<condition type="expression">
<useDefaultName>false</useDefaultName>
<name>Expression: installFlow"</name>
@ -1730,6 +1744,26 @@ FHEMCMD: setreading</customHTTPHeaders>
<script>if (global_bridgeport == null) {
global_bridgeport = "8090" }</script>
</action>
<action type="script">
<useDefaultName>false</useDefaultName>
<name>Prüfe und setze globale Variablen</name>
<script>if (header_bport == null) {
global_bridgeport = "8090"
} else {
global_bridgeport = {header_bport}
}
if (header_fhemip != null) {
global_fhemip = {header_fhemip} }
if (header_fhemdevice != null) {
global_fhemdevice = {header_fhemdevice} }
if (header_activetask != null) {
global_activetask = {header_activetask} }
if (header_apssid != null) {
global_apssid = {header_apssid} }
if(header_dport != null) {
global_deviceport = {header_dport} }</script>
</action>
<action type="http_request">
<useDefaultName>false</useDefaultName>
<name>Reading Music Metachanged.2</name>
@ -2143,15 +2177,6 @@ FHEMCMD: voiceinputvalue</customHTTPHeaders>
<includeFlowNamePatternList>{imported_flow_names,listformat,comma}</includeFlowNamePatternList>
<excludeFlowNamePatternList></excludeFlowNamePatternList>
</action>
<action type="script">
<useDefaultName>false</useDefaultName>
<name>Setze Globale Variablen</name>
<script>global_fhemip = {header_fhemip}
global_fhemdevice = {header_fhemdevice}
global_activetask = {header_activetask}
global_apssid = {header_apssid}
global_deviceport = {header_dport}</script>
</action>
<action type="set_lock_password">
<useDefaultName>true</useDefaultName>
<name>Setze Lock PIN/Passwort: PIN/Passwort zurücksetzen</name>
@ -2385,19 +2410,18 @@ FHEMCMD: setreading</customHTTPHeaders>
<actioncontainer id="t104" x="-105.0" y="-2432.5">Flow Status SetCommands</actioncontainer>
<actioncontainer id="t105" x="1330.0" y="437.5">Android Version</actioncontainer>
<actioncontainer id="t106" x="1260.0" y="192.5">Script: androidVersion = "not supported funktion"</actioncontainer>
<actioncontainer id="t107" x="735.0" y="17.5">Setze Globale Variablen</actioncontainer>
<actioncontainer id="t108" x="1330.0" y="-17.5">Get Android Version</actioncontainer>
<actioncontainer id="t109" x="2450.0" y="-3482.5">Script: notification_text = "not supported from your device"</actioncontainer>
<conditioncontainer id="t110" x="2310.0" y="-3027.5">Expression: getAndroidSDKVersion() &gt;= "19"</conditioncontainer>
<actioncontainer id="t111" x="875.0" y="17.5">Prüfe und setze Bridgeport Variable</actioncontainer>
<conditioncontainer id="t112" x="-1610.0" y="-2782.5">Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin"</conditioncontainer>
<actioncontainer id="t113" x="-1120.0" y="-3832.5">Airplainemode</actioncontainer>
<actioncontainer id="t114" x="-1050.0" y="-3517.5">Script: airpcount = airpcount + 1</actioncontainer>
<actioncontainer id="t115" x="-2100.0" y="-3832.5">Next Alarm State</actioncontainer>
<conditioncontainer id="t116" x="-2100.0" y="-2782.5">Expression: trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE"</conditioncontainer>
<actioncontainer id="t117" x="-2100.0" y="-3517.5">Script: if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT") { nextalarmstate = "alert" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS") { nextalarmstate = "dismiss" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE") { nextalarmstate = "done" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE") { nextalarmstate = "snooze" }</actioncontainer>
<conditioncontainer id="t118" x="1015.0" y="-1907.5">WLAN Verbunden: {global_apssid}</conditioncontainer>
<triggercontainer id="t119" x="1015.0" y="-1207.5">
<actioncontainer id="t107" x="1330.0" y="-17.5">Get Android Version</actioncontainer>
<actioncontainer id="t108" x="2450.0" y="-3482.5">Script: notification_text = "not supported from your device"</actioncontainer>
<conditioncontainer id="t109" x="2310.0" y="-3027.5">Expression: getAndroidSDKVersion() &gt;= "19"</conditioncontainer>
<conditioncontainer id="t110" x="-1610.0" y="-2782.5">Expression: trigger == "Display Status: Aus" or trigger == "Display Status: Ein" or udef_trigger == "setLockPin"</conditioncontainer>
<actioncontainer id="t111" x="-1120.0" y="-3832.5">Airplainemode</actioncontainer>
<actioncontainer id="t112" x="-1050.0" y="-3517.5">Script: airpcount = airpcount + 1</actioncontainer>
<conditioncontainer id="t113" x="-2100.0" y="-2782.5">Expression: trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE" or trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE"</conditioncontainer>
<actioncontainer id="t114" x="-2100.0" y="-3517.5">Script: if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_ALERT") { nextalarmstate = "alert" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DISMISS") { nextalarmstate = "dismiss" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE") { nextalarmstate = "done" } if(trigger == "Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE") { nextalarmstate = "snooze" }</actioncontainer>
<conditioncontainer id="t115" x="1015.0" y="-1907.5">WLAN Verbunden: {global_apssid}</conditioncontainer>
<actioncontainer id="t116" x="-2100.0" y="-3832.5">Next Alarm State</actioncontainer>
<actioncontainer id="t117" x="1015.0001" y="-1662.5">Script: amad_flowset_version = "2.0.0"</actioncontainer>
<triggercontainer id="t118" x="1015.0" y="-1347.5">
<trigger>Genereller Broadcast: wenn com.android.deskclock.ALARM_DONE</trigger>
<trigger>Stromversorgung: Angeschlossen</trigger>
<trigger>Genereller Broadcast: wenn org.smblott.intentradio.STATE</trigger>
@ -2433,7 +2457,9 @@ FHEMCMD: setreading</customHTTPHeaders>
<trigger>Genereller Broadcast: wenn com.android.deskclock.ALARM_SNOOZE</trigger>
<trigger>Benachrichtigung in Statusbar angezeigt: com.whatsapp</trigger>
</triggercontainer>
<actioncontainer id="t120" x="1015.0" y="-1522.5">Script: amad_flowset_version = "2.0.0"</actioncontainer>
<conditioncontainer id="t119" x="1015.0001" y="-1207.5">Expression: global_fhemip != null</conditioncontainer>
<conditioncontainer id="t120" x="910.0001" y="-122.50004">Expression: global_bridgeport == null or global_fhemip == null or global_fhemdevice == null or global_activetask == null or global_apssid == null</conditioncontainer>
<actioncontainer id="t121" x="910.0003" y="192.5">Prüfe und setze globale Variablen</actioncontainer>
<connection from="t1" to="t93" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t1" to="t93" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t2" to="t10" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
@ -2469,10 +2495,10 @@ FHEMCMD: setreading</customHTTPHeaders>
<connection from="t24" to="t95" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t25" to="t26" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t25" to="t29" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t26" to="t113" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t26" to="t111" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t27" to="t28" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t28" to="t25" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t29" to="t114" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t29" to="t112" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t30" to="t25" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t31" to="t53" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t32" to="t86" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
@ -2528,7 +2554,6 @@ FHEMCMD: setreading</customHTTPHeaders>
<connection from="t72" to="t34" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t73" to="t2" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t107" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t108" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t60" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t14" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t4" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
@ -2536,7 +2561,7 @@ FHEMCMD: setreading</customHTTPHeaders>
<connection from="t74" to="t9" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t67" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t36" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t110" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t109" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t1" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t70" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t73" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
@ -2546,7 +2571,7 @@ FHEMCMD: setreading</customHTTPHeaders>
<connection from="t74" to="t28" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t74" to="t51" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t75" to="t100" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t76" to="t110" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t76" to="t109" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t77" to="t97" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t78" to="t77" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t78" to="t97" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
@ -2559,42 +2584,43 @@ FHEMCMD: setreading</customHTTPHeaders>
<connection from="t83" to="t102" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t84" to="t79" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t106" to="t105" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t108" to="t106" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t108" to="t105" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t109" to="t97" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t110" to="t78" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t110" to="t109" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t110" to="t109" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t112" to="t51" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t114" to="t30" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t116" to="t117" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t117" to="t115" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t23" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t61" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t24" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t22" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t112" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t66" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t48" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t76" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t59" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t21" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t46" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t73" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t33" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t62" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t72" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t70" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t75" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t120" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t84" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t116" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t118" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t74" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t27" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t83" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t111" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t120" to="t103" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t107" to="t106" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t107" to="t105" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t108" to="t97" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t109" to="t78" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t109" to="t108" type="EXCEPTION" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t109" to="t108" type="FALSE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t110" to="t51" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t112" to="t30" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t113" to="t114" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t114" to="t116" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t23" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t61" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t24" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t22" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t110" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t66" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t48" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t76" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t59" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t21" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t46" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t73" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t33" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t62" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t72" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t70" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t75" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t117" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t84" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t115" to="t113" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t117" to="t103" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t27" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t119" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t118" to="t120" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t74" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t119" to="t115" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t120" to="t121" type="TRUE" sourcePosition="SOUTH" targetPosition="NORTH" />
</flow>
<flow type="flow">
<name>SetCommands</name>
@ -2848,7 +2874,7 @@ FHEMCMD: setreading</customHTTPHeaders>
<actioncontainer id="t3" x="70.0" y="577.5">Flows/Widgets importieren: /storage/emulated/0/Download/currentFlowsetUpdate.xml</actioncontainer>
<actioncontainer id="t4" x="70.0" y="997.5">Dateien löschen: /storage/emulated/0/Download/currentFlowsetUpdate.xml</actioncontainer>
<actioncontainer id="t5" x="70.0" y="367.5">Download URL: http://{global_fhemip}:{global_bridgeport}/currentFlowsetUpdate.xml to /storage/emulated/0/Download</actioncontainer>
<actioncontainer id="t6" x="70.0" y="157.49998">Prüfe und setze Bridgeport Variable</actioncontainer>
<actioncontainer id="t6" x="70.0" y="157.5">Prüfe und setze Bridgeport Variable</actioncontainer>
<connection from="t1" to="t6" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t2" to="t4" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />
<connection from="t3" to="t2" type="NORMAL" sourcePosition="SOUTH" targetPosition="NORTH" />