Energy Harvesting Using A Thermoelectric Generator And Generic Rule-Based Energy Management