How to call switches and dimmers like array? (like "Dimmer[1]")

Example array:
Command_from_HDL = {“channel”:1,“intensity”:100"} – json
or
Command_from_HDL = array(“channel”=>1,“intensity”=>100)

  1. How to call switches and dimmers in Items like “Dimmer[1]”, “Dimmer[2]”, “Switch[1]”?
    And how to get access to this Item?

I see it something like this rule:

rule "Command_recieve_from_HDL"
when
	Item Command_from_HDL received command
then
	Dimmer[Command_from_HDL['channel']].postUpdate(Command_from_HDL['intensity']) // like Dimmer[1].postUpdate(100)
end
  1. How to send array through REST API to Item?