Please format your post correctly, https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16
You will also need an availability template. See: Why an availability template is important for energy template sensors