Inbound REST/JSON webhook for handing off actions to the Mycroft MessageBus
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Keturah Dola-Borg 4f94c7c0cf New recommendations in README 1 year ago
LICENSE Initial commit 1 year ago New recommendations in README 1 year ago Add README & initial webhook script 1 year ago


This is a very hacky Mycroft webhook (written in flask and using (yes, I know ugh) and using that listens for REST requests with JSON payloads and hands them off to Mycroft’s message bus.


All of the follow pyaloads should These payloads should be sent as a HTTP POST request with the header Content-Type: application/json


It listens on /api/v1.0/announce for a JSON payload in the format:

  "announcement": "your announcement here"

It will verbally announce whatever the announcement text in the payload is. Honestly, though, I recommend installing and using the say-to endpoint to call that. It’s a much nicer experience.


It also listens for utterances (e.g. things you can say to it) on /api/v1.0/say-to in the format:

 "input": "your utterance here"

It will process whatever the value of input is as an utterance (e.g. you could send "input": "volume 5" to adjust the volume of the Mycroft. Note that it will also verbally respond to the input as though you had verbally issused the command (e.g. given the last example, it might response with Volume set to five. out loud).


By default it listens on all interfaces on port 8080.

To install:

sudo mkdir /opt/mycroft-webhook && sudo chmod 0777 /opt/mycroft-webhook
git clone /opt/mycroft-webhook
pip install flask

To configure it to run at start (very very hacky!) add the following line to your ~/ file:

python /opt/mycroft-webhook/ 2>&1 | logger -t mycroft-webhook &

To configure with, add this to your configuration.yaml:

  - name: mycroft_name
    platform: rest
    resource: http://ip-address:8080/api/v1.0/announce
    method: POST_JSON
    message_param_name: announcement


  • I need to add some kind of security to the endpoint. Right now, it’s assumed that it’s secured by the firewall on your local network, which isn’t ideal - especially given the point of this is to not have to expose the Mycroft MessageBus service.

  • I want to switch from using for calling the Mycroft python modules to importing and using them, or just talking directly to the MessageBus. I wrote this for a quick-fix to integrate with HomeAssistant, so it’s not well thought through, but it gets the job done and I’ll clean it up later 😛

  • It should probably fail more gracefully. It doesn’t really check to see if the subprocess call exited cleanly or not. That’s not great.

  • It should also really run in it’s own venv.