This rule template works as a virtual light sensor, providing a software only approximation of a hardware outside light sensor.
It takes total sun radiation, as provided by the Astro binding, and corrects it for clouds with data provided by the by the Synop Analyzer binding or a weather binding. The resulting light intensity value in Lux updates an item that can be used to trigger outside light level dependent behaviour in other rules.
- Total Radiation item: item representing total sun radiation in a location, as provided by the Astro binding.
- Cloudiness item: item representing cloudiness. This can be an okta value as provided by the Synop Analyzer binding or a cloudiness percentage as provided by a weather binding.
The rule template needs to be configured with 2 input and 1 or 2 output items.
- Total Radiation: name of the item (Number) that represents the total (sum of direct and diffuse) sun radiation.
- Cloudiness: name of the item (Number) that represents to okta value or cloudiness percentage. The okta value is a value between 0 and 8 (integer values) representing the level of cloudiness, with 0 a clear sky.
- Percent: flag indicating if the cloudiness input is an okta value (percent = false), or a cloudiness percentage value (percent = true).
- Lux: name of item (Number:Illuminance) that represents the total sun radiation in Lux without considering the cloud layer.
- Weighted Lux: name of item (Number:Illuminance) that represents the sun radiation in Lux, considering the effect of the cloud layer.
One of the output items can be omitted if not relevant for your use case.
- Use event data for items
- Fix for UNDEF inputs
- Added support for cloudiness percentage from weather bindings
- Treat UNDEF inputs
- Converted to jython
- DSL rule modified to use Okta from Synop Analyzer binding and Total Radiation from Astro binding
- Initial release of DSL rule, based on Domoticz LUA script at Lua dzVents - Solar Data: Azimuth Altitude Lux - Domoticz (by Sebastien Joly, Neutrino, Jmleglise)
A wider discussion and history can be found in the community thread.