Error with a counter

Hello, can anyone help me, I do not know why it does not work
it is a water measurement with a sensor on the water measuring unit and that has to run a counter

rule "Water Meting"
	when
		Item Input7_1 changed to OPEN or
		Item EWA_test_teller changed to ON
	then
		var Number LVW1_Water_TotalPulses = W1_Water_TotalPulses.state as Number
	if (W1_Water_TotalPulses = null){
		sendCommand(W1_Water_TotalPulses, 0)	
	}
	else{ 
		LVW1_Water_TotalPulses = LVW1_Water_TotalPulses + 0.1
		sendCommand(W1_Water_TotalPulses, LVW1_Water_TotalPulses)
	}
end

Couple of issues
When testing for null you need to use ===
But I think you want to check that the state in NULL

use the method postUpdate of sendCommand when dealing with a known item:
W1_Water_TotalPulses.postUpdate(0) instead of postUpdate(W1_Water_TotalPulses, 0)

Be consistent with our indenting use spaces OR tabs but not both
I recommend spaces it’s more consistent with other editors

There was no item definition for W1_Water_TotalPulses but I assumed it’s a number item with no binding.

rule "Water Meting"
when
    Item Input7_1 changed to OPEN or
    Item EWA_test_teller changed to ON
then
    var Number LVW1_Water_TotalPulses = W1_Water_TotalPulses.state as Number
    if (W1_Water_TotalPulses.state == NULL) {
        W1_Water_TotalPulses.postUpdate(0)	
    } else { 
        LVW1_Water_TotalPulses = LVW1_Water_TotalPulses + 0.1
        W1_Water_TotalPulses.postUpdate(LVW1_Water_TotalPulses)
    }
end
rule "Water Meting"
when
	Item Input7_1 changed to OPEN or
	Item EWA_test_teller changed to ON
then
	if (W1_Water_TotalPulses.state == NULL) {W1_Water_TotalPulses.postUpdate(0)}
	else {W1_Water_TotalPulses.postUpdate((W1_Water_TotalPulses.state as DecimalType) + 0.1)}
end