Mycroft AI
  • Documentation
  • About Mycroft AI
    • Why use Mycroft AI?
    • Glossary of terms
    • Contributing
    • FAQ
  • Using Mycroft AI
    • Get Mycroft
      • Mark II
        • Mark II Dev Kit
      • Mark 1
      • Picroft
      • Linux
      • Mac OS and Windows with VirtualBox
      • Docker
      • Android
    • Pairing Your Device
    • Basic Commands
    • Installing New Skills
    • Customizations
      • Configuration Manager
      • mycroft.conf
      • Languages
        • Français (French)
        • Deutsch (German)
      • Using a Custom Wake Word
      • Speech-To-Text
      • Text-To-Speech
    • Troubleshooting
      • General Troubleshooting
      • Audio Troubleshooting
      • Wake Word Troubleshooting
      • Log Files
      • Support Skill
      • Getting more support
  • Skill Development
    • Voice User Interface Design Guidelines
      • What can a Skill do?
      • Design Process
      • Voice Assistant Personas
      • Interactions
        • Intents
        • Statements and Prompts
        • Confirmations
      • Conversations
      • Error Handling
      • Example Interaction Script
      • Prototyping
      • Design to Development
    • Development Setup
      • Python Resources
      • Your First Skill
    • Skill Structure
      • Lifecycle Methods
      • Logging
      • Skill Settings
      • Dependencies
        • Manifest.yml
        • Requirements files
      • Filesystem access
      • Skill API
    • Integration Tests
      • Test Steps
      • Scenario Outlines
      • Test Runner
      • Reviewing the Report
      • Adding Custom Steps
      • Old Test System
    • User interaction
      • Intents
        • Padatious Intents
        • Adapt Intents
      • Statements
      • Prompts
      • Parsing Utterances
      • Confirmations
      • Conversational Context
      • Converse
    • Displaying information
      • GUI Framework
      • Show Simple Content
      • Mycroft-GUI on a PC
      • Mark 1 Display
    • Advanced Skill Types
      • Fallback Skill
      • Common Play Framework
      • Common Query Framework
      • Common IoT Framework
    • Mycroft Skills Manager
      • Troubleshooting
    • Marketplace Submission
      • Skills Acceptance Process
        • Information Review Template
        • Code Review Template
        • Functional Review Template
        • Combined Template
      • Skill README.md
    • FAQ
  • Mycroft Technologies
    • Technology Overview
    • Roadmap
    • Mycroft Core
      • MessageBus
      • Message Types
      • Services
        • Enclosure
        • Voice Service
        • Audio Service
        • Skills Service
      • Plugins
        • Audioservice Plugins
        • STT Plugins
        • TTS Plugins
        • Wake Word Plugins
      • Testing
      • Legacy Repo
    • Adapt
      • Adapt Examples
      • Adapt Tutorial
    • Lingua Franca
    • Mimic TTS
      • Mimic 3
      • Mimic 2
      • Mimic 1
      • Mimic Recording Studio
    • Mycroft GUI
      • Remote STT and TTS
    • Mycroft Skills Kit
    • Mycroft Skills Manager
    • Padatious
    • Precise
    • Platforms
Powered by GitBook
On this page
  • General
  • speak
  • mycroft.internet.connected
  • mycroft.ready
  • mycroft.stop
  • mycroft.not.paired
  • mycroft.paired
  • mycroft.awoken
  • mycroft.debug.log
  • complete_intent_failure
  • configuration.updated
  • Recognizer
  • recognizer_loop:wakeword
  • recognizer_loop:record_begin
  • recognizer_loop:record_end
  • recognizer_loop:utterance
  • recognizer_loop:audio_output_start
  • recognizer_loop:audio_output_end
  • recognizer_loop:sleep
  • recognizer_loop:wake_up
  • Enclosure
  • enclosure.notify.no_internet
  • enclosure.mouth.viseme_list
  • mycroft.eyes.default
  • Microphone Behavior
  • mycroft.mic.listen
  • mycroft.mic.mute
  • mycroft.mic.unmute
  • Audio Playback
  • mycroft.audio.service.play
  • mycroft.audio.service.stop
  • mycroft.audio.service.pause
  • mycroft.audio.service.resume
  • mycroft.audio.service.next
  • mycroft.audio.service.prev
  • mycroft.audio.service.track_info
  • mycroft.audio.service.track_info_reply
  • mycroft.audio.service.list_backends
  • Volume Control
  • mycroft.volume.increase
  • mycroft.volume.decrease
  • mycroft.volume.mute
  • mycroft.volume.unmute
  • mycroft.volume.set
  • mycroft.volume.get
  • mycroft.volume.get.response
  • mycroft.volume.duck
  • mycroft.volume.unduck
  • Mycroft Skill Core
  • mycroft.skill.handler.start
  • mycroft.skill.handler.complete
  • mycroft.skill.enable_intent
  • mycroft.skill.disable_intent
  • mycroft.skills.loaded
  • mycroft.skills.loading_failure
  • mycroft.skills.shutdown
  • mycroft.skills.initialized
  • mycroft.skills.list
  • mycroft.skills.settings.update
  • Mycroft Skill Manager (MSM)
  • msm.updating
  • msm.installing
  • msm.install.succeeded
  • msm.install.failed
  • msm.installed
  • msm.updated
  • msm.removing
  • msm.remove.succeeded
  • msm.remove.failed
  • msm.removed
  • Skill Manager
  • skillmanager.deactivate
  • skillmanager.list
  • skillmanager.update
  • Messagebus Connection
  • open
  • close
  • reconnecting
  • System Administrative Actions
  • system.wifi.setup
  • system.wifi.reset
  • system.ntp.sync
  • system.ssh.enable
  • system.ssh.disable
  • system.reboot
  • system.shutdown
  • system.update
  • Common Play System
  • play:query
  • play:query.response
  • play:start
  • Common Query System
  • question:query
  • question:query.response
  • question:action
  • Mycroft Alarm Skill
  • private.mycroftai.has_alarm
  • PROPOSED
  • skill.namespace.*
  • private.github_username.*

