That’s going to be really cool if we can make it work. Can we? Let’s see what we have.
Let’s break the problem down a bit:
-
Can Tasker do something in response to a routine from Alexa? It looks like the answer may be yes Echo Smart Home Tasker Plugin but it is in beta and requires the AutoVoice plugin.
-
Can Tasker answer an incoming call? Yes, there is a Take Call action.
So it looks like you don’t need openHAB involved in this at all. What do you need the Item for? Is it just an assumption that the communication must go Alexa->openHAB->Tasker?
So let’s look at how Tasker can receive an event from openHAB. This is not so easy or straight forward as you would imagine. The problem is Tasker may or may not be on your LAN at any given time and therefore may or may not have access yo OH and OH have access to it. So we need a way for Tasker to get the events.
If you are using myopenhab.org we can set up Tasker to poll the REST API for a given Item but that is never going to be fast enough to do something like answering a call.
There appears to be an app that will kick off Tasker tasks in response to messages received over MQTT but this means you either have to be using a cloud based MQTT Broker like CloudMQTT (@vzorglub has a great tutorial for setting that up with the MQTT 1.x binding) or have an SSH tunnel set up (I’ve a tutorial for this posted here somewhere) or VPN connection to home. Or maybe not as you may not care if this command works if you are not connected to your LAN.
Finally, you may be able to set something up using Join or more likely AutoRemote. In this approach openHAB would kick off an sendHttpGetRequest or HTTP binding to call AutoRemote to send a command to your phone in response to the Item changing to ON. I’ve used AutoRemote a while I was playing with Google AIY Voice. Scroll down to the “Music” section.
Good luck! Please post a tutorial if you get this working. If you run into any trouble I’ll help if able.