Alexa Style Unit Conversion

I was baking something earlier today, and had to ask Alexa how many ounces were in a gallon. It then occurred to me that I do not know how I would implement this in Rhasspy. My first thought is to just use a sentence of:

How many ($units) {unit1} are in [a] ($units) {unit2}?

and have home assistant process the logic using if statements.

Has anyone else had to implement something similar? Is there a plugin that does this? Is math an option either?

Thanks for any help

Good question, you’d need someone/something that answers your question (not the text, the solution). :slight_smile:

The problem is, this is not the job for Rhasspy, as it is a voice assistant. Rhasspy “translates” for something else like HA. To answer your questions or better looking for the solution is always part of another software.

Rhasspy gets text from you, that it translates and then it gets text from ??? to speak to you. :slight_smile:

I’m not sure how to solve such a thing, as I wouldn’t know how to answer your question. If you’d like to do it with HA, HA would need either a complete table with units and their conversions, or you should try a Goggle (or ther search engine) and process the data.

Either way is complicated, as long as you don’t have your own server with a custom Google search engine…

And not to forget, you’d need to train Rhasspy to learn how to get your intent, if you ask a “free text”.