Trigger on Sensor Value

I created an RFID Device using HubDuino/Arduino.
Every time when any RFID Card is presented Hubitat gets an Card ID Number
as a Voltage from a HubDuino Voltage Sensor. This is the way how HubDuino
is sending Integers to the Hubitat. This part works as expected.
Now I need to create a Trigger for the RM Rule.
Here is my very simple rule for testing:

I tried to use "=" and/or "changed" for the Trigger equation.
In both cases Trigger fires only once.
This behavior was expected for the "changed" but for the "=" I expected
Trigger to fire every time when sensor sends data to HE even data is the same.
But it looks like the same data did not initiate Trigger.

Is this expected behavior (I mean the same data from the sensor will
initiate Trigger only once)?

PS.
In my case I can easy fix this on the HubDuino/Arduino side by adding a
"Button Pressed" event send alone with the sensor value.

The platform discards events that don't represent a state change of the device. This can be overcome in the driver with isStateChange: true on the sendEvent().

Thank you very much for the explanation.
I am not yet ready for messing up with drivers.
So, I will fix this on the HubDuino side by adding a Button Device
and use a "Button Pushed" event for the Trigger.

Also, be aware that comparing decimal numbers (especially as a means of triggering another process) is risky biscuits in any computing arena. Reason: Rounding

You're better off taking the difference of the two quantities and comparing whether the result is less than some small constant. e.g. (Light Leve - 80.12345) < 1). In RM, you might have to invoke a local variable to accomplish this task.

I will never use a data from a real analog sensor with "=" for comparison.
Only >, >=, <, <= should/must be used.
However in my case analog sensor is nothing more than a mechanism how
to pass unsigned integer to HE. The value from the same RFID tag always will
be the same. So, "=" could be easily used and will be used for validating
RFID tags.

1 Like