Giter Club home page Giter Club logo

Comments (4)

OttoWinter avatar OttoWinter commented on July 20, 2024

The unavailable light thing is I think because of a bug that was in the master branch two days ago, but I think it should be fixed now ❤️ A good place to log for more information are always the MQTT topics displate_leds/# and homeassistant/+/displate_leds/# (the latter for Home Assistant MQTT discovery)

About the auto discovered items not disappearing: Yes, I know why that happens, but I sadly don't know how to fix it. See, to make Home Assistant "auto discover" an entity, esphomelib sends a MQTT message to the MQTT topic homeassistant/sensor/heatpump/outside_temperature/config with a payload like this:

{
  "name": "Outside Temperature",
  "platform": "mqtt",
  "state_topic": "heatpump/sensor/outside_temperature/state",
  "availability_topic": "heatpump/status",
  "unit_of_measurement": "°C",
  "expire_after": 675
}

This tells Home Assistant that there's a sensor called "Outside Temperature" on the MQTT topic heatpump/sensor/outside_temperature/state. But in order for this discovery to work when Home Assistant is restarted, we have to retain those messages, i.e. tell the broker to re-send those messages to every client on each reconnect. Otherwise all your sensors wouldn't show up when Home Assistant restarts. But because these messages are retained, they will be re-sent even though the sensor (or light) doesn't exist anymore.

I have a small script that I will try to publish soon that will "clean up" all retained messages from MQTT discovery so that Home Assistant doesn't see them again, and I will try to publish it with the next esphomelib release (hopefully today or tomorrow)

from esphome-core.

geelenbert avatar geelenbert commented on July 20, 2024

works like a charm!

Looking forward to the cleaning script

from esphome-core.

OttoWinter avatar OttoWinter commented on July 20, 2024

Sorry for the delay, I've been caught up in real-life stuff a bit. Anyway... the clean script is now available in esphomeyaml: https://esphomelib.com/esphomeyaml/components/mqtt.html#using-with-home-assistant. See the clean-mqtt comment in there ❤️

from esphome-core.

OttoWinter avatar OttoWinter commented on July 20, 2024

So the script is now out here https://esphomelib.com/esphomeyaml/components/mqtt.html#using-with-home-assistant and it should help working around the issue. As there's no real way esphomelib can solve the problem I'm closing this issue

from esphome-core.

Related Issues (20)

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.