Virtual Sensor Polling
-
Hi Patrick,
A quick question about your virtual sensor plugin. I saw that the child sensors rely on polling for sensor data updates. Was there a reason not to use a watch on the underlying (source) state variable as opposed to polling. I'm asking in the sense that I need a fairly rapid response to a rise in humidity, but am unsure how to set sensor polling without adding additional io drag to openLuup.
I currently use the state humidity variable directly in a reactor sensor (the data is captured via a bluetooth device with multiple humidity variables), however, these state humidity variables have a generated name making it difficult to determine what is what in group of approximately 10 state humidity variables. So a virtual sensor solves the naming problem, while creating some trigger delay due to polling.
Thx
-
It does use a watch. I'm not aware of any way to configure polling in Virtual Sensor. That's not something it does (it doesn't poll, so I'm not sure where you think you've seen that).
The VirtualSensor instance must be enabled to operate, so make sure that's set correctly. You can keep the simulator from running by setting the period to 0.
If you're changing child configurations a lot, you may need to reload Luup to get all the child sensors configured correctly. An alternate way is to use a soft-restart of the VirtualSensor child (child device num=nnn below).
http://your-vera-ip:3480/data_request?id=lr_VirtualSensor&action=restart&device=nnnn
-
It does use a watch. I'm not aware of any way to configure polling in Virtual Sensor. That's not something it does (it doesn't poll, so I'm not sure where you think you've seen that).
The VirtualSensor instance must be enabled to operate, so make sure that's set correctly. You can keep the simulator from running by setting the period to 0.
If you're changing child configurations a lot, you may need to reload Luup to get all the child sensors configured correctly. An alternate way is to use a soft-restart of the VirtualSensor child (child device num=nnn below).
http://your-vera-ip:3480/data_request?id=lr_VirtualSensor&action=restart&device=nnnn
@toggledbits I suppose I got the idea from the documentation. It doesn't state that the sensor polls, but the following led me to believe that polling was used as opposed to a watch (which is instant):
Update Interval The update interval determines how often sensor values will be computed. This can be as little as 1 second. Intervals that are a high percentage of the period value can result in "choppy" sensor reports.
I then saw this in variable screen:
And finally, I saw a luup.variable_get for the humidity reading in the logs, though this may have been a configuration variable_get as I don't see any gets in the logs now, only watches.
So my mistake on misinterpreting data. Things look good and thanks for the clarification.
-
@toggledbits I suppose I got the idea from the documentation. It doesn't state that the sensor polls, but the following led me to believe that polling was used as opposed to a watch (which is instant):
Update Interval The update interval determines how often sensor values will be computed. This can be as little as 1 second. Intervals that are a high percentage of the period value can result in "choppy" sensor reports.
I then saw this in variable screen:
And finally, I saw a luup.variable_get for the humidity reading in the logs, though this may have been a configuration variable_get as I don't see any gets in the logs now, only watches.
So my mistake on misinterpreting data. Things look good and thanks for the clarification.
@buxton said in Virtual Sensor Polling:
I suppose I got the idea from the documentation.
What you've read there is a subsection from the section on how the simulator operates. That doesn't apply to child sensors and Virtual Sensor's value-copy feature.