My system consists of multiple IMP002 plugs 2-10 or more. In case one of the plugs detects a change (some others may not), the agent needs to be able to broadcast (ie say turn ON) to all the IMP002 connected to the router (or maybe an assigned router network)…so all plugs turn ON. How do I do this? Is there some code I need on the agent side?
regards Jens
Hello Phil;
Thanks for suggesting the PubNub. Sorry to ask as I am not a programmer but rather a hardware person. I was wondering if you know of any code to broadcast to all my IMP002 online devices if only one of them requests a handler (ie…example turn everything ON)
No specific code, but “Basic Internet-to-Agent Communications” and “Basic Agent-to-Internet Communications” both provide samples for agent-Internet comms, which is essentially agent-to-agent comms. Agents can only talk to specific agents, so you ‘router’ agent will need to know the URLs of the ‘plug’ agents so it can send them all the appropriate on/off signal. You can write code for the ‘router’ agent to which all new ‘plug’ agents send and register their URLs when they come online for the first time.
There is a 1:1 relationship between imps and agents.
Each imp has one agent, and that agent can only talk to that one imp. So if you want to talk to multiple imps, you need to talk to the agent for each of those imps.
Phil’s suggestion is to use PubNub to set up an “event bus” that all of the agents subscribe to, such that you can send a message to all of the agents at once, and they’ll relay that to their respective imps.
Tony’s suggestion doesn’t use a third-party integration: instead you have one of your agents talk to each of the others using HTTP.