Coder Social home page Coder Social logo

mesh-skill's Introduction

Mesh

send MQTT messages and commands between multiple mycroft.ai devices.

About

A flock of Seagulls, a pride of Lions, a swarm of Bees, and a "mesh of Mycrofts".

This skill utilizes the lightweight MQTT messaging protocol to connect a group ("mesh") of Mycroft units together. The skill has the ability to send messages (intercom) and commands (messagebus) to one or more remote Mycroft units.

  1. Each Mycroft unit has the ability to publish both Mycroft requests and responses to the the MQTT broker. The MQTT Topics for this communication is...
    • <base_topic>/RemoteDevices/deviceUUID/request
    • <base_topic>/RemoteDevices/deviceUUID/response
  2. The deviceUUID is a unique ID created from the MAC of the sending Mycroft unit. *This is intended to be a general MQTT broadcast and can be subscribed to by any MQTT client (ie. Home Assistant?).
  3. Each Mycroft unit has it's own Device Name (location_id) that can be set in the web interface.
  4. The Mycroft unit will automatically subscribe to all messages sent to it's own Device Name (location_id).
    • <base_topic>/RemoteDevices/<location_id>
  5. When a message is sent from any Mycroft unit, the message will be published to "Mycroft/RemoteDevices/location_id".
  6. The destination location_id is specified in the skill dialog.
  7. The message payload will contain the following Json...
    • {"source":"<source_location_id>", "message":"is dinner ready yet"}

Examples

  • "Send a remote message"
  • "Send a remote command"

Credits

pcwii

Category

IoT

Tags

#mesh #remote #connect #control #MQTT #HA #Homeassistant

Overview

Overview

Conversational Context

  • Example 1 (from basement to kitchen)
hey mycroft...
    send a message...
where would you like to send the message?...
    kitchen...
what would you like the message to be?...
    Is dinner ready yet?
I am preparing to send a, message, to the, kitchen, device.
mycroft publishes...
"<base_topic>/RemoteDevices/kitchen/{"source":"basement", "message":"is dinner ready yet"}
  • Example 2 (from kitchen to basement)
hey mycroft...
    send a command...
where would you like to send the command?...
    basement...
what would you like the command to be?...
    set a timer for 5 minutes?
Sending command, to the basement.
mycroft publishes...
"<base_topic>/RemoteDevices/basement/{"source":"kitchen", "command":"set a timer for 5 minutes"}

Installation Notes

  • ensure you have a working MQTT Broker. how to install mqtt broker.
  • SSH and run: msm install https://github.com/pcwii/mesh-skill.git
  • Configure home.mycroft.ai
    • Ensure MQTT is enabled.
    • Create a custom base topic name <base_topic>.
    • Set IP Address of your broker
    • Set the websocket Port of your broker.
    • Set the location ID of this mycroft unit <location_id>.
    • This skill must be installed, and configured for each unit in your "mesh"
    • MQTT paths are case sensitive

Requirements

Warnings!!

  • It is not recommended to use a public MQTT broker at this time as this could expose your commands to other Mycroft Units, or other devices subscribing to your topic.
    • Ensure you use a unique <base_topic> for your group (mesh) of mycroft units.
    • You may segment your groups (meshes) by using different <base_topic> for each group (mesh).

Todo

  • Connect subscribed "commands" to message bus (20191231)
  • Investigate enabling remote mycroft to reply to messages (20191231)
    • {"source":"basement", "message":"is dinner ready yet", "reply": True}
  • Provide a customization for Topic Names to increase security.(20191231)
  • Add prompting on remote receiving device before playing messages.(20191231)
    • Not sure this has value if room is unoccupied.
  • Add prompting on remote receiving device before executing commands messages.(20191231)
    • Not sure this has value if room is unoccupied.
  • Redirect remote responses to the commanding mycroft unit (20200102)
  • Autodiscovery???(20191231)

mesh-skill's People

Contributors

pcwii avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.