Giter VIP home page Giter VIP logo

mqtt-autodiscover's Introduction

MQTT Autodiscover made easy

MQTT autodiscover Homeassistant made easy

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

  1. Home Assistant (ver. 0.115.x )

  2. A Python EDI editor for Windows 10, I use Eric-6 EDI, https://eric-ide.python-projects.org/, which is very easy to install and use.

  3. MQTT server (I am running on a Synology NAS in docker) If you have a Synology NAS, I can recommend to follow BeardedTinker on YouTube, he makes a very intuitive explanation how to setup the whole Home Assistant environment on Synology.

  4. You will need the following in your configuration.yaml file:

    python_script:

    mqtt: broker: 192.168.1.64 discovery: true discovery_prefix: homeassistant (Default, it is the folder where you have your configuration.yaml file)

Installing

Below a step by step that tell you how to get a development/production environment up and running, and to make things even more easy,

IF BEARDEDTINKER makes a video, it will be referred to here:

BeardedTinker have created the tutorial on YouTube, which gives a detailed instruction how to get it all to work.

He has performed a tremendous task in doing this.

I highly recommend that your see and follow this video, as you then will have success in setting the up the Autodiscover on Home Assistant.

After seeing the videos, remember to give a "Thumbs Up" to support BeardedThinker in his work.

Mapping the mqtt json message to the Python script:

Mapping of the JSON message, is actually very simple, just a lot of writing.

I have used an example from my Fronius Inverter, but no matter what sensor you want to map, procedure are the same.

This is the end of the mapping

Be careful when writing in the Python program, use preferably a Python EDI, as Python is build with syntaxes around "whitespaces", which is very difficult to control in a simple text editor.

The Python Part - The Autodiscover - MAGIC

The Python script named:

mqtt-aut.py**

you install in the folder python_scripts in your Home Assistant config folder, If you do not have that folder already, you need to create it.

The Home Assistant config folder, is where you also have your configuration.yaml file.

You find and execute the Python script, in the menu "Developer Tools"/"SERVICES", where you will find it named:

python_script.mqtt-aut

Running the Python_sscript.mqtt-aut

You just press the "CALL SERVICE" button, and all the sensors from mqtt will be autodiscovered and added to your menu "Configuration"/"integrations", where you will find the MQTT integration, and here you can select the devices, and then select Solar_Power, and all sensors will be shown. You can use the "ADD TO LOVELACE" function, or you can add them manually to any LOVELACE card you want.

Deployment

See instructions under Prerequisites

Versioning

1.0.0 First official release

Authors

  • Per Rose
  • BeardedTinker (contributer)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

If you like and use my program, then

โ€‹ BMC

it will be appreciated.

mqtt-autodiscover's People

Contributors

pesor avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.