Sensor attributes don't return values after HA restart, even with restore automation
NOTE: see my below comment on sensor restore automation not reseting...
~~May be an issue with "Shell Command" as this seems also broken and reported by someone else @ HA issues. Anyway currently doing the following to view info, this was working but broke after 2022.7:~~
Total Available Backups: {{ state_attr("sensor.samba_backup", "backups_local") }}
Last Backup: {{ state_attr("sensor.samba_backup", "last_backup") }}
Remote Backups: {{ state_attr("sensor.samba_backup", "backups_remote") }}
Suceeded Backups: {{ state_attr("sensor.samba_backup", "total_backups_succeeded") }}
Failed Backups: {{ state_attr("sensor.samba_backup", "total_backups_failed") }}
These are now all reporting 'None'
-----------------------------------------------------------
Add-on: Samba Backup
Create backups and store them on a Samba share
-----------------------------------------------------------
Add-on version: 5.1.1
You are running the latest version of this add-on.
System: Home Assistant OS 8.2 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2022.7.0
Home Assistant Supervisor: 2022.07.0
-----------------------------------------------------------
Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
Running your startup automation to restore the attributes but they do not seem to work, but backups are working correctly.
Thanks for the great add-on, it's essential to running HA.
Hiya, I am on the latest 2022.7.1 and not using shell command. But what I found is that the local backups is showing that I have 5 backups (within its attributes) while I clearly only have 1. this happens to both of my HA boxes.
~~My thought on "Shell Command" is that maybe the add-on is using "Shell Command" and it seems to be still broken...~~
After a couple of days the attributes did update... ...the automation I have added that restores the Samba Backup sensor is not working since it was several days after that, the sensor was restored. Below is the code for my automation which came from the Samba Backup docs:
`alias: Restore Samba Backup sensor on startup
trigger:
- event: start
platform: homeassistant
action:
- service: hassio.addon_stdin
data:
addon: 15d21743-samba-backup
input: restore-sensor`
As soon as HA is restarted the sensor attributes go back to "None" & the automation to restore them does not restore them.
The automation does not work because you have a typo. It should be 15d21743_samba_backup instead of 15d21743-samba-backup.
Hi @thomasmauerer , how's things? Thanks for your hard work as this add-on is definitely essential to the life of HA. Can I please query aboutthe number of local backups that I'm seeing as my per question above? Thanks
The automation does not work because you have a typo. It should be
15d21743_samba_backupinstead of15d21743-samba-backup.
@thomasmauerer Thanks, I should have caught that... I appreciate very much this add-on.
@drumstick77 if this is still an issue for you, please create a separate one. This issue here is about a non-working automation which is resolved.
No. Not an issue. I am new to all this so did not know I had to close it out ¯_(ツ)_/¯. Thanks for your help and a great add-on. My favorite.