RainMachine Switch

The rainmachine switch platform allows you to control programs and zones within a RainMachine smart Wi-Fi sprinkler controller.

Configuring the Platform

The platform allows for either local (i.e., directly across the LAN) or remote (i.e., through RainMachine’s cloud API) access; the route you choose will dictate what your configuration should look like.

For local access, specify the IP address/hostname of your RainMachine unit, your RainMachine password, and optionally, the device’s HTTP port:

  platform: rainmachine
  password: YOUR_PASSWORD

For remote access, specify your RainMachine username/email and password:

  platform: rainmachine
  email: user@host.com
  password: YOUR_PASSWORD

Configuration Variables


(string)(Required)Your RainMachine password.


(string)(Optional)Your RainMachine username/email. Cannot be used with the ip_address parameter.


(string)(Optional)The IP address of your RainMachine unit; cannot be used with the email parameter.


(int)(Optional)The TCP port used by your unit for the REST API.

Default value: 8080


(boolean)(Optional)Whether communication with the local device should occur over HTTPS.

Default value: true


(int)(Optional)The number of seconds that a zone should run when turned on.

Default value: 600

Controlling Your Device

After Home Assistant loads, you will see new switches for every enabled program and zone. These work as expected:

  • Program On/Off: starts/stops a program
  • Zone On/Off: starts/stops a zone (using the zone_run_time parameter to determine how long to run for)

Programs and zones are linked. If a program is running its final zone, you will see both the program and zone switches turned on; turning either one off will turn the other one off (just like in the web app).


If you would like to see and control more detailed information, create an iFrame that renders the RainMachine web app:

    title: RainMachine
    url: "https://my.rainmachine.com/s/<YOUR_DEVICE_ID>/ui/"
    icon: mdi:water-pump

You can find <YOUR_DEVICE_ID> by logging into https://my.rainmachine.com and taking note of the URL.

For Awareness

The remote RainMachine API currently has two broken operations (i.e., they return error codes): starting a program and stopping a program. Please note that starting/stopping programs with the remote API is disabled until RainMachine can fix the issue.