Inhalt von globaler Variable per Broadcast an App senden

Post your questions and help other users.

Moderator: Martin

Post Reply
lomo
Posts: 2
Joined: 06 Jan 2016 09:37

Inhalt von globaler Variable per Broadcast an App senden

Post by lomo » 06 Jan 2016 09:51

Hi,

ich möchte den Wert einer globalen Variable aus Automatik an eine App per Broadcast weiterleiten. Ich krieg es aber leider nicht hin.

Die Variable heißt

global_zeiton

und soll gesendet werden an KWGT Kustos Widget.
Dort in der Hilfe steht folgendes. Ich habe mal Screenshots angefügt.
Kann mir bitte jemand sagen wie ich den diese Variable bzw ja eigentlich den Inhalt in KGWT bekomme?

Danke schon mal
Screenshot_2016-01-06-10-39-25(1)(1).jpg
Screenshot_2016-01-06-10-39-25(1)(1).jpg (131.24 KiB) Viewed 11774 times
Screenshot_2016-01-06-10-43-26(1).jpg
Screenshot_2016-01-06-10-43-26(1).jpg (131.52 KiB) Viewed 11774 times

lomo
Posts: 2
Joined: 06 Jan 2016 09:37

Re: Inhalt von globaler Variable per Broadcast an App senden

Post by lomo » 06 Jan 2016 16:57

keiner ne Idee wie ich den Broadcast von Automatik senden muss mit Hilfe der Anleitung?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Inhalt von globaler Variable per Broadcast an App senden

Post by Martin » 07 Jan 2016 20:06

Hi,

Folgende Anleitung habe ich mal jemandem für KLWP gegeben. Ich könnte mir vorstellen, dass es auch mit KGWT funktioniert, allerdings habe ich es nicht ausprobiert:
Flow:
-Action Script: testvariable="hallo welt"
-Action Plugin: KLWP Send Variable
1. Konfiguration drücken
2. bei Feld 'Tasker String' folgenden Wert eingeben: {testvariable}
3. bei Feld 'Kustom Variable' folgenden Wert eingeben: testvariable
4. Speichern
5. in der Plugin-Action in Automagic die Option 'Variablen ersetzen' aktivieren

In KLWP ein Textfeld einfügen und den Text auf $br(tasker, testvariable)$ ändern, speichern und den Flow ausführen. Das Textfeld im Wallpaper sollte nun 'Hallo Welt' anzeigen.
Freundliche Grüsse
Martin

simomies
Posts: 1
Joined: 14 Dec 2016 22:04

Re: Inhalt von globaler Variable per Broadcast an App senden

Post by simomies » 26 Dec 2016 09:24

Hi,

I came across this problem when creating a flow to get the next commute schedule nicely to my homescreen.
With the above instructions I was able to pass in hardcoded text, but (numeric) variables seemed not to pass properly.

Instead, this approach seems to work much better:

--AUTOMAGIC--

-Action Script: sendText = "Tubular!";
-Action Send Broadcast
1.) In the Action box, set the following:
org.kustom.action.SEND_VAR
2.) In the Extras box add the following lines:
putString("org.kustom.action.EXT_NAME", "MAGICDATA");
putString("org.kustom.action.VAR_NAME", "payload");
putString("org.kustom.action.VAR_VALUE", sendText);

--KLWP--

1.) In the element of your choosing, open up formula editor
2.) Set the following as formula:
$br(MAGICDATA, payload)$

With this config, the data passes in nicely from Automagic to KLWP.
So I added a button to my KLWP that kicks up the shortcut that starts the flow and now my next commute bus is only a button press away :)

Thanks for the great app ^^

-S

Post Reply