While somewhat simple in operation, an electric fence controller can be cost prohibitive to construct from scratch. In the US the controllers can be bought for as little as $20. I am not sure of the cost in your country. With your power issues, I would recommend a solar charge energizer. This consists of a 12V car battery and a charge controller that constists of the electrical box and a solar panel to charge the battery.