Use template value for statistics

The Statistics Integration (Statistics - Home Assistant) should accept value template instead of only entity state.