Playing with the Spa

We have an Arctic Spa at our house which we enjoy. Recently, an OpenAPI spec has been published for it, so I decided to write a Java wrapper so I could control the spa myself, and monitor temperature with Prometheus and Grafana.

The resulting code is here. The wrapper class “com.khubla.kspa.Spa” takes care of all the API details, so that status and control of the Spa is as simple as:

Spa spa = new Spa("abc123");
Status status = spa.getStatus();
System.out.println("Temperature :"+status.getTemperature());

Similar Posts

  • Apache Commons Math

    Commons Math is an Apache library which includes a variety of mathematical tools, including 1st and 2nd-order ODE solvers.  In order to familiarize myself with the ODE solvers, I wrote a simple program to solve an RC charging circuit. The circuit has these parameters: R (ohms), the resistance of the resistor C (farads), the capacitance…

  • jvmBasic 2.0

    I’ve always had a fascination with compilers.  As a Java geek, I’m also quite interested in the JVM.  In order to learn a little more about both, and as a way to contribute to the open source world, I decided to implement a compiler for BASIC.   So, jvmBasic consumes BASIC code and emits .class…

  • TNT

    If you haven’t read this book, I highly recommend it.  I discovered it in high school and finally purchased my first copy at the now-gone Duthie Books in Kitsilano.  Without going into the details of the book, the author uses a simple Peano arithmetic called Typographical Number Theory  (TNT) to illustrate some of his points. An example…

  • |

    Embedding Jasper

    Jasper is the JSP compiler inside Tomcat. For reasons, mainly of curiosity, I wanted to build a Pragmatach plugin which exposes Jasper.  Pragmatach supports some template engines such as FreeMarker, ThymeLeaf and Velocity, but I thought Jasper would be a good addition. I chose to use Tomcat 6, mainly because Tomcat 7 uses Servlet 3.0.  Pragmatach…

  • OpenAPI

    I recently had reason to get to know OpenAPI at work, so I decided to become familiar with it. I have a HomeSeer home controller at home, which exposes a JSON API, so I decided to write a Java OpenAPI server to expose the JSON API over OpenAPI. The net result is hsOpenAPI. It exposes…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.