FLux Query with stateDuration. It does not seem to disaplay the actual duration of the change of state I wrote this code on InfluxDB UI: