Fixing RPI-Reporter for Home Assistant

In a previous article I explained how to install RPi-Reporter to monitor a Raspberry pi with Home Assistant. However in an aid to try and keep it up-to-date the developer added in some code to allow it to auto update. Unfortunately if the http site this points to cannot be seen then the whole RPi reporter will fail. This can happen if you are behind a firewall blocking this and has caused some people issues already. More importantly, recently, this site has become unavailable and has caused it to fail and therefore the fix has become necessary for all.

Fixing this is, however, a very simple process:

First, we need to go the directory that the py file is installed in and open it in an editor (in my case nano)

cd /opt/RPi-Reporter-MQTT2HA-Daemon/
sudo nano ISP-RPi-mqtt-daemon.py

Then we need to search for getDaemonReleases and comment out the appropriate lines of code:

        daemon_version_list = newVersionList
        print_line('- RQST daemon_version_list=({})'.format(daemon_version_list), debug=True)
        daemon_last_fetch_time = time.time()    # record when we last fetched the versions

#getDaemonReleases() # and load them!     <-------- Add a # at the start of this line
print_line('* daemon_last_fetch_time=({})'.format(daemon_last_fetch_time), debug=True)

# -----------------------------------------------------------------------------
#  RPi variables monitored
# -----------------------------------------------------------------------------

This second one is not strictly necessary but done for completeness:

# now just hang in forever loop until script is stopped externally
try:
    while True:
        #  our INTERVAL timer does the work
        sleep(10000)

        timeNow = time.time()
        #if timeNow > daemon_last_fetch_time + kVersionCheckIntervalInSeconds:  <-------- Add a # at the start of this line
        #   getDaemonReleases() # and load them!                                <-------- Add a # at the start of this line

        if apt_available:
            if timeNow > update_last_fetch_time + kUpdateCheckIntervalInSeconds:
                getNumberOfAvailableUpdates() # and count them!

finally:

RPi-reporter should then begin to work again! Personally I would recommend doing this regardless of if the site it points to comes back online as there have been no updates to this in a long time. So rather than risk this happening again, remove the offending code and check and apply any updates manually should they ever be done

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top