Was this helpful?

  1. Mycroft Technologies
  2. Mycroft Core

Message Types

Messages are used to communicate information between Mycroft services and other components. This list of Message types outlines the details and provides sample code for each.

PreviousMessageBusNextServices

Last updated 4 years ago

Was this helpful?

Each Message type listed contains a description outlining it's meaning or purpose. Where relevant, the Message type will also list the specific JSON data packets expected to be emitted with that Message, and the most common producers and consumers of the Message.

See the for further information on this service and examples of using Messages.

General

speak

Request to speak utterance

Data:

{
    "utterance": <words to be spoken>,
    "lang": <language code, e.g. en-us>
}

Usage:

...
def initialize(self):
    self.add_event('speak',
                   self.handler_speak)

def handler_speak(self, message):
    # code to excecute when speak message detected...
...
...
def some_method(self):
    self.bus.emit(Message('speak',
                              {"utterance": <words to be spoken>,
                               "lang": <language code, e.g. en-us>}))
...
python3 -m mycroft.messagebus.send 'speak' '{ "utterance": <words to be spoken>, "lang": <language code, e.g. en-us>}'

mycroft.internet.connected

Internet connection is now available (only generated on initial connection)

Usage:

...
def initialize(self):
    self.add_event('mycroft.internet.connected',
                   self.handler_mycroft_internet_connected)

def handler_mycroft_internet_connected(self, message):
    # code to excecute when mycroft.internet.connected message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.internet.connected'))
...
python3 -m mycroft.messagebus.send 'mycroft.internet.connected'

mycroft.ready

Sent by start-up sequence when everything is ready for user interaction

Producer

Consumer

skills/padatious_service.py

Pairing Skill

Usage:

...
def initialize(self):
    self.add_event('mycroft.ready',
                   self.handler_mycroft_ready)

def handler_mycroft_ready(self, message):
    # code to excecute when mycroft.ready message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.ready'))
...
python3 -m mycroft.messagebus.send 'mycroft.ready'

mycroft.stop

Stop command (e.g. button pressed)

Usage:

...
def initialize(self):
    self.add_event('mycroft.stop',
                   self.handler_mycroft_stop)

def handler_mycroft_stop(self, message):
    # code to excecute when mycroft.stop message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.stop'))
...
python3 -m mycroft.messagebus.send 'mycroft.stop'

mycroft.not.paired

Start the pairing process when this event is emitted.

Producer

Consumer

Pairing Skill

Weather Skill

Wolfram Alpha Skill

Pairing Skill

...
def initialize(self):
    self.add_event('mycroft.not.paired',
                   self.handler_mycroft_not_paired)

def handler_mycroft_not_paired(self, message):
    # code to excecute when mycroft.not.paired message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.not.paired'))
...
python3 -m mycroft.messagebus.send 'mycroft.not.paired'

mycroft.paired

Pairing has completed

Producer

Consumer

Pairing Skill

skills/skill_manager.py

enclosure/mark1/__init__.py

enclosure/generic/__init__.py

client/speech/__main__.py

...
def initialize(self):
    self.add_event('mycroft.paired',
                   self.handler_mycroft_paired)

def handler_mycroft_paired(self, message):
    # code to excecute when mycroft.paired message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.paired'))
...
python3 -m mycroft.messagebus.send 'mycroft.paired'

mycroft.awoken

Has come out of sleep mode

Usage:

...
def initialize(self):
    self.add_event('mycroft.awoken',
                   self.handler_mycroft_awoken)

def handler_mycroft_awoken(self, message):
    # code to excecute when mycroft.awoken message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.awoken'))
...
python3 -m mycroft.messagebus.send 'mycroft.awoken'

mycroft.debug.log

log level can be: "CRITICAL" "ERROR" "WARNING" "INFO" "DEBUG" These correspond to the Python logging object.

The "bus" parameter allows turning the logging of all bus messages on/off.

Data:

{
   "level" : <log level>,
   "bus": <True/False>
}

Usage:

...
def initialize(self):
    self.add_event('mycroft.debug.log',
                   self.handler_mycroft_debug_log)

def handler_mycroft_debug_log(self, message):
    # code to excecute when mycroft.debug.log message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.debug.log',
                              {
   "level" : <log level>,
   "bus": <True/False>}))
...
python3 -m mycroft.messagebus.send 'mycroft.debug.log' '{   "level" : <log level>,   "bus": <True/False>}'

complete_intent_failure

Intent processing failed

Usage:

...
def initialize(self):
    self.add_event('complete_intent_failure',
                   self.handler_complete_intent_failure)

def handler_complete_intent_failure(self, message):
    # code to excecute when complete_intent_failure message detected...
...
...
def some_method(self):
    self.bus.emit(Message('complete_intent_failure'))
...
python3 -m mycroft.messagebus.send 'complete_intent_failure'

configuration.updated

Notification to services that the configuration has changed and needs reloaded

Usage:

...
def initialize(self):
    self.add_event('configuration.updated',
                   self.handler_configuration_updated)

def handler_configuration_updated(self, message):
    # code to excecute when configuration.updated message detected...
...
...
def some_method(self):
    self.bus.emit(Message('configuration.updated'))
...
python3 -m mycroft.messagebus.send 'configuration.updated'

