halloween
(Hallo Ween)
January 18, 2017, 6:40pm
1
Hi,
i´m on OH 1.8.3. Can i use lastCount inside a rule?
In my rule i get the error from the title.
Here you can see my rule, items file, error message and so on…
https://community.openhab.org/t/s0-counter-from-power-meter-how-to-get-kwh/20335/10
Please can anybody help me?
rossko57
(Rossko57)
January 18, 2017, 8:17pm
2
var lastCount = 0
…
var newCommand = (receivedCommand as DecimalType).intValue
…
lastCount = newCommand
lastCount is I think a ‘primitive’, so things will go wrong when you try to fit a DecimalType object into it. Maybe cast lastCount as a DecimalType too.
Starting a new thread because your original one has not been answered within a few hours is usually considered “poor form”.
1 Like
halloween
(Hallo Ween)
January 18, 2017, 8:21pm
3
Sorry, i thought, that with this special thread title of the initial thread only people look inside it, which want to get information about this.
Bit lastCount has nothing to do with power meters - it is a general thing.
I will wait some time longer next time.
Can you tell me, how i can make a decimalType out of lasCall?
Maybe this way:
var lastCount = 0 as DecimalType
astrnad
(Alexander Strnad)
January 18, 2017, 8:39pm
4
Please use the other thread:
Hi,
i connected my power meter from the heatpump (s0) with my knx binary sensor.
Now i get the counts of the power meter. The power meter has 2000 impuls/kwh. I get the absolute counts (sum of the counts), not only “1” every time there is a impuls.
What is the best way to get kwh on my sitemap?
knx actor counting internal and only sending new data every xxx counts to the bus or sending every count to the knx bus?
I need a rule to get kwh out of the counts. How can i do this? Is there anybod…