Creating a binary_sensor for reporting phone's movement speed

I’m using Cloud3 device tracking, and I want to change the interval update depending upon how fast a phone is moving.

What I think I want is to be able to create a sensor called binary_sensor.myphone_moving_faster_than_human_can walk that uses various inputs from the phone’s Cloud3 device tracker and/or the iOS Companion app.

If such a sensor existed, I could create automations that fires when the state changes to On or Off that would update the device’s Cloud3 interval update speed. And one could set a more aggressive (faster) interval if the device were plugged into a power source.

Can you think of a way to create such a sensor using any of the features available in the Companion app, Cloud3, or other HA technologies?

@gcobb321, your input on this will be undoubtedly be helpful.

I don’t have any ios device but according to the docs the companion app creates a sensor with the walking speed, so you can just create a binary sensor that says if speed > x then it’s on, else off.

And it also creates a battery state sensor which shows when the phone is charging.

I just found there is an activity sensor where some of the states include Walking and Automotive, though I don’t know how long it takes to update.