Recognizer

recognizer_loop:wakeword

Wakeword was heard

Data:

{
    "utterance": <wakeword heard>,
    "session": <session ID>,
}

Producer

Consumer

client/speech/main.py

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:wakeword',
                   self.handler_wakeword)

def handler_wakeword(self, message):
    # code to excecute when recognizer_loop:wakeword message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:wakeword',
                              {"utterance": <wakeword heard>,
                               "session": <session ID>,}
))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:wakeword' '{ "utterance": <wakeword heard>, "session": <session ID>,}'

recognizer_loop:record_begin

Recording has started

Producer

Consumer

client/speech/main.py

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:record_begin',
                   self.handler_record_begin)

def handler_record_begin(self, message):
    # code to excecute when recognizer_loop:record_begin message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:record_begin'))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:record_begin'

recognizer_loop:record_end

Recording has ended

Producer

Consumer

client/speech/main.py

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:record_end',
                   self.handler_record_end)

def handler_record_end(self, message):
    # code to excecute when recognizer_loop:record_end message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:record_end'))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:record_end'

recognizer_loop:utterance

STT has detected the given text or text was injected as an utterance via the CLI.

Data:

{
    "utterances": [text],
    "lang": self.stt.lang,
    "session": session_id
}

Producer

Consumer

client/speech/__main__.py

client/speech/listener.py

client/text/text_client.py

skills/__main__.py

client/text/text_client.py

messagebus/client/client.py

skills/intent_service.py

...
def initialize(self):
    self.add_event('recognizer_loop:utterance',
                   self.handler_utterance)

def handler_utterance(self, message):
    # code to excecute when recognizer_loop:utterance message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:utterance',
                              {"utterances": [text],
                               "lang": self.stt.lang,
                               "session": session_id}))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:utterance' '{ "utterances": [text], "lang": self.stt.lang, "session": session_id}'

recognizer_loop:audio_output_start

Text output (TTS) has begun

Producer

Consumer

audio/speech.py

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:audio_output_start',
                   self.handler_audio_output_start)

def handler_audio_output_start(self, message):
    # code to excecute when recognizer_loop:audio_output_start message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:audio_output_start'))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:audio_output_start'

recognizer_loop:audio_output_end

Text output (TTS) has ended

Producer

Consumer

audio/speech.py

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:audio_output_end',
                   self.handler_audio_output_end)

def handler_audio_output_end(self, message):
    # code to excecute when recognizer_loop:audio_output_end message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:audio_output_end'))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:audio_output_end'

recognizer_loop:sleep

Go into "sleep" mode. Everything except "Hey Mycroft, wake up" will be ignored.

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:sleep',
                   self.handler_sleep)

def handler_sleep(self, message):
    # code to excecute when recognizer_loop:sleep message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:sleep'))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:sleep'

recognizer_loop:wake_up

Come out of "sleep" mode.

Usage:

...
def initialize(self):
    self.add_event('recognizer_loop:wake_up',
                   self.handler_wake_up)

def handler_wake_up(self, message):
    # code to excecute when recognizer_loop:wake_up message detected...
...
...
def some_method(self):
    self.bus.emit(Message('recognizer_loop:wake_up'))
...
python3 -m mycroft.messagebus.send 'recognizer_loop:wake_up'

Enclosure

enclosure.notify.no_internet

Detected a connection error during STT

Producer

Consumer

audio/speech.py

Usage:

...
def initialize(self):
    self.add_event('enclosure.notify.no_internet',
                   self.handler_enclosure_notify_no_internet)

def handler_enclosure_notify_no_internet(self, message):
    # code to excecute when enclosure.notify.no_internet message detected...
...
...
def some_method(self):
    self.bus.emit(Message('enclosure.notify.no_internet'))
...
python3 -m mycroft.messagebus.send 'enclosure.notify.no_internet'

enclosure.mouth.viseme_list

start: timestamp for audio starts (unix epoch) END_TIME: time in seconds from "start" until the end of the viseme CODE can be 0 = shape for sounds like 'y' or 'aa' 1 = shape for sounds like 'aw' 2 = shape for sounds like 'uh' or 'r' 3 = shape for sounds like 'th' or 'sh' 4 = neutral shape for no sound 5 = shape for sounds like 'f' or 'v' 6 = shape for sounds like 'oy' or 'ao'

Data:

{
  "start": timestamp,
  "visemes": [[CODE,END_TIME],...]
}

Usage:

...
def initialize(self):
    self.add_event('enclosure.mouth.viseme_list',
                   self.handler_enclosure_mouth_viseme_list)

def handler_enclosure_mouth_viseme_list(self, message):
    # code to excecute when enclosure.mouth.viseme_list message detected...
...
...
def some_method(self):
    self.bus.emit(Message('enclosure.mouth.viseme_list',
                              {
  "start": timestamp,
  "visemes": [[CODE,END_TIME],...]}))
...
python3 -m mycroft.messagebus.send 'enclosure.mouth.viseme_list' '{  "start": timestamp,  "visemes": [[CODE,END_TIME],...]}'

mycroft.eyes.default

Change eyes to default color

Producer

Consumer

mycroft-mark-1

Usage:

...
def initialize(self):
    self.add_event('mycroft.eyes.default',
                   self.handler_mycroft_eyes_default)

def handler_mycroft_eyes_default(self, message):
    # code to excecute when mycroft.eyes.default message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.eyes.default'))
...
python3 -m mycroft.messagebus.send 'mycroft.eyes.default'

Microphone Behavior

mycroft.mic.listen

Begin recording for STT processing

Usage:

...
def initialize(self):
    self.add_event('mycroft.mic.listen',
                   self.handler_mycroft_mic_listen)

