Platform Supported
Language Stats
Repo Stats
Code Stats
Deployments
Activity
Development and Maintenance
Reach Out
MacOS
Tested on macOS High Sierra, Mojave, Catalina, Big Sur, Monterey and Ventura*
System Preferences
→ Security & Privacy
→ Privacy
+
sign and add the preferred IDE
and Terminal
in the following sections in left pane.
Microphone
- Required to listen and respond.Accessibility
- Required to use key combinations for brightness and volume controls.Camera
- [Optional] Required only during face recognition/detection.Automation
- Required to control System Events
and other apps like Outlook and Calendar.Files and Folders
[OR] Full Disk Access
- Required for all FileIO
operations.⚠️ Known Issue with pyttsx3 module on macOS Ventura 13.0: This version of macOS does not hold the attribute VoiceAge
. Workaround has been raised as a PR
Windows
Tested on Windows 10
Settings
→ Privacy
Microphone
- Required to listen and respond.Camera
- [Optional] Required only during face recognition/detection.macOS
, Windows
pops a confirmation window to Allow or Deny access to files and folders.PATH
in Environment VariablesLinux
Tested on Ubuntu 22.04 LTS
ROOT_PASSWORD
Ubuntu
does not have app specific permissions.Install
python -m pip install jarvis-ironman
Initiate
import jarvis
if __name__ == '__main__':
jarvis.start()
Camera
from jarvis.modules.camera import camera
if __name__ == '__main__':
cam_object = camera.Camera()
print(cam_object.get_index()) # Get index id of each camera
print(cam_object.list_cameras()) # List all connected cameras
Text to Speech
from jarvis.modules.speaker import speak
if __name__ == '__main__':
speak_object = speak.Speaker()
speak_object.run()
print(list(speak_object.get_all_voices()))
Speech to Text
import asyncio
from jarvis.modules.microphone import recognizer
if __name__ == '__main__':
asyncio.run(recognizer.main())
Environment variables are loaded from a .env
file and validated using pydantic
ROOT_PASSWORD - System password to get the system vitals and run other sudo
commands. Mandatory for Linux
NAME - Name which Jarvis should address the user by. Defaults to Vignesh
TITLE - Title which Jarvis should address the user by. Defaults to sir
PLOT_MIC - Boolean value whether to show microphone usage in realtime. Defaults to True
WAKE_WORDS - List of wake words to initiate Jarvis' listener. Defaults to ['jarvis']
(Defaults to ['alexa']
in legacy macOS)
⚠️ Jarvis has limitations on the wake words as it relies on ML libraries for wake word detection.
VOICE_NAME - Name of the voice supported by the OperatingSystem. Defaults to the author's favorite.
VOICE_RATE - Speed/rate at which the text should be spoken. Defaults to the value from pyttsx3
module. Typically 200
macOS:
- System Preferences → Accessibility → Spoken Content → System voice → Manage Voices...
Windows:
- Settings → Time & Language → Speech → Manage voices → Add voices
SENSITIVITY - Hot word detection sensitivity. Allowed range: [0-1] Defaults to 0.5
TIMEOUT - Timeout in seconds until which the listener should wait for speech. Defaults to 3
PHRASE_LIMIT - Timeout in seconds until which the listener will remain active. Defaults to None
LIMITED - Boolean flag to run only the main version of Jarvis
skipping background processes. Defaults to False
Enforced based on the number of CPU cores.
DEBUG - Boolean flag to enable debug level for logging. Defaults to False
RECOGNIZER_SETTINGS - A JSON object that has with customized speech recognition settings.
These are customized according to the author's voice pitch. Please use recognizer.py to figure out the suitable values on a trial and error basis.
These settings are added (optionally), to avoid the hard coded
PHRASE_LIMIT
Cons in using hard codedPHRASE_LIMIT
:
- Disables the listener after the set limit even the speaker is actively talking.
- Listener will be active until the set limit even after the speaker has stopped talking.
Sample settings (formatted as JSON object)
RECOGNIZER_SETTINGS
: '{"energy_threshold": 1100, "dynamic_energy_threshold": false, "pause_threshold": 2, "phrase_threshold": 0.1, "non_speaking_duration": 2}'
Description
energy_threshold
: Minimum audio energy to consider for recording. Greater the value, louder the speech should be.dynamic_energy_threshold
: Change considerable audio energy threshold dynamically.pause_threshold
: Seconds of non-speaking audio before a phrase is considered complete.phrase_threshold
: Minimum seconds of speaking audio before it can be considered a phrase - values below this are ignored. This helps to filter out clicks and pops.non_speaking_duration
: Seconds of non-speaking audio to keep on both sides of the recording.24-April
GMAIL_USER
can be re-used)GMAIL_PASS
can be re-used)iOS integrations
+11234567890
+11234567890
Calendar/Meeting integrations
.ics
outlook
or calendar
application in macOS
. Defaults to calendar
calender
is used, the name of the calendar within the Calendar.app
should be Jarvis Background scans [Defaults to 1 hour]
meetings
information using an ics
URL.events
information using calendar
or outlook
application.VPNServer integration
Car Controls - Applies only for JLR vehicles subscribed to InControl
application.
Garage Controls - Applies only for garages using MyQ garage controller.
Telegram Bot integration
SPEECH_SYNTHESIS_TIMEOUT - Timeout to connect to the docker container that processes text to speech requests.
SPEECH_SYNTHESIS_VOICE - Voice for the speech synthesis model. Defaults to author's favorite.
SPEECH_SYNTHESIS_QUALITY - Quality of speech synthesis conversion. Defaults to medium
.
docker run \
-it \
-p 5002:5002 \
-e "HOME=${HOME}" \
-v "$HOME:${HOME}" \
-v /usr/share/ca-certificates:/usr/share/ca-certificates \
-v /etc/ssl/certs:/etc/ssl/certs \
-w "${PWD}" \
--user "$(id -u):$(id -g)" \
rhasspy/larynx
💡 Speech Synthesis can run on a docker container for better voices but, response might be negligibly slower. If you don't have docker installed or simply don't want to use it, set the SPEECH_SYNTHESIS_TIMEOUT
env var to 0. This is also done automatically if failed to launch a docker container upon startup.
4483
OfflineComm
1
Stock Portfolio
API Features
/surveillance
. Defaults to 300 seconds.There are two options to run background tasks on Jarvis.
Jarvis can run internal tasks (offline communicator compatible) at certain intervals using a background_tasks.yaml
file stored in fileio
directory.
This is the sample content of background_tasks.yaml
- seconds: 1_800
task: just turn off all lights # Runs every 30 minutes - 'just' flag retains the lights' last setting (eg: brightness or color)
- seconds: 10_800
task: remind me to drink water # Runs every 3 hours ignoring the hours specified
ignore_hours:
- 21
- 22
- 23
- 0
- 1
- 2
- 3
- 4
- 5
- 6
CRONTAB - Runs external tasks using cron expressions. Needs to be stored as env var.
[
"0 0 * * 1-5/2 find /var/log -delete",
"0 5 * * 1 tar -zcf /var/backups/home.tgz /home/"
]
Jarvis can send on demand notifications using a contacts.yaml
file stored in fileio
directory. Uses gmail-connector for SMS and email notifications.
Note: Jarvis currently supports sending emails only when the
contacts.yaml
file is present, however phone numbers can be used directly.
phone:
Tony: 0123456789
Thor: 1234567890
email:
Eddard: [email protected]
Aegon: [email protected]
A source file smart_devices.yaml
is used to store smart devices' hostnames.
Jarvis supports MagicHome
for lights, LGWebOS
and Roku
for TVs.
TV hostnames should include the brand name [LG
/Roku
] to distinguish the modules accordingly.
To wake up Roku
TVs using MAC address, make sure the Bandwidth saver
feature is turned off under,
Settings/Network/Bandwidth saver >> Off
For first time users on LGWebOS
TVs, there will be a prompt on the TV to accept the connection request.
smart_devices.yaml
file to avoid repeated connection prompt.tv
to distinguish between lights and tv.smart_devices.yaml
) should be as following:bedroom:
- 'HOSTNAMES'
hallway:
- 'HOSTNAMES'
hallway basement:
- 'HOSTNAMES'
kitchen:
- 'HOSTNAMES'
living room:
- 'HOSTNAMES'
party mode: # Light hostnames that needs to be engaged for party mode, if not present individual lights can be enabled
- 'HOSTNAMES'
living room tv:
hostname: 'HOSTNAME'
client_key: 'CLIENT_KEY' # Generated automatically if unavailable
mac_address: # Mac addresses can either be a string or a list
- 'WIRED_MAC_ADDRESS'
- 'WIRELESS_MAC_ADDRESS'
bedroom tv:
hostname: 'HOSTNAME'
mac_address: 'MAC_ADDRESS'
Jarvis can execute offline compatible tasks
at pre-defined times without any user interaction. Uses an automation.yaml
file as source which should be stored
within the directory fileio
The YAML file should be a dictionary within a dictionary that looks like the below.
OPTIONAL: The key, day
can be a list
of days, or a str
of a specific day or simply a str
saying weekday
or
weekend
when the particular automation should be executed.
Not having the key
day
will run the automation daily. Date format should match exactly as described below.
06:00 AM:
day: weekday # Runs only between Monday and Friday
task: set my bedroom lights to 50%
06:30 AM:
day: # Runs only on Monday, Wednesday and Friday
- Monday
- wednesday
- FRIDAY
task: set my bedroom lights to 100%
08:00 AM: # Runs only on Saturday and Sunday
day: weekend
task: set my bedroom lights to 100%
09:00 PM: # Runs daily
task: set my bedroom lights to 5%
12:00 AM: # Even performs tasks that are not supported via voice commands
task: restart all background processes
Jarvis can execute offline compatible tasks
as a simulation to test the required functions and send an email with the results. Uses an simulation.yaml
file as source which should be stored
within the directory fileio
The YAML file should be a list of phrases within a dictionary that looks like the below.
meeting_event:
- get me the events from my calendar
- what meetings do I have today
Please refer wiki for API usage, access controls, env variables, features' overview and demo videos.
Docstring format: Google
Styling conventions: PEP 8
Clean code with pre-commit hooks: flake8
and
isort
Requirement
python -m pip install changelog-generator
Usage
changelog reverse -f release_notes.rst -t 'Release Notes'
PreCommit
will ensure linting, and the doc creation are run on every commit.
Requirement
pip install sphinx==5.1.1 pre-commit recommonmark
Usage
pre-commit run --all-files
https://pypi.org/project/jarvis-ironman/
https://thevickypedia.github.io/Jarvis/
© Vignesh Sivanandha Rao
Licensed under the MIT License