Looking for best practice: Virtual lux

Moderator: leecollings

Post Reply
User avatar
najtram
Posts: 62
Joined: Wednesday 26 April 2017 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.9700
Location: Netherlands
Contact:

Looking for best practice: Virtual lux

Post 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
RFLink Gateway → 433Mhz/KAKU switches
Z-Wave → Z-Stick Gen5+
ZigBee → ConBee II
Bluetooth → Soma Smart Shades
Opentherm Gateway → Remeha iSense - Tzerra boiler
ESP8266+CC1101 → ITHO ecofan RFT
P1 cable → DSMR 2.2+ Landys +gyr E350
LAN → Enphase Envoy
zicht
Posts: 251
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Looking for best practice: Virtual lux

Post 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.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Looking for best practice: Virtual lux

Post 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.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Looking for best practice: Virtual lux

Post 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.



Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
najtram
Posts: 62
Joined: Wednesday 26 April 2017 11:50
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.9700
Location: Netherlands
Contact:

Re: Looking for best practice: Virtual lux

Post 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.
RFLink Gateway → 433Mhz/KAKU switches
Z-Wave → Z-Stick Gen5+
ZigBee → ConBee II
Bluetooth → Soma Smart Shades
Opentherm Gateway → Remeha iSense - Tzerra boiler
ESP8266+CC1101 → ITHO ecofan RFT
P1 cable → DSMR 2.2+ Landys +gyr E350
LAN → Enphase Envoy
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Looking for best practice: Virtual lux

Post 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
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Looking for best practice: Virtual lux

Post by EdwinK »

Unfortunately I can't find any stations nearby that has LUx value;s :(
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest