Expose global variable to HomeAssistant as a sensor value

Hey,

I really wants to know how I can show the value of a global variable as a sensor entity in Home Assistant.
It is so easy to use a sensor with platform DHT for example to show temperature in HA why no having a platform for global variables

I want to show some internal values I do calculation with in Home Assistant.

Please anyone help!.