Page 1 of 1

Looking for best practice: Virtual lux

Posted: Saturday 12 September 2020 21:04
by najtram
I’m looking forward to find a new way to be able to have a virtual Lux sensor.

These two do NOT seem to work any more:
1 https://www.domoticz.com/wiki/Real-time ... Lux_sensor..
2 https://ehoco.nl/domoticz-weerstation/

Could you help me find a working way?

Kind regards

Re: Looking for best practice: Virtual lux

Posted: Saturday 12 September 2020 23:53
by zicht
Virtual lux is still possible to make with a dummy device !
But you are struggling with WU as it is not available the way it was ( for free).

There are several data suppliers but all not reliable (at least for me all give odd values) The only relaiable data is paid or shared (as far as i could find,)

What i did is making a custom sensor based on my solar pannels power output.
OK It is not lux, but pretty much gives an indication that is usable for the same purpose.

The other solution would be to BUY a lux sensor, they are pretty cheap. Recently i got a outdoor motion sensor with temp and lux included.

Re: Looking for best practice: Virtual lux

Posted: Sunday 13 September 2020 10:49
by kiddigital
Look at OpenWeatherMap and find out if there is good PWS nearby that reports Lux values that work for your situation.

You just need a free API key to get it up and running in Domoticz.

Re: Looking for best practice: Virtual lux

Posted: Sunday 13 September 2020 11:00
by waaren

najtram wrote:I’m looking forward to find a new way to be able to have a virtual Lux sensor.
I use the average production of my Solar panels over the last 15 minutes to control some of my lightsImage
Works for me.




Re: Looking for best practice: Virtual lux

Posted: Sunday 13 September 2020 14:13
by najtram
Thanks, for the ideas.

I'm modifying my blocky events now to match production of my Enphase system. What are your value's for twilight? I'm thinking of 120watt...

And could some of you point me out in an "avarage production script" direction?

Kind regards.

Re: Looking for best practice: Virtual lux

Posted: Sunday 13 September 2020 21:44
by waaren
najtram wrote: Sunday 13 September 2020 14:13 I'm modifying my blocky events now to match production of my Enphase system. What are your value's for twilight? I'm thinking of 120watt...
That more or less depends on the amount of solar panels and how they are placed. Just start with a value and adjust when needed.
And could some of you point me out in an "avarage production script" direction?
My solar panel production is measured by a youless energymonitor. I use below dzVents script to "translate" the average energy produced to a virtual lux sensor.

Code: Select all

--[[
avgerageYouless.lua
 ]]--

return
{
    on =
    {
        timer =
        {
            'at daytime every 1 minutes',
            '5 minutes after sunset',
        },
    },
    data =
    {
        powerYield =
        {
            history = true,
            maxItems = 15,
        },
    },

    logging =
    {
        level = domoticz.LOG_ERROR,
        marker = 'averageYouless',
    },

    execute = function(dz)
        local virtualLux = dz.devices(964)
        local youless = dz.devices(133)

        if dz.time.matchesRule('at daytime') then
            -- add new data
            dz.data.powerYield.add(youless.powerYield)
            -- average 'lux' to lux device
            virtualLux.updateLux(dz.data.powerYield.avg())
        else -- after sunset
            virtualLux.updateLux(0)
            dz.data.powerYield.reset()
        end
    end
}

Re: Looking for best practice: Virtual lux

Posted: Sunday 13 September 2020 23:15
by EdwinK
Unfortunately I can't find any stations nearby that has LUx value;s :(