Rain Machine run times

I’m having the same issue as many others from what I’ve seen. When Rain Machine runs a program, all zones in the program are set to ON. I would like to know which zone is actively running only. In the integration, the Zone Completion Time is displayed as “In xx minutes” or “xx minutes ago” etc. I tried making sensors based on this, then realized there is already some math and conversion being done to display it that way in the integration since the actual sensors are timedate only. I have looked at these sensors while zones are running or not and cannot seem to make sense of the stamp. Has anyone been able to do anything like this or have any ideas?

Well, after two days of scouring this forum and testing, I finally found a solution. I hope this helps someone.

Basically, each zone (switch) in a watering program is turned on simultaneously when that program runs, but the run_completion_time sensor doesn’t show as future until the zone is actually running. So, you can compare each zone’s run_completion_time to the current time (both as unix timestamps) and if the current time is greater, the zone isn’t running yet, if it’s less, it is running. So you have to set up some sensors in config:

  - platform: template
        friendly_name: "Unix Timestamp"
        value_template: "{{ as_timestamp(now()) }}"

  - platform: template
        friendly_name: "Zone x Unix"
        value_template: "{{ as_timestamp(states('sensor.sprinklers_zone_x_run_completion_time')) }}"

  - platform: template
        friendly_name: 'Zone x Sprinklers'
        value_template: >-
          {% if (states('sensor.real_time') < states('sensor.zone_x_unix')) %}
          {% else %}
          {% endif %}

Set a timestamp and comparison for each zone then, instead of displaying the status of the switch, you display the status of the sensor (you can use a call_service command to toggle the appropriate switch). It does take up to a minute for the completion_time to fall behind the current time, but now, if you have all your zones displayed, only the active one will show as on.