def handler_mycroft_mic_listen(self, message):
    # code to excecute when mycroft.mic.listen message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.mic.listen'))
...
python3 -m mycroft.messagebus.send 'mycroft.mic.listen'

mycroft.mic.mute

Turn off the mic (no wakeword or STT processing)

Producer

Consumer

Pairing Skill

client/speech/main.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.mic.mute',
                   self.handler_mycroft_mic_mute)

def handler_mycroft_mic_mute(self, message):
    # code to excecute when mycroft.mic.mute message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.mic.mute'))
...
python3 -m mycroft.messagebus.send 'mycroft.mic.mute'

mycroft.mic.unmute

Turn on the mic (enable wakeword and STT processing)

Producer

Consumer

Pairing Skill

client/speech/main.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.mic.unmute',
                   self.handler_mycroft_mic_unmute)

def handler_mycroft_mic_unmute(self, message):
    # code to excecute when mycroft.mic.unmute message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.mic.unmute'))
...
python3 -m mycroft.messagebus.send 'mycroft.mic.unmute'

Audio Playback

mycroft.audio.service.play

Start playback of tracklist

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.play',
                   self.handler_mycroft_audio_service_play)

def handler_mycroft_audio_service_play(self, message):
    # code to excecute when mycroft.audio.service.play message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.play'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.play'

mycroft.audio.service.stop

Stop playback

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.stop',
                   self.handler_mycroft_audio_service_stop)

def handler_mycroft_audio_service_stop(self, message):
    # code to excecute when mycroft.audio.service.stop message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.stop'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.stop'

mycroft.audio.service.pause

Pause playback (if supported)

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.pause',
                   self.handler_mycroft_audio_service_pause)

def handler_mycroft_audio_service_pause(self, message):
    # code to excecute when mycroft.audio.service.pause message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.pause'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.pause'

mycroft.audio.service.resume

Resume playback (if supported by backend)

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.resume',
                   self.handler_mycroft_audio_service_resume)

def handler_mycroft_audio_service_resume(self, message):
    # code to excecute when mycroft.audio.service.resume message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.resume'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.resume'

mycroft.audio.service.next

Skip to next track

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.next',
                   self.handler_mycroft_audio_service_next)

def handler_mycroft_audio_service_next(self, message):
    # code to excecute when mycroft.audio.service.next message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.next'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.next'

mycroft.audio.service.prev

Skip to previous track

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.prev',
                   self.handler_mycroft_audio_service_prev)

def handler_mycroft_audio_service_prev(self, message):
    # code to excecute when mycroft.audio.service.prev message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.prev'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.prev'

mycroft.audio.service.track_info

Request track info from audio service

Producer

Consumer

skills/audioservice.py

playback-control

audio/main.py

...
def initialize(self):
    self.add_event('mycroft.audio.service.track_info',
                   self.handler_mycroft_audio_service_track_info)

def handler_mycroft_audio_service_track_info(self, message):
    # code to excecute when mycroft.audio.service.track_info message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.track_info'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.track_info'

mycroft.audio.service.track_info_reply

Reply to track info request

Producer

Consumer

audio/main.py

skills/audioservice.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.audio.service.track_info_reply',
                   self.handler_mycroft_audio_service_track_info_reply)

def handler_mycroft_audio_service_track_info_reply(self, message):
    # code to excecute when mycroft.audio.service.track_info_reply message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.track_info_reply'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.track_info_reply'

mycroft.audio.service.list_backends

Returns list of available backends.

Producer

Consumer

skills/audioservice.py

audio/main.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.audio.service.list_backends',
                   self.handler_mycroft_audio_service_list_backends)

def handler_mycroft_audio_service_list_backends(self, message):
    # code to excecute when mycroft.audio.service.list_backends message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.audio.service.list_backends'))
...
python3 -m mycroft.messagebus.send 'mycroft.audio.service.list_backends'

Volume Control

mycroft.volume.increase

Enclosure Volume up

Data:

{"play_sound": True}

Producer

Consumer

client/enclosure/__init__.py

Volume Skill

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.increase',
                   self.handler_mycroft_volume_increase)

def handler_mycroft_volume_increase(self, message):
    # code to excecute when mycroft.volume.increase message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.increase',
                              {"play_sound": True}))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.increase' '{"play_sound": True}'

mycroft.volume.decrease

Enclosure Volume down

Data:

{"play_sound": True}

Producer

Consumer

client/enclosure/__init__.py

Volume Skill

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.decrease',
                   self.handler_mycroft_volume_decrease)

def handler_mycroft_volume_decrease(self, message):
    # code to excecute when mycroft.volume.decrease message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.decrease',
                              {"play_sound": True}))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.decrease' '{"play_sound": True}'

mycroft.volume.mute

Enclosure Volume muted

Data:

{"speak_message": True}

Producer

Consumer

skill-naptime

Volume Skill

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.mute',
                   self.handler_mycroft_volume_mute)

def handler_mycroft_volume_mute(self, message):
    # code to excecute when mycroft.volume.mute message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.mute',
                              {"speak_message": True}))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.mute' '{"speak_message": True}'

mycroft.volume.unmute

Enclosure Volume unmuted

Data:

{"speak_message": True}

Producer

Consumer

skill-naptime

Volume Skill

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.unmute',
                   self.handler_mycroft_volume_unmute)

def handler_mycroft_volume_unmute(self, message):
    # code to excecute when mycroft.volume.unmute message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.unmute',
                              {"speak_message": True}))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.unmute' '{"speak_message": True}'

mycroft.volume.set

Set enclosure volume (0.0 = no output, 1.0 = loudest possible)

