data signal repeater

hello,

I was playing around with a esp8266 and a ledstrip and found out how to control the strip with my phone. Thats where I got a idea,

My plan whas to use 3 arduino's and connect the wireless with a rf reciever and emitter, so that when I turn the first one on, the others will do the same thing.

My setup whas:

first you have a esp8266 D1 that will recieve the data, it will use it and than send it to a other arduino with a RF connection, that arduino will use the information and send it to the next, and so on.

example:

I with my phone that the leds will do a rainbow animation, so I send it to the esp8266, that will turn the leds in rainbow and send it to arduino 2, that will turn his led into rainbow and send it to 3, and so on.

Now I had some thoughts about the programming, is there a way that the arduino's only need to send a number and that the other arduino knows what it has to do with the number? I mean like 1= rainbow, so I send to the esp8266 that it needs to be a rainbow animation and it will do that and send a 1 to the next arduino, that arduino recieves a 1 and knows it has to animate a rainbow effect and sends a 1 to the next arduino.

is there a libery or something like that for, or a kind of code that I don't know about.

I hope someone will understand this consept and can help me :)

(ps, this is not my first launguage, so I hope you guys understand what I mean)

Rino