Today I got the challenge in making a voice app to monitor and control my home. It should interact with the google Nest hub and with my smart awareness monitor (SAM). The smart awareness monitor has a “API” for this function.
The first idea is to say: “ok google, what is my energy use” and the answer would be something like: “your actual energy use is 2840 Watt.” Big question is how to start such a thing. Luckily there are tools for this and I started using the Dialogflow of Google to compose a dialog with my SAM. Reason: its free and well documented with examples.
The first thing I discovered that I am making a chatbot. This is a program that simulates talking to the machine with voice commands. The interaction model is called an agent. It handles the conversation with end-users. I want to know my energy use.
This is called an intent: this is a specific action from the user to invoke by using one of the defined terms. Ok already learned a lot. But now it gets already complicated, because “energy use”? Or is it usage. Gas usage or Electricity usage and, I have solar panels. What to do with negative energy usage, which is power production. Solution: For that there are entities: a property used by dialogflow to answer a request from the user. I already know that my problem is: the naming of the word energy use. It should be an entity called usage_type. This can be: water_usage, electricity_usage or gas_usage. You could also use synonyms for the usage_type entity: electricity; power, electricity use, electricity usage. But also for gas, gas usage, gas use, gas, heating. Already lost in the naming. These should be the right definitions and to do so, one should think it over thoroughly. The making of a voice app is not only a technical challenge, but the naming and making of a good interaction model makes or breaks the whole thing. Learning by doing. Back to the drawing board.
I am withdrawing from my computer and tools. Go outside doors and start with pen and paper making a good naming convention of the different entities and a logical interaction model. After that i will go on with the Fulfillment and Webhook services. Will report my progress and experience in a successively story next time.