hjelev / rpi-mqtt-monitor

Raspberry Pi MQTT Monitor gathers system information and sends it to a MQTT server.
GNU General Public License v3.0
176 stars 42 forks source link

Feature Request: Update Entity #30

Closed CFenner closed 8 months ago

CFenner commented 8 months ago

A update entity that makes use of #28 to display when there are changes and enabled a remote update.

hjelev commented 8 months ago

How do you imagine this remote update? I have updated the script to support update but not sure how to trigger the update via hass, most probably via mqtt message but still thinking about it. If you have some ideas I'll be happy to hear them.

CFenner commented 8 months ago

I know that https://github.com/tbnobody/OpenDTU uses also MQTT and is able to receive commands. No idea if there is a Mqtt server running or how the communication back is working. Looks like HA will publish a state to another topic, that you need to listen on.

Bildschirmfoto 2024-01-28 um 18 26 45 Bildschirmfoto 2024-01-28 um 18 26 02
hjelev commented 8 months ago

Thanks, I'll look into this. This is a very nice feature to have.

hjelev commented 8 months ago

I believe I've successfully implemented the remote updates through Home Assistant. To test this, please follow these steps:

  1. Update your local repository by running git pull.
  2. Execute the update script with python3 src/update.py.

Please note, you may encounter an error if there are missing variables in your config.py file. If this happens, refer to config.py.example and add the necessary variables to your config.py file.

Once updated, everything should operate smoothly in the upcoming updates.

CFenner commented 8 months ago

Looks nice, I could not test it though. Simply reverting on commit seems not to work to mimic an update available.

hjelev commented 8 months ago

Yes revering commit don't trigger the update, I am checking local and remote tag and if there is a difference update is active when I push the next update you'll be able to test it.

On Thu, Feb 1, 2024, 8:14 AM Christopher Fenner @.***> wrote:

Looks nice, I could not test it though. Simply reverting on commit seems not to work to mimic an update available.

— Reply to this email directly, view it on GitHub https://github.com/hjelev/rpi-mqtt-monitor/issues/30#issuecomment-1920585677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5ZSS5RTODBDZMEJBWKHXTYRMXE3AVCNFSM6AAAAABB6CROX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGU4DKNRXG4 . You are receiving this because you commented.Message ID: @.***>

CFenner commented 8 months ago

Update popped up 👍

But it's showing the new version two times?!

Bildschirmfoto 2024-02-01 um 16 23 07

Also when clicking update, there is not feedback. Window stays open and not "installing" or something else visible.

hjelev commented 8 months ago

I have noticed the version duplication and fixed that. Was the update successfull. I don't know how to provide feedback to hass regarding update status but for me it takes couple of seconds and the versions sync, status changes to up to date ... not perfect but the update is done

CFenner commented 8 months ago

Updating from 0.7.2 did not work. I updated now to 0.7.6 locally. Let's see how the next release goes.

hjelev commented 8 months ago

I have separated the update system in another thread so i can only check for updates once per hour or as configured and this broke the update system, version 0.6.10 fixes it, hope I don't break it anymore.

CFenner commented 8 months ago
Bildschirmfoto 2024-02-02 um 08 31 30

There is something going on with the verisions.

hjelev commented 8 months ago

I was fixing the update until late night and got it messed - fixed the release page and hope the update system is stable now. Now it should be possible to check for updates every hour or so not each time you send measurements to hass

hjelev commented 8 months ago

should work fine now