Don't know if this the most memory efficient way, but my first attempt at integrating into HA. A better implementation would be using Arduino JSON.
Powered by TurnKey Linux.