I am trying to identify when an aircraft is "in flight" in the Device Mapper script for an Iridium Beegle Tracker (i've created a custom variable FlightInProgress for this). When the aircraft takes-off, I get a single take-off notification (mapped variable) and when it lands I get a single landing notification. So my custom variable FlightInProgress should be set when take-off notification is received and unset (set to false) when landing notification is received. I have tried to use context.setState to remember the FlightInProgress variable but it doesn't work and I see now that this is not supported in the Device Mapper (only in Event Rule scripts). How to solve this?
If not possible to do this in Device Mapper (much more elegant), is there is a possibility to do this with Event Rule scripts? How do you create and update a variable in one rule and then read that variable from another rule (like a global variable)? I know how one script can keep context.state between execution but how is that variable accessible between rules?