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).
Requires:
- rhasspy-hermes-app 1.1.2
- pytz 2022.7
- backports.zoneinfo 0.2.1
To install, clone the repository and execute docker build to build the image.
sudo docker build hermes-app-time -t <image_name>
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:
- SSH into the Rhasspy device
- If using a base/satellite setup this is typically done on the base
- Navigate to your slot programs folder
- for example "/profiles/en/slot_programs"
cd /profiles/en/slot_programs
- Create a folder name "time" and navigate to it
mkdir time
cd time
- Download the slot program from the github repo
wget https://raw.githubusercontent.com/MCHellspawn/hermes-app-time/master/slot_programs/timezones
- Setup the slot variables
timezones = $time/timezones
- Use the slot variable in a sentence
what time is it in [the] (<timezones>){timezone} [timezone]
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.
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]
- Clean up install process
- More intents
- Time stuff <any ideas?>