Great ( inventive ) minds think alike.
That said I would not consider the idea for use with a combi hot water supply, firing up the combi every time the loo was flushed would be a waste of gas.
But so would a guest running the hot tap in the bathroom in order to wash their hands after using said loo! And giving up after a minute with no hot water... Would waste water too