Readout from a device-string can usually be done by means of otherdevices_svalues[.....]:
for a single value-device
Code: Select all
value = otherdevices_svalues[.....]
Code: Select all
value1, value2 = otherdevices_svalues[.....]:match("([^;]+);([^;]+)")
{that may also -accidentially- occur in the svalue-list for 'home-made' virtual devices.}
For extraction of values then you could also use a construction like below, which 'differently' looks at the string
Code: Select all
sLux5_string = otherdevices_svalues[SI1145Lux]
sLux5, sLux_txt = sLux5_string:match("(.*)% (.*)")
Code: Select all
otherdevices_winddir[WindMeter1]
otherdevices_windspeed[WindMeter1]
otherdevices_windgust[WindMeter1]
otherdevices_uv[SI1145UVI]
First aspect that surprises, is that Light has no dedicated, easy 'otherdevices' to extract the Lux-value, equivalent to otherdevices_uv:
is a specific reason for this absence? If no specific reason, suggestion to add a variant otherdevices_lux
Second aspect, which puzzles (operating with the example-lists for Lux-devices and UV-devices), is that dependent on the device sometimes you have to choose a different version of 'otherdevices' to get the desired element.
Because all devices look as if 'obeying the format'-rules, what could be reason for that?