Skip to content

MCHellspawn/hermes-app-time

Repository files navigation

Rhasspy Time Skill (Rhasspy_App_Time)

A skill for Rhasspy that provides various time related intents including the current time, the time in another timezone, and the time difference between the current timezone and another. This skill is implemented as a Hermes app and uses the Rhasspy-hermes-app library. The script can be run as a service, or as a docker container (recommended).

Installing

Requires:

  • rhasspy-hermes-app 1.1.2
  • pytz 2022.7
  • backports.zoneinfo 0.2.1

In Docker:

To install, clone the repository and execute docker build to build the image.

sudo docker build hermes-app-time -t <image_name>

In Rhasspy:

Create a new sentence file and copy the sentences from the sentences.ini into the new file in Rhasspy and save. Retrain Rhasspy.

Setup the slot program:

  1. SSH into the Rhasspy device
    • If using a base/satellite setup this is typically done on the base
  2. Navigate to your slot programs folder
    • for example "/profiles/en/slot_programs"
cd /profiles/en/slot_programs
  1. Create a folder name "time" and navigate to it
mkdir time
cd time
  1. Download the slot program from the github repo
wget https://raw.githubusercontent.com/MCHellspawn/hermes-app-time/master/slot_programs/timezones
  1. Setup the slot variables
timezones = $time/timezones
  1. Use the slot variable in a sentence
what time is it in [the] (<timezones>){timezone} [timezone]

Configuration

The TZ environment variable needs to be set to the a valid linux timezone value when creating the docker container.

It is not necessary but you may also edit the config/responses.txt file to add or remove some of the available responses for an intent.

Using

Build a docker container using the image created above.

Bind the config volume <path/on/host>:/app/config

sudo docker run -it -d \
        --restart always \
        --name <container_name> \
        -e "TZ=America/New_York" \
        -e "MQTT_HOST=<MQTT Host/IP>" \
        -e "MQTT_PORT=<MQTT Port (Typically:1883)" \
        -e "MQTT_USER=<MQTT User>" \
        -e "MQTT_PASSWORD=<MQTT Password>" \
        <image_name>

Or with docker-compose:

version: "3.3"
services:
    time_skill:
        restart: always
        container_name: app-time
        environment:
            - TZ=America/New_York
            - MQTT_HOST=<MQTT Host/IP>
            - MQTT_PORT=<MQTT Port (Typically:1883)
            - MQTT_USER=<MQTT User>
            - MQTT_PASSWORD=<MQTT Password>
        image: <image_name>

The following intents are implemented on the hermes MQTT topic:

[TimeGetTime]

[TimeTzDiff]

To-Do

  • Clean up install process
  • More intents
    • Time stuff <any ideas?>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published