That would certainly be acceptable, I have an mqtt broker.
Previously all I did was send a message to my system monitor Telegram chat group whenever my snapshot started. Having a success / fail message would be vastly superior.
That would certainly be acceptable, I have an mqtt broker.
Previously all I did was send a message to my system monitor Telegram chat group whenever my snapshot started. Having a success / fail message would be vastly superior.
Mqtt message would be great.
Hi guys,
great plugin. Love it. There seems to be an āissueā with the time. Probably the container does not run in the right/local timezone. I configured 12/noon and the backup is made at 2pm.
Not a major issue for me, but took me a while to figue it out. Initially I thought it did not work bc of the lag.
Sincerely.
Ralf
Itās running at the correct time for me.
I assume the timezone comes from the host. Is the timezone in your Home assistant setup configured correctly? Can you ssh into your HA instance (or use the Web Terminal) and check whether the ādateā command matches with your local time?
Just released version 2.2.
From now on the dedicated log functions are used. The verbosity of log output can be controlled with the optional parameter ālog_levelā.
In addition to that the add-on now performs a pre-check whether the Samba share is configured correctly, i.e. it is accessible and write access is granted. This should help when troubleshooting SMB configuration problems.
(Will work on mqtt notifications next)
Here it is, Samba Backup 2.3 with mqtt support is released.
All infos can again be found in the README. But in a nutshell, Samba Backup now publishes its current status via mqtt on topic samba_backup/status
. This works out of the box without any configuration if a mqtt broker is present on the device, e.g. the Mosquitto broker add-on. Note that this does not work with external brokers.
The status will be one of the following: IDLE, RUNNING, SUCCEEDED or FAILED. You can receive this information in Home Assistant with a sensor.
sensor:
- platform: mqtt
name: "Samba Backup"
state_topic: "samba_backup/status"
Youāre really trying hard to tempt me away from my very-inelegant-but-works-perfectly backup method arenāt you!
I do my best
By the way hereās a possible solution to āautomateā getting to the plain files directly in the (Windows) target directory.
set backup=%1
mkdir config
tar -xvf %backup% -C config
cd config
tar -xvf homeassistant.tar.gz
del *.tar.gz
Just put that in a bat file and run it with the tar file as the first parameter.
Should the mqtt notifications work with the Mosquitto addon broker?
Iām not getting anything published to the specified topic.
Edit: I think I see why:
1592842604: New connection from 172.30.33.4 on port 1883.
[INFO] found addons on local database
1592842604: New client connected from 172.30.33.4 as mosq-5p5vLHxP4oiTEMd4jC (p2, c1, k60, u'addons').
1592842604: Client mosq-5p5vLHxP4oiTEMd4jC disconnected.
1592842623: New connection from 172.30.33.4 on port 1883.
1592842623: New client connected from 172.30.33.4 as mosq-iqgSNBEcPSVaVHHQtD (p2, c1, k60, u'addons').
1592842623: Client mosq-iqgSNBEcPSVaVHHQtD disconnected.
1592842633: New connection from 172.30.33.4 on port 1883.
1592842633: New client connected from 172.30.33.4 as mosq-SZJ3eobiNbRkViOPpl (p2, c1, k60, u'addons').
1592842633: Client mosq-SZJ3eobiNbRkViOPpl disconnected.
I donāt have an āaddonsā user or allow anonymous users.
Is there a way to specify a username and password for connection to the broker?
Your logs look fine. The āaddonsā user is internally created by Home Assistant.
You can see in the logs that the user is found and that a client connects and disconnects multiple times (one for each status update). If the connection does not work, you would see a socket error or something like that.
Are you sure that you not misspelled something in your sensor configuration? Maybe a typo for the state_topic?
If you have the ssh addon installed, you can also check if itās working in the web terminal:
mosquitto_sub -h core-mosquitto -t "samba_backup/status" --username <your-username> --pw <your-password>
My sensor config:
- platform: mqtt
name: "Samba Backup"
state_topic: "samba_backup/status"
icon: mdi:folder-network-outline
Using MQTT explorer I see no topic:
samba_backup/status
I see no topic starting with sambaā¦
and the device state has stayed at āunavailableā for the last two backups.
I added the user āaddonsā to my ACL (access control list) and now it fuctions as expected.
Is that user account displayed in Configuration > Users?
Because I donāt see it on my Supervised system. Iām using the Mosquitto Broker Add-on and it automatically allows connection for accounts listed in Users. The only system-generated account listed in Users is hass.io
.
No the user is not displayed. But itās mentioned in the mosquitto addon docu:
[ā¦] For the internal Home Assistant ecosystem, we register
homeassistant
andaddons
, so these may not be used as user names.
Iām not using the addons user hardcoded. This comes directly from a bashio service call, so this should be ok. And actually I rule out authentication problems as the logs clearly show that the client connects and disconnects successfully. The problem must be something else, but I donāt know it yet.
Did you see this addition I made to my post?
Oops did not see that.
Ah youāre using an ACL. That explains it - then itās a permission issue writing to the topic.
Hi,
I have 2 issues with the Samba backup. It does create the backup files on my NAS, but
Here is my config:
host: n01.local
share: Backup
target_dir: HomeAssistant
username: user
password: password
keep_local: 3
keep_remote: 30
trigger_time: '04:00'
trigger_days:
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
- Sun
exclude_addons: []
exclude_folders: []
backup_name: '{type} Snapshot (Samba Backup) {date}'
Any help is more than welcome.
This is a misunderstanding, the backup_name only controls the name of the snapshot which is for instance displayed at the Supervisor ā Snapshots page. The filename itself comes from the slug which is the unique ID of each snapshot and cannot be controlled.
Are you using the Mosquitto broker addon? Does Samba Backup show you a warning in the logs after start?