Since Amazon has decided to cut all ties with any ToDo lists by simply not allowing them to use a “Todo-list” skill like “Alexa, put xy on the list”, I’m looking for a solution to connect alexa via openHAB with Microsoft ToDo, as we use this App in the family.
Is there anyone here, who did something like this?
I’m thinking of
I still see AnyList, Todoist and Bring as external lists in the Alexa app. I’m quite happy with AnyList and hope it will remain being supported.
If you are limited to Microsoft Todo I think it’s a little harder to rebuild the functionality.
Connecting to openhab is currently not perfect as amazon doesn’t push the last-spoken-command anymore. But with the not-yet-official binding from smartHome/J you can trigger the refresh channel and thus filter commands that add entries to your lists. I would set the polling interval to at least a few seconds hoping that amazon doesn’t reduce the API even more due to the polling.
Again, my mission statement was:
After amazon changed the shopping list integrations and we as a family don’t want to add a skill-name to our yearslong used “Alexa, add XYZ to the list” to “Alexa, open BringIt and add XYZ to the list”.
And last not least, MS offers an overall solution of App, API and stuff to (re-)integrate the shopping list for showing it within openHAB and the MS Todo App, we would like to stay within that eco-system.
Mission is clear: Use openHAB as a means to listening in to the commands and the re-routing them to MS ToDo.
Prerequisites:
lastVoiceCommand working (it does for me now again)
install tod0 (and configure it to be used from within openHAB and executeCommandLine [1])
What you have to do
define a Group for all lastVoiceCommand-items I use (We have 6 echos in the house)
add a rule to filter onChange on those items
add in the rule to execute a commandline with tod0 and add items to my shopping list.
So, it’s simple indeed, if you have a group for all your lastVoiceCommand-items, use the following rule, but change:
AMZ_LetzteSprachbefehle: Name of the Group with all your lastVoiceCommand
“auf die Liste” / “zur Liste”: your Triggerword in your language, to add items to a shopping list
Listname: name of the list within Microsoft ToDo
YourEmail: your email address, if you want to use notifications within openHAB App
configuration: {}
triggers:
- id: "1"
configuration:
groupName: AMZ_LetzteSprachbefehle
type: core.GroupStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/javascript
script: >
// search for "auf die liste" as trigger word
var befehl = event.itemState.toString();
var listePos = befehl.search("auf die liste");
// backup for only "liste", if the trigger was "zur Liste" or similar
if (listePos == -1) {
listePos = befehl.search("liste");
}
console.debug("DEBUG amazonShoppingliste: Trigger word is on pos " + listePos);
if (listePos != -1) {
// name of your list (be sure to leave the trailing "/" as the entry is done via that
var eintrag = "Einkaufliste/";
// delete trigger word(s)
befehl = befehl.replace(" auf die liste", "");
befehl = befehl.replace(" zur liste", "");
// add the desired product to the list
eintrag = eintrag.concat(befehl);
console.info("INFO amazonShoppingliste: per tod0 added to the list " + eintrag);
console.debug("DEBUG amazonShoppingliste: command is: todocli new " + eintrag);
// fire command
var Duration = Java.type('java.time.Duration');
var exec = actions.Exec.executeCommandLine(Duration.ofSeconds(15), "todocli", "new", eintrag);
console.debug("DEBUG amazonShoppingliste: response of tod0 was: " + exec);
if (exec != "") {
console.warn("INFO amazonShopingliste: WARN ", exec);
actions.NotificationAction.sendNotification("your@email.com", "AMZ Shoppingliste: " + exec, "siren", "warning");
}
}
type: script.ScriptAction
[1] after installing tod0 as described in the github, you have to
add the keys from the GET_KEY-readme to sudo nano /var/lib/openhab/.config/tod0/keys.yml (if running e.g. openHABian, other installation may require different paths)
run it once via ssh sudo -u openhab tod0 and do as the prompt says.