I don't see "HMI" used much at all anymore. Human Computer Interaction (HCI) is still around, but it's a field of study, not a type of interface.
The thing is "User Interface" implicitly includes humans and excludes machines; the interface between machines tends to just be called an interface or API, and is pretty much excluded from any UX related field. So non-human interfaces are implicitly outside the focus of user experience etc. The skills for creating machine to machine interfaces are nothing like those for creating human (or animal) interfaces with devices. So, HMI isn't really a term to worry about. I'd be very surprised to hear someone using the phrase, and if they are, they really just mean UI as most others would use it.
The distinction of a GUI is of course that it's explicitly graphical in nature. More implicitly, it tends to refer to digital graphical interfaces for software. Physical hardware design, while it has a visual component, is generally not considered part of a GUI. GUIs are made of pixels. They're deeper than that (interactions, not just visual elements) but that's what generally differentiates them.
The UI is anything the user interacts with. This includes physical and digital controls, anything that a user will need to do, read, or interact with with part of the UI. "User" is intentionally nebulous, but it's generally assumed to be your human agent. Interfaces for animals/etc do exist (dog doors for example) but they're not really considered UI design but industrial design. Again, not something one in a UX related field is likely to be concerned with.