Update encoding.py

Counter is now also showed in the 'state' messages and shutdown message.