How to create analog rules?

IVB

Senior Member
I must be blind, but I can't see how to create an analog rule in ElkRP.

I just put a photoresistor on one of my devices LED light, I want to write a rule that basically says Whenver voltage >x, turn digital output 190 on. Whenever voltage <x, turn digital output 190 off. However, I can't even see analog zones in the ElkRP whenever ZoneChange listing, and don't see any other location to specify it.

Grazie.
 
Ok, figured out that I have to do a 'WHENEVER every 1 second". If I want to use 9.7V as the cutoff, would I have 2 rules that do the following:

Code:
WHENEVER EVERY 1 SECONDS
   AND SageHDExtender (Zn 9) IS LESS THAN ANALOG VALUE 9.7 VOLTS
   THEN TURN Output 180 ON

WHENEVER EVERY 1 SECONDS
   AND SageHDExtender (Zn 9) IS GREATER THAN ANALOG VALUE 9.7 VOLTS
   THEN TURN Output 180 OFF


Seems pretty basic, but it's not working. It stays at false, even though ElkRP Status shows the zone at 9.6Volts
 
Which polarity did you plug your wire from LED light (via photoresistor) to input zone? If you have your wire plugged into positive polarity, perhaps you need to hook up the wire to negative.
 
There should be 2 voltages, 1 for an 'off condition', and one for an 'on' condition. I would be surprised if it is always exactly the same. So what I would do is to use CQC to poll the zone voltage (assuming the driver supports it) when the LED is on, and when it is OFF, and report back.
 
(GP - answered your question with another question in the status-light how-to thread.)

There should be 2 voltages, 1 for an 'off condition', and one for an 'on' condition. I would be surprised if it is always exactly the same. So what I would do is to use CQC to poll the zone voltage (assuming the driver supports it) when the LED is on, and when it is OFF, and report back.

Yep, there are 2 voltages, 9.6V and 9.8V. that's why I picked 9.7V for the rule. I can pull up ElkRP Status and see the difference reliably.

Life would be simpler if I could use this rule thingey in ElkRP to turn the digital output on/off based on the voltage, but I dunno why it doesn't work. The driver does support analog values, i've never used that bit, but i'm curious as to why the ElkRP one doesn't work.
 
Yep, that's how I got the 9.6V and 9.8V, and can tell if it's on/off visually through ElkRP. It's creating a rule that fires right that's killing me :)
 
Those values are too close IMO, you will need to play with the resistors. As for ElkRP, from a performance point of view, it's almost impossible to trigger an event based on voltage changes, so they never implemented it. The only way to check it is to do what you did, run a rule every second and have it check the value. This is why I still like my Ocelot (which is connected to my M1) :)
 
I don't mind the "run the rule every second", but I can't actually get it to work. I've only got perhaps 20 rules in the Elk, the rest of it is in CQC (80 triggered events and climbing monthly), so there's tons of headroom.
 
Can you draw a diagram of how you wired your photoresistor (including other resistors)? Thanks!
 
I just used BSR's technique. I wonder if I should re-do that given some of the multimeter readings he had me do this am, I wonder if the electrical tape wasn't on enough or wires got crossed/etc.

schematic.png
 
I am so cool,
I don't need to go to school,
I'll just hang in the swimming pool.

Ok, kids rhyming over, the problem was the separation. As mentioned in the other thread, after drilling out the front plastic plate, I was able to get a separation of 8.8V(on)->13.4V(off). Now the rule above works just fine. Heck, i'll just leave it at 9.7V as it's as good a middle ground as any...
 
Back
Top