HA sensors/automation not working after computer restart

Running HA on a Hyper-V on my media computer/server. Problem is whenever i set the computer into a sleep-state it loses connection, or I simply restart the computer my sensors/automations will not work until I restart the virtual machine.
Can i solve it so i wont have to restart the virtual machine every time i restart the host/pc?

on the host machine go into devicemanagenemt.msc or via network adapters for the nic that you are using on the host for the VM and under power management make sure that Allow this computer to turn off this device to save power is unticked then click ok.

You can then optionally add in a delay to the startup of the VM in the settings for it to see if when the host reboots what is the optimal time for it to start up once host has connection.