Hey Veleek,
Glad you received your plugs! We were trying to get a project done using the mcPlug last week to showcase on Hackster.io however this didn't quite happen - mostly because we were too busy setting up the new website (It is live now so check it out!).
We are going to try and put together a project to showcase the mcPlug and some of the cool things you can do with it this week.
In the meantime, below is some code to help you get going:
Class mcPlugSub
Const mcPlugTopic As String = "mcThings/plug"
Shared Event Boot()
Lplan.SetMidPowerMode(1)
Lplan.Subscribe(mcPlugTopic)
End Event
Shared Event SubscriptionDelivery()
Dim msg As Message = Lplan.GetDelivery()
If msg.Topic= mcPlugTopic Then
Relay = Not Relay
End If
End Event
End Class
The above code sets the plug to be in mid-power mode (basically a constant connection to the mcGateway). If the device receives the MQTT topic "mcThings/plug" it will then turn on the relay and provide power to whatever you have connected to the plug!
Some examples of what you can do:
- Setup a fan connected to the plug. You can then have another module checking temperature and if too hot, then it can send a message and turn on the fan
- I have setup a module connected to a switch/button (there is also a switch built-in to the mcModules too!) that can turn on or off the relay on the plug.
We'll do our best to get a project up this week to give you a better starting point. Hope that helps!