Release: Gemini AI Text Rewriter

Here's another one of my recent projects that I made for personal use, that I thought others here might find useful, so I posted it up on Hubitat Package Manager.

So this app is just a wrapper around a small part of the Google Gemini API. Specifically it allows for the rewriting of bits of text, providing an output that's been rewritten by Gemini. It stores the output in a hub variable named "geminiRewrittenText", that's configurable in the app.

There's a pretty extensive (AI generated) readme available here. Better to have AI created ReadMe than none at all, and writing a readme is just not my idea of fun.

Anyway, what I'm doing with this is I have a small custom app that takes a few devices as inputs, gets the text values from an attribute on their state, then generates a "morning announcement" with the values, concatenated together. The custom app is here, for reference.

There's also some HTTP endpoints exposed on the Gemini Text Rewriter app, tho admittedly they don't really do much to simplify the use compared to just using the Gemini API directly.

It's a bit of an advanced app (at least for now), since it really needs a "Morning Announcement" helper app to go with it. Depending on your needs, it shouldn't be too difficult to use mine as a starting point.

When I get a bit, I'll likely toss an (optional) child device for this, that allows for easier use within Rule Machine, allowing you to choose "run custom command" and provide a bit of text to rewrite.

It's available on HPM under the name "Gemini Text Rewriter".

Edit: turns out I did have a few minutes, and got an optional child device added in version 1.1.0: Release Gemini Text Rewriter 1.1.0 · DanielWinks/Hubitat-Public · GitHub

You can add that device, run "custom command" in Rule Machine, and either use a default "prompt" (setting available in the child device), or choose the command for "run with custom prompt" and provide it both the text to rewrite and a prompt of how you want it rewritten. The child device also has a "status" that gets updated to "success" once Gemini finishes, or "in progress" while it's working.

Have fun summarizing, rewording, etc. I get bored having the same TTS every day, so it's nice to have AI change things up.

8 Likes