Taking esphome devices offline for a while

I have an esphome device that is mains powered, but it doesn’t have power all the time, as it’s placed behind a smart switch.
When they are offline/powered down, I get a lot of these messages in my log file:

2023-02-15 12:00:41.048 WARNING (MainThread) [aioesphomeapi.connection] varmvann1 @ 192.168.10.185: Connection error occurred: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 537, in send_message_await_response_complex
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:
etc. etc.

I assume it is caused by HA polling the device to make sure it’s still alive.
I need to tell HA that I’m taking the device offline for a while, i.e. until I apply power again.
How can I do that? Or is there another solution? I would rather not filter aioesphomeapi.connection warnings.