@montgomery102 apologies I did not see the reply.
The yaml information goes in configuration.yaml. If you have a bloated configuration file, you can create an include file, if you havenāt use yaml, I would recommend the following reading:
- YAML - Home Assistant
If you use the configuration editor add-on you should be able to verify the syntax. Be mindful of the leading spaces.
Regarding the /config/shell/
folder it is something Iāve created, I tend to use SSH for this, if you know a bit of linux command you can do.
mkdir /config/shell
# (copy the scripts)
chmod 755 /config/shell/*sh
You can also create the folder by the file editor plugin, or via the network share.
You should obtain something like:
[core-ssh config]$ ls /config/shell/ -lha
total 20K
drwxr-xr-x 2 root root 4.0K Feb 16 2023 .
drwxr-xr-x 22 root root 4.0K Jan 6 09:12 ..
-rwxr-xr-x 1 root root 1.3K Feb 16 2023 appguard-allow.sh
-rwxr-xr-x 1 root root 1.3K Feb 16 2023 appguard-deny.sh
-rwxr-xr-x 1 root root 1.3K Feb 16 2023 appguard-state.sh
Regarding the question about the password, yes the USER:PASS should be replace the command should be executed in a shell. If you are not sure replace the following line
PASS=BASE64;
by these three lines:
USER="your_username"
PASSWORD="your_password"
PASS=$(echo -n "${USER}:${PASSWORD}" | base64);
Youtube is actually a category containing numerous youtube domains, the list contained in AdGuard is covering most categories you may wish, some that you can entirely disable and some that you may want to control the state āon-offā.
The string āuserā in the command line is something that I configured in adguard matching a static IP address (this means that you would have to statically reserve the IP/MAC address on your router/DHCP server, or set the IP address statically on the device). You can create a different policies for each users:
āSettings > Client settings > Add Clientā
The advantage of this solution, is that you can have multiple IP addresses to a command, so you can add tablet, laptop, TVs. This type of filtering is covering OS/web browser where ad-filtering plugins are not installable - for instance adds/tracking in android apps. The method is obviously by-passable but this is really efficient for younger kids.
Regarding the command question, I think my yaml example is a bit confusing. You may want to get thi
- platform: command_line
switches:
[USERNAME1]_[CATEGORY1]:
unique_id: UUID_1
command_on: /config/shell/appguard-allow.sh [USERNAME1] [CATEGORY1]
command_off: /config/shell/appguard-deny.sh [USERNAME1] [CATEGORY1]
command_state: /config/shell/appguard-state.sh [USERNAME1] [CATEGORY1]
[USERNAME1]_CATEGORY2:
unique_id: UUID_2
command_on: /config/shell/appguard-allow.sh [USERNAME1] [CATEGORY2]
command_off: /config/shell/appguard-deny.sh [USERNAME1] [CATEGORY2]
command_state: /config/shell/appguard-state.sh [USERNAME1] [CATEGORY2]
[USERNAME2]_CATEGORY1:
unique_id: UUID_3
command_on: /config/shell/appguard-allow.sh [USERNAME2] [CATEGORY1]
command_off: /config/shell/appguard-deny.sh [USERNAME2] [CATEGORY1]
command_state: /config/shell/appguard-state.sh [USERNAME2] [CATEGORY1]
[USERNAME2]_CATEGORY2:
unique_id: UUID_4
command_on: /config/shell/appguard-allow.sh [USERNAME2] [CATEGORY2]
command_off: /config/shell/appguard-deny.sh [USERNAME2] [CATEGORY2]
command_state: /config/shell/appguard-state.sh [USERNAME2] [CATEGORY2]
The UUID is just an uniq string to allow HA to recognise the block as one uniq entity, you can generated it on a command line using this command if you have a linux system: uuidgen
If not on the HA cli you can use the following
[core-ssh ~]$ cat /proc/sys/kernel/random/uuid
b9257270-3707-4d92-ba7c-6dba66d9c91c
[core-ssh ~]$ cat /proc/sys/kernel/random/uuid
0f4b5fca-70c3-4a00-9a57-394195057cf8
[core-ssh ~]$ cat /proc/sys/kernel/random/uuid
14da5a19-7d13-4a77-842a-86413bc5ceb8
[core-ssh ~]$ cat /proc/sys/kernel/random/uuid
010f9dce-4191-4560-95a3-20f8edd2bfda
Overall, I would say, setup Adguard first, switch the categories manually on/off first, and then go through the switch. When the switch is created, you can be really creative on how it is use, it could be enable via a calendar, manually set, for my part I have used a switch with a timer.
An adguard integration exist, and it can give you statistics about certain type of usage such as malware related domain, which can be quite important.