Save the number of devices online instead of a string state

Format with spaces
Use standard logging framework and levels