Store current pressure
Moderator: Martin
-
- Posts: 3
- Joined: 26 Nov 2014 19:08
Store current pressure
I need to take the current value from the pressure sensor and store it in a global variable. Whenever I try, however, pressure comes up as having a null value. Anyone have an idea what's going on?
Re: Store current pressure
Hi,
A flow like this should work:
-trigger ...
-condition Pressure Sensor: > 0mbar
--> true: -action Script: global_pressure = pressure;
Please note that the condition only works when the device allows to read the pressure sensor values when the screen is off and when the sensor allows to read the current value, otherwise the flow will stop with a timeout error.
Regards,
Martin
A flow like this should work:
-trigger ...
-condition Pressure Sensor: > 0mbar
--> true: -action Script: global_pressure = pressure;
Please note that the condition only works when the device allows to read the pressure sensor values when the screen is off and when the sensor allows to read the current value, otherwise the flow will stop with a timeout error.
Regards,
Martin
-
- Posts: 3
- Joined: 26 Nov 2014 19:08
Re: Store current pressure
Thanks Martin! It seems that the Pressure Sensor: > 0mbar condition is necessary before you can capture the current pressure in a variable.