Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Updates Available on Host #133

Open
shieldsit opened this issue Oct 14, 2024 · 12 comments
Open

Feature Request: Updates Available on Host #133

shieldsit opened this issue Oct 14, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@shieldsit
Copy link

shieldsit commented Oct 14, 2024

Thanks for taking the time to make this, it works really well!

I'd love to see an available updates entity if it's possible?

Thanks again!

@hjelev
Copy link
Owner

hjelev commented Oct 18, 2024

This is a good idea, I'll add it to the road map.

@f-hnt
Copy link

f-hnt commented Oct 22, 2024

I support the idea as well. :)

@Smarthome-Creator
Copy link

Same here, perhaps you can also add a switch to carry out updates on the Rpi?

My idea is to automate updates on my Rpi's. Unfortunately, you can't do this in HA via shell commands, as the connection is always cut after 60 seconds and you don't get a response as to whether it worked or not.

@hjelev hjelev added the enhancement New feature or request label Oct 24, 2024
@hjelev
Copy link
Owner

hjelev commented Oct 25, 2024

I have added apt updates sensor, its refreshed every hour by default.
You need to enable it manually after the update - its disabled by default.

@shieldsit
Copy link
Author

shieldsit commented Oct 25, 2024 via email

@webdeck
Copy link

webdeck commented Nov 8, 2024

@hjelev How does the updating from Home Assistant work? I have "git_update = True" and "update = True" in my config, it is running as a service, and Home Assistant is showing me that an update is available. I click the install button in Home Assistant and nothing appears to happen. Is there something else I need to do?

@f-hnt
Copy link

f-hnt commented Nov 8, 2024

@hjelev How does the updating from Home Assistant work? I have "git_update = True" and "update = True" in my config, it is running as a service, and Home Assistant is showing me that an update is available. I click the install button in Home Assistant and nothing appears to happen. Is there something else I need to do?

I've experienced the same issue with one of my other systems that are not even RPi. After restarting the targeted system, the update from HA was successful.

@hjelev
Copy link
Owner

hjelev commented Nov 8, 2024

You need to wait, sometimes it takes ~ 50 secs.
I need to display update progress but i don't know how to do it for now.

@Smarthome-Creator
Copy link

@hjelev , the MQTT script from HASS to Update works great. Thank you for this great work. The only thing missing is to be able to update the RPI via HASS and get a response whether it worked or not. Something like a return code or return output.

@webdeck
Copy link

webdeck commented Nov 8, 2024

Maybe I am doing something wrong? I see this in Home Assistant:
Screenshot 2024-11-08 at 2 21 28 PM

Then I click on the entry:
Screenshot 2024-11-08 at 2 21 42 PM

Then I click the Install button and nothing happens. I have waited almost a full day. The files remain unchanged on the Raspberry Pi, and there is nothing in the log:

root@tipiemu:~# ls -la rpi-mqtt-monitor/src
total 60
drwxr-xr-x 3 root root  4096 Sep  1 14:12 .
drwxr-xr-x 6 root root  4096 Jul 21 20:23 ..
-rw-r--r-- 1 root root  1969 Oct 29 18:01 config.py
-rw-r--r-- 1 root root  1972 Aug 20 14:37 config.py~
-rw-r--r-- 1 root root  1980 Jul 21 20:22 config.py.example
drwxr-xr-x 2 root root  4096 Oct 29 18:01 __pycache__
-rw-r--r-- 1 root root 31890 Jul 21 20:22 rpi-cpu2mqtt.py
-rw-r--r-- 1 root root  3753 Jul 21 20:22 update.py
root@tipiemu:~# journalctl -u rpi-mqtt-monitor.service --no-pager
Oct 29 18:05:00 tipiemu systemd[1]: Stopping rpi-mqtt-monitor.service - RPI MQTT Monitor...
Oct 29 18:05:00 tipiemu python3[2825196]: Error connecting to MQTT broker:
Oct 29 18:05:00 tipiemu systemd[1]: rpi-mqtt-monitor.service: Deactivated successfully.
Oct 29 18:05:00 tipiemu systemd[1]: Stopped rpi-mqtt-monitor.service - RPI MQTT Monitor.
Oct 29 18:05:00 tipiemu systemd[1]: rpi-mqtt-monitor.service: Consumed 7h 58min 38.126s CPU time.
Oct 29 18:05:00 tipiemu systemd[1]: Started rpi-mqtt-monitor.service - RPI MQTT Monitor.
root@tipiemu:~# grep -i update rpi-mqtt-monitor/src/config.py
# Binary sensor that displays when there are updates
git_update = True
# Enable remote update of the script via Home Assistant
update = True
update_check_interval = 3600 # 1 hour

@hjelev
Copy link
Owner

hjelev commented Dec 4, 2024

@webdeck in order for the auto update to work your git branch should be master and it should be ready to pull (no local changes), you can check this by executing git status command.

@webdeck
Copy link

webdeck commented Dec 5, 2024

@hjelev I can run the update on the pi just fine - I am on master with no local changes. My question is how to run the update from Home Assistant. It doesn't do anything when I click the button there. What am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants