Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Put this in your configuration.yaml (mine is just below the recorder block):
- # Mount media nas folder
- shell_command:
- mount_data: !secret mount_data
- #Put this in secrets.yaml:
- #mount
- mount_data: mkdir -p /media/data;mount -t cifs -o rw,vers=3.0,user=USERNAME,password=PASSWORD,sec=ntlmv2 //192.168.1.214/mnt /media/data
- #What does the above do?
- #First it creates a folder to mount to, in this case /media/data
- #Second it wil mount the drive, in this case //192.168.1.214/mnt, to that (new) folder
- #Last step is to let HA mount the above stuff on startup. Just use this simple automation. Should explain itself:
- alias: mount media
- description: ''
- trigger:
- - platform: homeassistant
- event: start
- condition: []
- action:
- - service: shell_command.mount_data
- data: {}
- mode: single
- # Do this for every (seperate) external drive you want to mount. Just make sure you name each command (mount_data in this example) different.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement