Link Search Menu Expand Document Moon Sun
Table of contents
  1. Current Time
    1. How does it work?
    2. Download the flow

Current Time

This is the most basic skill Sherlock provides. With this skill you can ask for the time and Sherlock answers with a small phrase containing the current time.

How does it work?

This skill was realized with NodeRed, the flow is only three nodes big: Get time flow

The left node catches the GetTime intent. The function convertTimeToText gets the current Time and converts it into a nice text Sherlock should say. And the right node publishes the MQTT message with the text of the function to trigger the TTS. This is the content of the function convertTimeToText:

var time = new Date()
msg.payload = {text: "Es ist " + time.getHours() + " Uhr " + time.getMinutes(), siteId: "default", id: "testID"};
return msg;

Download the flow