@mfalkvidd Thanks
The idea of changing the pulseCount is correct. However I had set the value at the wrong place without realizing the pulseCount is reset at the Void setup() section.
// Water Reset pulsecount
pulseCountW = oldPulseCountW = 0;
// Zonnepanelen Reset pulsecount
pulseCountZ = oldPulseCountZ = 0;
The solution is
Change the 0 to : Value (meter) - Value (Controller)
Upload the sketch. wait until the first pulse is sent to the gateway.
If successed the controller (domoticz in my case) will show the total value matching the value on the physical meter.
Now change the value in the sketch back to 0. (Otherwise each time you reset the sensor or the gateway the value wil be added to the total value.) Upload the sketch to the sensor.
You are done. There is no need to Modify the Domoticz database with SQL tool.
You will get the value you've just added to the total value in the day value log. If you find this ignoring you can delete this value the next day. This only applies to Energy meter. Do not apply this to the water meter as the result the total value of the water meter will be gone too.