Simple Blockly rule to calculate consumption (item state gain) from the start of the day (Midnight)

you can check my rule templates for this.