[SOLVED] Average Light


I would like to calculate the average light in a room with five lights. 3 of them are dimmers, so dimmer_item.state gives me a number between 0…100, 2 of them are switches (only returning ON and OFF). OH does not “autotransform” an OFF to a 0.

Currently I tried the mapping services, however without success:

Switch WL "Wandlicht [MAP(licht.map):%s]" <light> (gLight) {channel=""}

licht.map just looks like:


Any idea why OH does not transform the OFF to 0?



Have you installed the MAP service? Does your Item actually have state ON or OFF (it will begin life as NULL)

Where are you expecting to see the result of the MAPping? It is not intended to alter the Items state, only the display in e.g. BasicUI. So that form is of no use in any calculations in rules or wherever you are doing that part.

This will work just by putting them all in a Group
Group:Dimmer:AVG myTestGroup "Average power [%s]"
Auto conversion of OFF/ON to 0/100 will take place

That worked!
Thanks, Daniel