Why not do what this light was designed for? It is advertised as using the power supply for your e-bike. Depending on the system, all you might need is a separate switch.
The new Lumotec Avy E-Bike light from Busch & Muller incorporates all of the best features of the dynamo model but is designed to work with most E-Bike systems currently on the market. It can be connected to all DC power sources supplying between 6 and 42V DC. The 40 lux output with Close Range Light creates a far reaching, wide and evenly lit beam pattern ideal for faster moving E-Bikes. The Avy is switchless. This means that it is always turned on or is switchable via E-Bike console. source: https://www.sjscycles.co.uk/lighting...light/?geoc=US