That is only required for a sensor with a state_class of total_increasing. Even then it is updated automatically for you.
If your sensor periodically resets the energy dashboard will take care of this for you if your sensor has the attributes:
device_class: energy
state_class: total_increasing
As long as sensor.corridor_energy_monitor_total has those two attributes, and an appropriate unit_of_measurement (Wh or kWh), you can use it with the energy dashboard.
Nope. The energy dashboard will recognise a decrease in value as a reset at any time.
An issue only occurs if your sensor goes to 0 when unavailable then reverts to the full previous total. Then that whole total gets added to the recorded energy. This happens a lot with poorly constructed template sensors. e.g.
value โ 0 โ value : add the whole value to the energy total
value โ unknown โ value : add nothing to the total.
So if your energy sensor starts climbing up normally after resetting to zero it will work fine.