Data:

{"percent": float}

Producer

Consumer

Volume Skill

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.set',
                   self.handler_mycroft_volume_set)

def handler_mycroft_volume_set(self, message):
    # code to excecute when mycroft.volume.set message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.set',
                              {"percent": float}))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.set' '{"percent": float}'

mycroft.volume.get

Request volume level

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.get',
                   self.handler_mycroft_volume_get)

def handler_mycroft_volume_get(self, message):
    # code to excecute when mycroft.volume.get message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.get'))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.get'

mycroft.volume.get.response

Data:

{
    "percent": <volume percentage>,
    "muted": <true/false>
}

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.get.response',
                   self.handler_mycroft_volume_get_response)

def handler_mycroft_volume_get_response(self, message):
    # code to excecute when mycroft.volume.get.response message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.get.response',
                              {"percent": <volume percentage>,
                               "muted": <true/false>}))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.get.response' '{ "percent": <volume percentage>, "muted": <true/false>}'

mycroft.volume.duck

Reduce the volume level temporarily

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.duck',
                   self.handler_mycroft_volume_duck)

def handler_mycroft_volume_duck(self, message):
    # code to excecute when mycroft.volume.duck message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.duck'))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.duck'

mycroft.volume.unduck

Restore the volume level

Producer

Consumer

Enclosure (skill-mark-2)

Usage:

...
def initialize(self):
    self.add_event('mycroft.volume.unduck',
                   self.handler_mycroft_volume_unduck)

def handler_mycroft_volume_unduck(self, message):
    # code to excecute when mycroft.volume.unduck message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.volume.unduck'))
...
python3 -m mycroft.messagebus.send 'mycroft.volume.unduck'

Mycroft Skill Core

mycroft.skill.handler.start

Data:

{handler: class/function name}

Usage:

...
def initialize(self):
    self.add_event('mycroft.skill.handler.start',
                   self.handler_mycroft_skill_handler_start)

def handler_mycroft_skill_handler_start(self, message):
    # code to excecute when mycroft.skill.handler.start message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skill.handler.start',
                              {handler: class/function name}))
...
python3 -m mycroft.messagebus.send 'mycroft.skill.handler.start' '{handler: class/function name}'

mycroft.skill.handler.complete

Usage:

...
def initialize(self):
    self.add_event('mycroft.skill.handler.complete',
                   self.handler_mycroft_skill_handler_complete)

def handler_mycroft_skill_handler_complete(self, message):
    # code to excecute when mycroft.skill.handler.complete message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skill.handler.complete'))
...
python3 -m mycroft.messagebus.send 'mycroft.skill.handler.complete'

mycroft.skill.enable_intent

Enable disabled intent

Data:

{"intent_name": "name"}

Producer

Consumer

mycroft/skills/core.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skill.enable_intent',
                   self.handler_mycroft_skill_enable_intent)

def handler_mycroft_skill_enable_intent(self, message):
    # code to excecute when mycroft.skill.enable_intent message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skill.enable_intent',
                              {"intent_name": "name"}))
...
python3 -m mycroft.messagebus.send 'mycroft.skill.enable_intent' '{"intent_name": "name"}'

mycroft.skill.disable_intent

Disable intent

Data:

{"intent_name": "name"}

Producer

Consumer

mycroft/skills/core.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skill.disable_intent',
                   self.handler_mycroft_skill_disable_intent)

def handler_mycroft_skill_disable_intent(self, message):
    # code to excecute when mycroft.skill.disable_intent message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skill.disable_intent',
                              {"intent_name": "name"}))
...
python3 -m mycroft.messagebus.send 'mycroft.skill.disable_intent' '{"intent_name": "name"}'

mycroft.skills.loaded

A Skill has been loaded

Data:

{
    "id": <skill ID>,
    "name": <skill name>,
    "path": <skill directory>,
    "modified": <modified time>
}

Producer

Consumer

skills/main.py

mycroft/skills/intent_service.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skills.loaded',
                   self.handler_mycroft_skills_loaded)

def handler_mycroft_skills_loaded(self, message):
    # code to excecute when mycroft.skills.loaded message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skills.loaded',
                              {"id": <skill ID>,
                               "name": <skill name>,
                               "folder": <skill directory>,
                               "modified": <modified time>}))
...
python3 -m mycroft.messagebus.send 'mycroft.skills.loaded' '{ "id": <skill ID>, "name": <skill name>, "folder": <skill directory>, "modified": <modified time>}'

mycroft.skills.loading_failure

A Skill has failed to load

Data:

{
    "id": <skill ID>,
    "folder": <skill directory>
}

Producer

Consumer

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skills.loading_failure',
                   self.handler_mycroft_skills_loading_failure)

def handler_mycroft_skills_loading_failure(self, message):
    # code to excecute when mycroft.skills.loading_failure message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skills.loading_failure',
                              {"id": <skill ID>,
                               "folder": <skill directory>}))
...
python3 -m mycroft.messagebus.send 'mycroft.skills.loading_failure' '{ "id": <skill ID>, "folder": <skill directory>}'

mycroft.skills.shutdown

A Skill has shutdown

Data:

{
    "id": <skill ID>,
    "folder": <skill directory>
}

Producer

Consumer

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skills.shutdown',
                   self.handler_mycroft_skills_shutdown)

def handler_mycroft_skills_shutdown(self, message):
    # code to excecute when mycroft.skills.shutdown message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skills.shutdown',
                              {"id": <skill ID>,
                               "folder": <skill directory>}))
...
python3 -m mycroft.messagebus.send 'mycroft.skills.shutdown' '{ "id": <skill ID>, "folder": <skill directory>}'

