ENV vs ATTR/ATTRS
Match sysfs attribute values of the event device.
Search the devpath upwards for a device with matching sysfs attribute values. If multiple ATTRS matches are specified, all of them must match on the same device.
Match against a device property value.
ATTR contain the same information - you can use any of them, there is no any difference.
ENVs for the device in question can contain values derived from different parent devices. So with
ENVs you can sometimes match on values from several parent devices simultaneously, which is impossible with
Rule for creating a directory
You must use absolute path in
RUN key (
RUN+="/bin/mkdir /home/pi/heyimhere" in your example):
If no absolute path is given, the program is expected to live in /usr/lib/udev; otherwise, the absolute path must be specified.
By the way, I don't know why your shutdown rule works. It shouldn't, because of
sbin/shutdown without leading
Mounting from udev rules
As jasonwryan mentioned, you can't use udev for automount:
Note that running programs that access the network or mount/unmount filesystems is not allowed inside of udev rules, due to the default sandbox that is enforced on systemd-udevd.service.