Virtual Illuminance Sensor

I’ve added one of these devices in Hubitat. It doesn’t look like it is available in SharpTools.

@Stan_Silverman thanks for the feedback. Can you help me better understand the use-case for this particular device type?

If the device driver at least implements the Sensor or Actuator capability, you should be able to authorize it manually.

Thanks. I’ll try manual authorization. I think it would implement sensor capability.

The use-case is basically an experiment. (Sometimes I get things to work the way I’d like, and other times it’s a dead-end. But it’s always a learning experience,)

I have an illuminance sensor in the garage. The overhead garage lighting is on a couple of smart switches, but there are three sets of manually controlled florescent fixtures scattered about the garage.

The way it works now is this virtual switch tile is transparent when all garage lights - both smart and manual - are off,
Illumination
and looks like this if any light is on.
Illumination on
I can glance at the dashboard at bedtime to see if any lights have been left on. I’ve chosen a lux threshold for turning the virtual switch on/off based on experiment. Works well.

The reason for adding the virtual illuminance sensor is to see if I can figure a way to have the tile display the actual lux value - but only when pressed. I don’t want it displayed by default because it’s too much information for other dashboard users.

A long story - but you asked…

Thanks for the feedback, Stan. I tried to authorize the built-in Hubitat Virtual Illuminance device and it doesn’t look like it implements the Sensor capability.

I went ahead and threw together a quick Virtual Illuminance driver that also implements the ‘Switch’ and ‘Switch Level’ capabilities as a proxy for setting the lux values.

To be perfectly transparent, I threw this together quickly so it may be a bit rough around the edges. I figured it would be nice to have the on/off and setLevel commands exposed in case you wanted to use those type of tiles to quickly adjust the simulated lux level.

The on/off commands will set the lux level to 0 and 110,000 respectively unless you’ve specifically set a min and max lux in the device driver’s preferences. The setLevel() command assumes a 0-100% value like normal dimmers does, but it maps the value linearly to the lux scale mentioned above.

1 Like

Josh - thanks so much for whipping this driver out so quickly!

I thought for a brief instance that I could accomplish my goal. However…

As my garage sensor reports in the range of 0 to 60-some lux, I set the range in the simulated sensor 0 to 100.
I installed the simulated sensor as a tile with Hero attribute set to Luminance.

I created a number variable with name $LuxLevel. I thought if I could set that variable from the value of the real sensor, and then have the simulated sensor use it as it’s level - I would be in hog heaven!

But it seems that I must input the value. Shucks. Don’t know where to go from here.

@Stan_Silverman you can only set specific value to variable in the current beta release, but setting device attribute to variable is in my short list.

2 Likes

Thanks, James.

I think that would give the name “Variable” more meaning - and be very useful!

2 Likes

@Stan_Silverman, just wanted to let you know the Variables related features have been released to SharpTools.io today, and it does include the features to allow you to set a variable value using a device’s attribute value, as well as using the variable as the argument when sending the command to a device. In your scenario, you will be able to set $LuxLevel variable’s value using the sensor’s illuminance value, and set the virtual device’s level using this $LuxLevel variable as the argument. (Or you can simply remove the need of the virtual device and use the variables across the SharpTools platform to keep things simple.) :wink:

See below for the release post today, and let me know if you have any questions.

1 Like

James. Thanks so much for your support! Really appreciated.

1 Like