mycroft.skills.initialized

Upon startup, all skills have been loaded

Producer

Consumer

mycroft/skills/skill_manager.py

mycroft/skills/padatious_service.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skills.initialized',
                   self.handler_mycroft_skills_initialized)

def handler_mycroft_skills_initialized(self, message):
    # code to excecute when mycroft.skills.initialized message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skills.initialized'))
...
python3 -m mycroft.messagebus.send 'mycroft.skills.initialized'

mycroft.skills.list

List of loaded skills (response to 'skillmanager.list')

Data:

{"skills": [<list of skill IDs>] }

Producer

Consumer

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skills.list',
                   self.handler_mycroft_skills_list)

def handler_mycroft_skills_list(self, message):
    # code to excecute when mycroft.skills.list message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skills.list',
                              {"skills": [<list of skill IDs>] }))
...
python3 -m mycroft.messagebus.send 'mycroft.skills.list' '{"skills": [<list of skill IDs>] }'

mycroft.skills.settings.update

Pull new skill settings from the server

Producer

Consumer

Configuration Skill

mycroft/skills/settings.py

Usage:

...
def initialize(self):
    self.add_event('mycroft.skills.settings.update',
                   self.handler_mycroft_skills_settings_update)

def handler_mycroft_skills_settings_update(self, message):
    # code to excecute when mycroft.skills.settings.update message detected...
...
...
def some_method(self):
    self.bus.emit(Message('mycroft.skills.settings.update'))
...
python3 -m mycroft.messagebus.send 'mycroft.skills.settings.update'

Mycroft Skill Manager (MSM)

msm.updating

MSM install has begun

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.updating',
                   self.handler_msm_updating)

def handler_msm_updating(self, message):
    # code to excecute when msm.updating message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.updating'))
...
python3 -m mycroft.messagebus.send 'msm.updating'

msm.installing

MSM update has begun

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.installing',
                   self.handler_msm_installing)

def handler_msm_installing(self, message):
    # code to excecute when msm.installing message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.installing'))
...
python3 -m mycroft.messagebus.send 'msm.installing'

msm.install.succeeded

MSM install succeeded for given skill

Data:

{ "skill" : <skill name> }

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.install.succeeded',
                   self.handler_msm_install_succeeded)

def handler_msm_install_succeeded(self, message):
    # code to excecute when msm.install.succeeded message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.install.succeeded',
                              { "skill" : <skill name> }))
...
python3 -m mycroft.messagebus.send 'msm.install.succeeded' '{ "skill" : <skill name> }'

msm.install.failed

MSM install failed for given skill

Data:

{
    "skill" : <skill name>,
    "error": <error code>
}

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.install.failed',
                   self.handler_msm_install_failed)

def handler_msm_install_failed(self, message):
    # code to excecute when msm.install.failed message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.install.failed',
                              {"skill" : <skill name>,
                               "error": <error code>}))
...
python3 -m mycroft.messagebus.send 'msm.install.failed' '{ "skill" : <skill name>, "error": <error code>}'

msm.installed

MSM install is complete

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.installed',
                   self.handler_msm_installed)

def handler_msm_installed(self, message):
    # code to excecute when msm.installed message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.installed'))
...
python3 -m mycroft.messagebus.send 'msm.installed'

msm.updated

MSM update is complete

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.updated',
                   self.handler_msm_updated)

def handler_msm_updated(self, message):
    # code to excecute when msm.updated message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.updated'))
...
python3 -m mycroft.messagebus.send 'msm.updated'

msm.removing

MSM remove has begun

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.removing',
                   self.handler_msm_removing)

def handler_msm_removing(self, message):
    # code to excecute when msm.removing message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.removing'))
...
python3 -m mycroft.messagebus.send 'msm.removing'

msm.remove.succeeded

MSM remove succeeded for given skill

Data:

{ "skill" : <skill name> }

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.remove.succeeded',
                   self.handler_msm_remove_succeeded)

def handler_msm_remove_succeeded(self, message):
    # code to excecute when msm.remove.succeeded message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.remove.succeeded',
                              { "skill" : <skill name> }))
...
python3 -m mycroft.messagebus.send 'msm.remove.succeeded' '{ "skill" : <skill name> }'

msm.remove.failed

MSM remove failed for given skill

Data:

{
    "skill" : <skill name>,
    "error": <error code>
}

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.remove.failed',
                   self.handler_msm_remove_failed)

def handler_msm_remove_failed(self, message):
    # code to excecute when msm.remove.failed message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.remove.failed',
                              {"skill" : <skill name>,
                               "error": <error code>}))
...
python3 -m mycroft.messagebus.send 'msm.remove.failed' '{ "skill" : <skill name>, "error": <error code>}'

msm.removed

MSM remove is complete

Producer

Consumer

msm.sh

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('msm.removed',
                   self.handler_msm_removed)

def handler_msm_removed(self, message):
    # code to excecute when msm.removed message detected...
...
...
def some_method(self):
    self.bus.emit(Message('msm.removed'))
...
python3 -m mycroft.messagebus.send 'msm.removed'

Skill Manager

skillmanager.deactivate

Deactivate a skill. Activate by typing ":deactivate " in the CLI

Data:

{'skill': <skill directory name>}

Producer

Consumer

CLI (client/text/main.py)

skills/skill_manager.py

Usage:

...
def initialize(self):
    self.add_event('skillmanager.deactivate',
                   self.handler_skillmanager_deactivate)

def handler_skillmanager_deactivate(self, message):
    # code to excecute when skillmanager.deactivate message detected...
...
...
def some_method(self):
    self.bus.emit(Message('skillmanager.deactivate',
                              {'skill': <skill directory name>}))
