I was asking a generic question but when I ask it that way, it is not understood correctly , so let me explain with a specific and real example:
I am using the following integration with my PI server and a UPS:
This driver has several states for the UPS.
Online and "On Battery" are specific states.
But when the PI is rebooted, Hub can not reach the app on PI.
So the driver reports state as "unknown"
I have 2 rules on Rule Machine.
One is for when the UPS is activated (state != Online & state!=unknown)
The other rule is for when the UPS is deactivated (state==Online)
The second rule is activated when state comes from "unknown" to "Online"
But I don't want this case to be reported.
How can I check the previous state of the UPS in Rule machine when state has changed to Online ?