Giter Club home page Giter Club logo

hass_mqtt_device's Introduction

Library for communicating with Home Assistant

hass_mqtt_device is a C++ library designed to simplify creating a device and connecting it to a Home Assistant MQTT server.

There are a number of functions and device types available. See the examples for more info on how to use the library.

Requirements

Build requirements

  • A modern C++ compiler with C++17 support.
  • CMake version 3.10 or higher for building the project.
  • Mosquitto MQTT broker development package
  • Spdlog
sudo apt update
sudo apt install cmake libspdlog-dev nlohmann-json3-dev git libmosquittopp-dev

Also you need wiring-pi for raspberry pi setups:

wget https://github.com/WiringPi/WiringPi/releases/download/3.4/wiringpi_3.4_arm64.deb
sudo dpkg -i wiringpi_3.4_arm64.deb
rm wiringpi_3.4_arm64.deb

Optional

  • gTest

Installation

  1. Clone the repository:
git clone https://github.com/KodeZ/hass_mqtt_device.git
  1. Navigate to the project directory and create a build directory:
cd hass_mqtt_device
  1. Configure and build the project:
make
  1. (Optional) Install the library to your system:
sudo make install

Usage

There are a few devices defined for comfort. See the devices folder. It is rather easy to make your own devices by inheriting from DeviceBase, then add functions from the functions folder, or create your own functions from FunctionBase.

Examples

In the examples folder there are a few examples on how the library can be used.

Contributing

If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

License

See the LICENSE file, but in short it is MIT.

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.