...
python3 -m mycroft.messagebus.send 'skillmanager.deactivate' '{'skill': <skill directory name>}'

skillmanager.list

List installed skills. Activate by typing ":list" in the CLI

Producer

Consumer

CLI (client/text/main.py)

skills/skill_manager.py

Usage:

...
def initialize(self):
    self.add_event('skillmanager.list',
                   self.handler_skillmanager_list)

def handler_skillmanager_list(self, message):
    # code to excecute when skillmanager.list message detected...
...
...
def some_method(self):
    self.bus.emit(Message('skillmanager.list'))
...
python3 -m mycroft.messagebus.send 'skillmanager.list'

skillmanager.update

Request immediate update of all skills

Producer

Consumer

skills/main.py

Usage:

...
def initialize(self):
    self.add_event('skillmanager.update',
                   self.handler_skillmanager_update)

def handler_skillmanager_update(self, message):
    # code to excecute when skillmanager.update message detected...
...
...
def some_method(self):
    self.bus.emit(Message('skillmanager.update'))
...
python3 -m mycroft.messagebus.send 'skillmanager.update'

Messagebus Connection

open

websocket connection has closed

Producer

Consumer

messagebus\client\ws.py

Usage:

...
def initialize(self):
    self.add_event('open',
                   self.handler_open)

def handler_open(self, message):
    # code to excecute when open message detected...
...
...
def some_method(self):
    self.bus.emit(Message('open'))
...
python3 -m mycroft.messagebus.send 'open'

close

websocket connection was lost, reconnecting

Producer

Consumer

messagebus\client\ws.py

Usage:

...
def initialize(self):
    self.add_event('close',
                   self.handler_close)

def handler_close(self, message):
    # code to excecute when close message detected...
...
...
def some_method(self):
    self.bus.emit(Message('close'))
...
python3 -m mycroft.messagebus.send 'close'

reconnecting

websocket connection has opened

Producer

Consumer

messagebus\client\ws.py

Usage:

...
def initialize(self):
    self.add_event('reconnecting',
                   self.handler_reconnecting)

def handler_reconnecting(self, message):
    # code to excecute when reconnecting message detected...
...
...
def some_method(self):
    self.bus.emit(Message('reconnecting'))
...
python3 -m mycroft.messagebus.send 'reconnecting'

System Administrative Actions

system.wifi.setup

Kick off a a wifi-setup session

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.wifi.setup',
                   self.handler_system_wifi_setup)

def handler_system_wifi_setup(self, message):
    # code to excecute when system.wifi.setup message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.wifi.setup'))
...
python3 -m mycroft.messagebus.send 'system.wifi.setup'

system.wifi.reset

Clear the saved wifi settings

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.wifi.reset',
                   self.handler_system_wifi_reset)

def handler_system_wifi_reset(self, message):
    # code to excecute when system.wifi.reset message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.wifi.reset'))
...
python3 -m mycroft.messagebus.send 'system.wifi.reset'

system.ntp.sync

Force the system clock to synchronize with NTP servers

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.ntp.sync',
                   self.handler_system_ntp_sync)

def handler_system_ntp_sync(self, message):
    # code to excecute when system.ntp.sync message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.ntp.sync'))
...
python3 -m mycroft.messagebus.send 'system.ntp.sync'

system.ssh.enable

Configure system to allow SSH connections

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.ssh.enable',
                   self.handler_system_ssh_enable)

def handler_system_ssh_enable(self, message):
    # code to excecute when system.ssh.enable message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.ssh.enable'))
...
python3 -m mycroft.messagebus.send 'system.ssh.enable'

system.ssh.disable

Configure system to block SSH connections

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.ssh.disable',
                   self.handler_system_ssh_disable)

def handler_system_ssh_disable(self, message):
    # code to excecute when system.ssh.disable message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.ssh.disable'))
...
python3 -m mycroft.messagebus.send 'system.ssh.disable'

system.reboot

Force a Linux reboot

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.reboot',
                   self.handler_system_reboot)

def handler_system_reboot(self, message):
    # code to excecute when system.reboot message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.reboot'))
...
python3 -m mycroft.messagebus.send 'system.reboot'

system.shutdown

Force a Linux shutdown

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.shutdown',
                   self.handler_system_shutdown)

def handler_system_shutdown(self, message):
    # code to excecute when system.shutdown message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.shutdown'))
...
python3 -m mycroft.messagebus.send 'system.shutdown'

system.update

Force an apt-get update on 'mycroft-mark-1' or 'mycroft-picroft' package (as appropriate)

Producer

Consumer

mycroft-wifi-setup: mycroft_admin_service.py

Usage:

...
def initialize(self):
    self.add_event('system.update',
                   self.handler_system_update)

def handler_system_update(self, message):
    # code to excecute when system.update message detected...
...
...
def some_method(self):
    self.bus.emit(Message('system.update'))
...
python3 -m mycroft.messagebus.send 'system.update'

Common Play System

play:query

Data:

{ "phrase": <something to be played> }

Usage:

...
def initialize(self):
    self.add_event('play:query',
                   self.handler_query)

def handler_query(self, message):
    # code to excecute when play:query message detected...
...
...
def some_method(self):
    self.bus.emit(Message('play:query',
                              { "phrase": <something to be played> }))
...
python3 -m mycroft.messagebus.send 'play:query' '{ "phrase": <something to be played> }'

play:query.response

There are three responses to a play:query. These are not intended to be consumed directly by a Skill, see the methods available in the CommonPlaySkill Class.

Confirm Search

The initial response confirms that a search is being attempted. It also extends the Skill timeout while it looks for a match.

Data:

