Maybe somebody can tell me what I'm doing wrong.
I have a task named Send Weather Request:
Tasker Action 1: Send Intent
Intent Action = mycodefab.aleph.weather.ACTION_GET_WEATHER
Data = geo:AUTO?ver=1&time=now
Target = Broadcast Receiver
Tasker Action 2: Send Intent
Intent Action = mycodefab.aleph.weather.WEATHER_DATA
Target = Broadcast Receiver
I have a profile named Weather Request Listener:
Context: Intent Received
Tasker Action: mycodefab.aleph.weather.WEATHER_DATA
Enter Task: Weather Request Handler
Here's the task called Weather Request Handler:
Tasker Action:
Flash: %weather_desc
What happens is that the text flash works but shows the variable name "%weather_desc" instead of the value of the variable.
Can anybody please point out why the variables aren't being set and/or help me figure out how to make it work?
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/72742660-8b4b-46aa-917e-73d47f25befe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
A task to send an intent, a profile to listen for a response and another task to handle the response data:
INTENT TRANSMITTER
------------------
Send Weather Request (10)
A1: Send Intent [ Action:mycodefab.aleph.weather.ACTION_GET_WEATHER Cat:None Mime Type: Data:geo:AUTO?ver=1&time=now Extra:request_tag Extra: Extra: Package: Class: Target:Broadcast Receiver ]
A2: Send Intent [ Action:mycodefab.aleph.weather.WEATHER_DATA Cat:None Mime Type: Data: Extra: Extra: Extra: Package: Class: Target:Broadcast Receiver ]
INTENT RESPONSE LISTENER
------------------------
Profile: Weather Request Listener (9)
Event: Intent Received [ Action:mycodefab.aleph.weather.WEATHER_DATA Cat:None Cat:None Scheme:* Mime Type:* ]
Enter: Weather Response Handler (27)
A1: [X] Flash [ Text:%weather_desc Long:Off ]
A2: JavaScriptlet [ Code:var nl = "\n";
var output =
`Request tag: ${
local("%request_tag") + nl
} Intent Data: ${
local("%intent_data") + nl
}`
;
evtprm.forEach(
function(item){
output += `${item + nl}`;
}
);
flashLong(output); Libraries: Auto Exit:On Timeout (Seconds):45 ]
INTENT RESPONSE HANDLER
Weather Response Handler (27)
A1: JavaScriptlet [ Code:var nl = "\n";
var output =
`Request tag: ${
local("%request_tag") + nl
} Intent Data: ${
local("%intent_data") + nl
}`
;
evtprm.forEach(
function(item){
output += `${item + nl}`;
}
);
flashLong(output); Libraries: Auto Exit:On Timeout (Seconds):45 ]
:( Still doesn't work ):
Weather: Send Request (10)
A1: [X] Send Intent [ Action:mycodefab.aleph.weather.ACTION_GET_WEATHER Cat:None Mime Type: Data:geo:AUTO?ver=1&time=now Extra: Extra: Extra: Package: Class: Target:Broadcast Receiver ]
A2: Send Intent [ Action:mycodefab.aleph.weather.WEATHER_DATA Cat:None Mime Type: Data: Extra: Extra: Extra: Package: Class: Target:Broadcast Receiver ]
Profile: Weather Request Listener 1 (9)
Event: Intent Received [ Action:mycodefab.aleph.weather.WEATHER_DATA Cat:None Cat:None Scheme:* Mime Type:* ]
Enter: Weather: Response Handler (27)
A1: JavaScriptlet [ Code:var nl = "\n";
var output = "";
output = `intent_data: ${
local("%intent_data") + nl
}`;
var forEachCount = 0;
evtprm.forEach(
function(item){
forEachCount++
output += `Event Param ${
forEachCount
}: ${
item + nl
}`;
}
);
output += `request_tag: ${
local("%request_tag") + nl
}`;
output += `error_desc: ${
local("%error_desc") + nl
}`;
output += `api_version: ${
local("%api_version") + nl
}`;
output += `place_name: ${
local("%place_name") + nl
}`;
output += `place_lon: ${
local("%place_lon") + nl
}`;
output += `place_lat: ${
local("%place_lat") + nl
}`;
output += `place_autofollow: ${
local("%place_autofollow") + nl
}`;
output += `is_day: ${
local("%is_day") + nl
}`;
output += `updated: ${
local("%updated") + nl
}`;
output += `weather_desc: ${
local("%weather_desc") + nl
}`;
output += `type: ${
local("%type") + nl
}`;
output += `current: ${
local("%current") + nl
}`;
output += `datetime: ${
local("%datetime") + nl
}`;
output += `temp_max: ${
local("%temp_max") + nl
}`;
output += `temp_min: ${
local("%temp_min") + nl
}`;
output += `pressure: ${
local("%pressure") + nl
}`;
output += `humidity: ${
local("%humidity") + nl
}`;
output += `windspeed: ${
local("%windspeed") + nl
}`;
output += `windspeed: ${
local("%windspeed") + nl
}`;
output += `windspeed_gusts: ${
local("%windspeed_gusts") + nl
}`;
output += `weather_id: ${
local("%weather_id") + nl
}`;
output += `dewpoint_max: ${
local("%dewpoint_max") + nl
}`;
output += `dewpoint_min: ${
local("%dewpoint_min") + nl
}`;
output += `sunrise: ${
local("%sunrise") + nl
}`;
output += `sunset: ${
local("%sunset") + nl
}`;
output += `wind_degree: ${
local("%wind_degree") + nl
}`;
output += `precipitation: ${
local("%precipitation") + nl
}`;
output += `pop: ${
local("%pop") + nl
}`;
output += `cloudiness: ${
local("%cloudiness") + nl
}`;
output += `uvi: ${
local("%uvi") + nl
}`;
output += `visibility: ${
local("%visibility") + nl
}`;
output += `feelslike_max: ${
local("%feelslike_max") + nl
}`;
output += `feelslike_min: ${
local("%feelslike_min") + nl
}`;
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/qEPL-XiK5So/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/fd4a65b4-8bd7-47f3-be5f-6787fe71effb%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/fd4a65b4-8bd7-47f3-be5f-6787fe71effb%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/qEPL-XiK5So/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAG6Z%2BFeJEZuFPXCNnh92qsVNsZdYzyVaH3ku721-nwVBW7RJ1w%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/qEPL-XiK5So/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAG6Z%2BFeJEZuFPXCNnh92qsVNsZdYzyVaH3ku721-nwVBW7RJ1w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAHVX9cck7XpPGhRXMqHwH5Aa3UQn-9MAJkOV5m2E3d%2B4fpFqaw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAG6Z%2BFf278HKDZhPunC2XQipqzMw6HQ0MkyEzL8iXBJ-ywOjWg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAHVX9cfhutGnYJo4OyQLWCP2%3DGz_yfhoMtBNKs7DcFGOQuWQCQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAG6Z%2BFdPoSfiZiD2RYS1%2BgvXnTSXVgB_PZH%3DUnxQi_TPiPUX6A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAHVX9cd%3DG1iH2JQn_%2Bq%3DxasEMUPqCA6N83ZjPfkvePvCG-Hd9Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAG6Z%2BFd5PPG6f4fQbJVnomAwxppFXh0NRnpFvjNHrRixKqRaiA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/CAHVX9cf9YzGkD_jtpJGspJ5YSfP7O1efvM4JuWuxJ80h65Sj-Q%40mail.gmail.com.
In addition, any extras attached to the intent can be accessed under their name, with the following modifications to make them valid variable names:
-----
So, printing intent_data and evtprmX - will not contain the info from extras. For to get variables from extras, you should use their names.
Just as an example (its someones else work, I dont use Tasker) that I quickly translated from Russian:
1) The part receive the data (all data, for any period - he made it simple as example). It just wait till Weather ACE API will send something as response for tasks that ask for weather data.
Profile: Weather (2)
Event: Intent Received [ Action:mycodefab.aleph.weather.WEATHER_DATA Cat:None Cat:None Scheme:* Mime Type:* ]
Enter: OperateWeather (3)
A1: Variable Set [ Name:%Weather_Text To:%place_name Do Maths:Off Append:Off ]
A2: Variable Split [ Name:%Weather_Text Splitter:, Delete Base:Off ]
A3: Variable Set [ Name:%Weather_Text To:%Weather_Ask at %Weather_Text1 %weather_desc, temperature Do Maths:Off Append:Off ]
A4: Variable Set [ Name:%Weather_Text To:%Weather_Text from %temp_min to Do Maths:Off Append:Off ] If [ %temp_max != %temp_min ]
A5: Variable Set [ Name:%Weather_Text To:%Weather_Text %temp_max degrees Do Maths:Off Append:Off ]
A6: Variable Set [ Name:%Weather_Temp To:%windspeed Do Maths:Off Append:Off ]
A7: Variable Split [ Name:%Weather_Temp Splitter:- Delete Base:Off ]
A8: Variable Set [ Name:%Weather_Text To:%Weather_Text, wind %Weather_Temp1 meters per second Do Maths:Off Append:Off ] If [ %Weather_Temp(#) = 1 ]
A9: Variable Set [ Name:%Weather_Text To:%Weather_Text, wind from %Weather_Temp1 to %Weather_Temp2 meters per second Do Maths:Off Append:Off ] If [ %Weather_Temp(#) = 2 ]
A10: Variable Set [ Name:%Weather_DateTime To:%datetime Do Maths:Off Append:Off ]
A11: Flash [ Text:%Weather_Text Long:Off ]
A12: Say [ Text:%Weather_Text Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:Off Network:Off Continue Task Immediately:Off Continue Task After Error:On ]
A13: Variable Clear [ Name:%Weather_Ask Pattern Matching:Off ]
A14: Variable Clear [ Name:%Weather_Text Pattern Matching:Off ]
2) The part contains tasks, that ask Weather ACE for some exact data:
AskWeatherNow (4)
A1: Variable Set [ Name:%Weather_Ask To:сейчас Do Maths:Off Append:Off ]
A2: Send Intent [ Action:mycodefab.aleph.weather.ACTION_GET_WEATHER Cat:None Mime Type: Data:geo:DEFAULT?ver=1&time=now Extra: Extra: Package: Class: Target:Broadcast Receiver ]
AskWeatherToday (12)
A1: Variable Set [ Name:%Weather_Ask To:сегодня Do Maths:Off Append:Off ]
A2: Send Intent [ Action:mycodefab.aleph.weather.ACTION_GET_WEATHER Cat:None Mime Type: Data:geo:DEFAULT?ver=1&date=today Extra: Extra: Package: Class: Target:Broadcast Receiver ]
A10: Send Intent [ Action:mycodefab.aleph.weather.ACTION_GET_WEATHER Cat:None Mime Type: Data:geo:DEFAULT?ver=1&date=%Weather_DateTime Extra: Extra: Package: Class: Target:Broadcast Receiver ]
Used variables:
%Weather_Ask - description of interval : "now", "today", "tomorrow" и т.д.
%Weather_DateTime - date and time in Unix format
%Weather_Temp - variable for to split min and max wind speed to different variables
%Weather_Text - text to speak, also used for to get location name
The Weather ACE API http://mycodefab.com/ allows to get weather data on any day or hour that present in the app internal database with lot of weather variables. I stopped to support Weather ACE Tasker pluging (because I dont use Tasker and it hard for me to help people than they have problems with the plugin), but I will definitely continue to support the way with Broadcast Intents.
Hope it will help to someone.
Best regards,
Alex