Implement autostart on system startup
I am using my old tablet as a control panel for Home Assistant and it scheduled to reboot every night for proper work. It would be great to have autostart feature out of the box, without installing 3rd party apps. Maybe even start as a launcher to reduce RAM usage?
please do not combine multiple requests into one, one should be created for each request.
Sorry. Fixed.
For this we should make it an option in settings, we also need to do a permission check on certain android versions to autostart.
In the meantime you are more than welcome to use existing app features to automate this already.
- Use either the last reboot sensor to detect when the device booted or last update sensor when the state contains
BOOT_COMPLETED - send
command_webviewnotification command to open the app, make sure to test the command first so you can give the app proper permission
Maybe even start as a launcher to reduce RAM usage?
I think making the app into a launcher is a bit out scope for the project and this request :)
Interesting solution. Had no idea we can do this:) But for me BOOT_COMPLETED sometimes triggered before WIFI being connected, so i just used "from ACTION_SHUTDOWN" trigger:
alias: Tablet HA start
description: ""
trigger:
- platform: state
entity_id:
- sensor.lenovo_yt3_x50fn_last_update_trigger
from: android.intent.action.ACTION_SHUTDOWN
condition: []
action:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: notify.mobile_app_lenovo_yt3_x50fn
data:
message: command_webview
mode: single
Thanks.
Hello, I'm not sure to understand how these sensors can work if the Companion not launched on the Android phone ? Should be great to have an option in the Companion settings.
Regards
Hello, I'm not sure to understand how these sensors can work if the Companion not launched on the Android phone ? Should be great to have an option in the Companion settings.
Sensors are scheduled to update periodically if you started the app once. The system will take care of restarting these updates when the device is rebooted / updated, so this already works. The feature request is for opening the app (showing a dashboard) immediately after starting the device.