{
  "phrase": search_phrase,
  "skill_id": self.skill_id,
  "searching": True
}

Search Result

Emitted if a result is found. Responses from the Play services must be received within 1 second to be included.

Data:

{
    "phrase": phrase,
    "skill_id":  self.skill_id,
    "callback_data": data,
    "service_name": self.spoken_name,
    "conf": confidence
}
  • phrase - the phrase that was queried for this response

  • id - uniquely identifies the skill, normally the Skill's self.skill_id

  • callback_data - optional data structure to return in play:start

  • service_name - the name of the service returning the highest confidence in a speakable format

  • conf - the confidence it can handle the request, between 0.0 and 1.0

Confidence guidelines:

  • 1.0 = exact command match, e.g. "play npr news"

  • >0.9 = multi-key match for database entry, e.g. "play madonna's lucky star" or "play artist madona" (matches "artist" and "madonna"). For each additional key over 2, add 0.1 to the confidence, so "play madonna's lucky star on spotify" would be 0.91 for three keywords

  • >0.8 = single-key match for database title entry, e.g. "play lucky star"

  • >0.7 = single-key match for database artist or group, e.g. "play madonna"

  • >0.6 = single-key match for database genre or category, e.g. "play reggae"

  • >0.5 = generic match, e.g. "play some music" or "play a movie"

Search Failed

No suitable result was found.

Data:

{
  "phrase": search_phrase,
  "skill_id": self.skill_id,
  "searching": False
}

play:start

  • skill_id -- the unique ID of the skill that is being invoked

  • phrase -- the original phrase user said, e.g. "some thing" from utterance "play some thing"

  • callback_data -- (optional) data the skill can use to start playback

Data:

{
    "skill_id": <skill_id>,
     "phrase": phrase,
     "callback_data": optional_data
}

Common Query System

question:query

Data:

{"phrase": "complete question"}

Usage:

...
def initialize(self):
    self.add_event('question:query',
                   self.handler_query)

def handler_query(self, message):
    # code to excecute when question:query message detected...
...
...
def some_method(self):
    self.bus.emit(Message('question:query',
                              {"phrase": "complete question"}))
...
python3 -m mycroft.messagebus.send 'question:query' '{"phrase": "complete question"}'

question:query.response

  • skill_id -- the unique ID of the skill that is being invoked

  • phrase -- the original phrase user said, e.g. "some thing" from utterance "how tall was abraham lincoln"

  • conf -- confidence level of answers validity

  • callback_data -- (optional) data the skill can use for any additional actions (such as image url or similar)

  • searching -- true if more time is needed to complete the search, otherwise false

Data:

{
    "phrase": phrase,
    "skill_id": <skill_id>,
    "answer": "answer string",
    "conf": confidence,
    "callback_data": <json data>,
    "searching": true/false
}

Usage:

...
def initialize(self):
    self.add_event('question:query.response',
                   self.handler_query_response)

def handler_query_response(self, message):
    # code to excecute when question:query.response message detected...
...
...
def some_method(self):
    self.bus.emit(Message('question:query.response',
                              {"phrase": phrase,
                               "skill_id": <skill_id>,
                               "answer": "answer string",
                               "conf": confidence,
                               "callback_data": <json data>,
                               "searching": true/false}))
...
python3 -m mycroft.messagebus.send 'question:query.response' '{ "phrase": phrase, "skill_id": <skill_id>, "answer": "answer string", "conf": confidence, "callback_data": <json data>, "searching": true/false}'

question:action

  • skill_id -- the unique ID of the skill that is being invoked

  • phrase -- the original phrase user said, e.g. "some thing" from utterance "how tall was abraham lincoln"

  • callback_data -- (optional) data the skill can use to take additional actions

Usage:

...
def initialize(self):
    self.add_event('question:action',
                   self.handler_action)

def handler_action(self, message):
    # code to excecute when question:action message detected...
...
...
def some_method(self):
    self.bus.emit(Message('question:action'))
...
python3 -m mycroft.messagebus.send 'question:action'

Mycroft Alarm Skill

private.mycroftai.has_alarm

Count of running alarms (0 == no alarms)

Data:

{"active_alarms": COUNT }

Usage:

...
def initialize(self):
    self.add_event('private.mycroftai.has_alarm',
                   self.handler_private_mycroftai_has_alarm)

def handler_private_mycroftai_has_alarm(self, message):
    # code to excecute when private.mycroftai.has_alarm message detected...
...
...
def some_method(self):
    self.bus.emit(Message('private.mycroftai.has_alarm',
                              {"active_alarms": COUNT }))
...
python3 -m mycroft.messagebus.send 'private.mycroftai.has_alarm' '{"active_alarms": COUNT }'

PROPOSED

skill.namespace.*

e.g. "skill.mycroft.noftify.alarm_changed" or "skill.jaguar.notify.car_stopped"

Usage:

...
def initialize(self):
    self.add_event('skill.namespace.*',
                   self.handler_skill_namespace_*)

def handler_skill_namespace_*(self, message):
    # code to excecute when skill.namespace.* message detected...
...
...
def some_method(self):
    self.bus.emit(Message('skill.namespace.*'))
...
python3 -m mycroft.messagebus.send 'skill.namespace.*'

private.github_username.*

for private (not intended to be used by anyone else)

Usage:

...
def initialize(self):
    self.add_event('private.github_username.*',
                   self.handler_private_github_username_*)

def handler_private_github_username_*(self, message):
    # code to excecute when private.github_username.* message detected...
...
...
def some_method(self):
    self.bus.emit(Message('private.github_username.*'))
...
python3 -m mycroft.messagebus.send 'private.github_username.*'
MessageBus documentation