GithubHelp home page GithubHelp logo

Comments (5)

rhamar avatar rhamar commented on August 18, 2024 1

So what I found is that the MQTT client will not send information to the MQTT broker when no probe is connected.

I did a little deep dive.

igrill.py, line 153:
temps[probe_num] = float(temp) if float(temp) != 63536.0 else "False"

/usr/local/lib/python2.7/dist-packages/paho/mqtt/publish.py, line 168:
payload : the payload to be published. If "" or None, a zero length payload will be published.

If you want the mqtt client to send a message with a payload with no probe connected, you should change line 153 into the following:
temps[probe_num] = float(temp) if float(temp) != 63536.0 else "None"

And that did the trick (see screenshot). Now I have to modify Home Assistent so it can handle this value.

image

To be continued

from igrill.

PaulAntonDeen avatar PaulAntonDeen commented on August 18, 2024 1

Works wonders! Tanks!

from igrill.

souhl avatar souhl commented on August 18, 2024

My guess is that it just shows the last value received. (Wherever you display the values)
When a probe is just removed it should be the same, as only new values are shown. If the displaying entity is never receiving a „unknown“ value it won’t display it by its own. A solution might be to send one „unknown“ state message after a period of time not receiving new values from the probe.

from igrill.

bendikwa avatar bendikwa commented on August 18, 2024

This was by design when I implemented it.
I am not using Home Assistent for this project (I am using Prometheus/Grafana), and changing this would brake my setup, but I will consider making behaviour for disconnected probes configurable in a future release.

from igrill.

bendikwa avatar bendikwa commented on August 18, 2024

Better late than never: ;-)

I have added a new feature for this now:
Device config now takes 2 new optional flags.

publish_missing_probes: False                    # Optional default False - Enable sending a value for non-connected probes
missing_probe_value:    'missing'                # Optional default 'missing' - Value to send if publish_missing_probes is True

-Bendik

from igrill.

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.