Giter Club home page Giter Club logo

ooler-mqtt-bridge's Introduction

ooler-mqtt-bridge

A bridge between an Ooler bed cooling/heating system and MQTT, targetting Home Assistant

Overview

This repo contains a service to allow for integrating your Ooler device with Home Assistant, using Bluetooth LE to talk to the Ooler, and MQTT to communicate with Home Assistant. As such, you will need an MQTT broker set up somewhere, and hardware capable of speaking Bluetooth LE on the system you are running this on. I'm using a Raspberry Pi Zero W.

The data that are exposed are:

  • Desired temperature (°C)
  • Actual temperature (°C)
  • Power state ("off" or "auto", "auto" being on)
  • Fan speed ("Silent", "Regular", or "Boost")
  • Water level (which I think is percentage, but have only seen values of 100 and 50 so far)
  • UV cleaning state

Parameters that can be controlled are:

  • Desired temperature (°C)
  • Power state
  • Fan speed
  • UV cleaning

Whilst this does target Home Assistant, and publishes an autoconfiguration message for Home Assistant to pick up on to seamlessly integrate it as an HVAC unit, there is nothing stopping you from using it without Home Assistant, as long as you are capable of parsing JSON in your consumer. Take a look at the configuration message sent by the bridge to see where to find the data.

This repo contains two key parts:

  • A module for talking to Ooler devices
  • A script which uses this module to send status reports via MQTT, and to receive control commands

If anyone cares I would be happy to split out the module into its own thing; for simplicity/not having to look up how to create a PyPI package I've left it in here for now.

Installation/Configuration

Installation consists of pulling in the packages listed in requirements.txt and putting the files of this repo somewhere. Optionally customise and install the systemd unit file provided to have it be nicely managed. Note that there is a minimum Python version requirement of 3.11, see the older-python-support tag if you aren't quite there yet.

To configure it, edit the yaml file that is provided and pass this as an option on the command line. The configuration is documented in this file.

Limitations

I had intended to make this support either staying connected indefinitely or disconnecting/reconnecting to read/set state, but I had difficulty with fully disconnecting, so it only supports permanent connection. Since Bluetooth LE only allows a single connection at a time, this means you cannot use the app to control the Ooler whilst this is running.

I have had issues with Python segfaulting, so I'm not able to properly handle all errors, and so I'm running this with it set to restart when it falls over. I would advise running it like this, e.g. with systemd.

This only works with unencrypted MQTT brokers - I imagine support shouldn't be too hard to add, it's just not something I need at the moment.

The Ooler works in Fahrenheit internally, so the Celsius mappings are a bit clunky (and greater than the amount of precision allowed by the device). This is also true of the app. The underlying library allows for control via Fahrenheit, but the bridge only supports Celsius.

I have only been able to test this on one device, so I don't know if there are any differences between different setups. This also only supports one device being configured, again, because I only have the one so wouldn't be able to use or test supporting more than one.

ooler-mqtt-bridge's People

Contributors

sredman avatar turmoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sredman

ooler-mqtt-bridge's Issues

Move to a different BLE library

I'm having issues with gattlib that means this has to stay connected, that means you cant use the app. It should probably use a different library - Home Assistant uses and recommends https://github.com/hbldh/bleak , so I'll probably look at that, but it will require thinking about how to rework it to use an async library. What I have right now works well enough for me, so I'll be prioritising other things.

Periodically re-send configuration messages

If Home Assistant is restarted, it'll forget about the Ooler until a configuration message is sent again. At the moment this never happens. One should be scheduled relatively frequently to avoid this happening.

current temperature shows invalid temp

All is working well except current temperature shows a minus value which does change as temp changes... Desired temperature
16 is correct.
When the current temp is 16 it shows -9

screenshot 96

HACS integration

Hello, might I suggest HACS integration for seamless utility? Ooler suffers from a single simultaneous connection so Home Assistant gives the ability to circumvent this limitation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.