I’m using now the new Kostal-Binding (2.4 M7) with the QuantityTypes.

Before I grabbed the values directly from the converter and had such a simple conversion rule.

```
Number num_PVWR_totalEnergy "Ertrag (gesamt) [%.0f kWh]" { channel="kostalinverter:kostalinverter:Piko:totalEnergy" }
Number num_PVWR_totalEnergyMWh "Ertrag (gesamt) [%.1f MWh]"
```

```
rule "PVWR Gesamtwert konvertieren"
when
Item num_PVWR_totalEnergy changed
then
if (num_PVWR_totalEnergyMWh.state != NULL)
num_PVWR_totalEnergyMWh.postUpdate(num_PVWR_totalEnergy.state as Number / 1000.0)
end
```

Since I upgraded to use the QuantityType, I get a value, which is multiplied by 3600 instead of divided by 1000. Whats wrong with my rule?

```
Number:Energy num_PVWR_totalEnergy "Ertrag (gesamt) [%.0f kWh]" { channel="kostalinverter:kostalinverter:Piko:totalEnergy" }
Number num_PVWR_totalEnergyMWh "Ertrag (gesamt) [%.1f MWh]"
```

```
rule "PVWR Gesamtwert konvertieren"
when
Item num_PVWR_totalEnergy changed
or
Time cron "10 0/2 * * * ?"
then
if (num_PVWR_totalEnergy.state != NULL)
{
val Number total = num_PVWR_totalEnergy.state as Number
val Number totalM = total / 1000.0
val Number totalkWh = num_PVWR_totalEnergy.state as QuantityType<Number>
val Number totalMWh = totalkWh / 1000.0
num_PVWR_totalEnergyMWh.postUpdate(totalMWh)
logInfo("PV", "Total {}, {} MWh, {}, {} MWh", total, totalM, totalkWh, totalMWh)
}
end
```

As result I get:

```
09-Dez-2018 13:30:10.028 [INFO ] [rg.eclipse.smarthome.model.script.PV] - Total 25631 kWh, 92271600.00000000 MWh, 25631 kWh, 92271600.00000000 MWh
```