Using switchbot to turn on/off waterheater according to power price

Hello!
A appologize if this has been asked before.

I have a switchbot installed on my water heater, so I can turn it on/off.
However. It would be nice to automate this according to the power prices.

I have a raspberry pi with home assistant and I have discovered the switchbot there.

However. I am a novice and do not know where to start with this. Is it very complicated? Can someone point me in the right direction with this?