Code Test
Views 32
Sweets 0
Images 0
6 months ago Topic

DaVaR
Offline
Administrator
Total Posts: 60
Joined: September 03, 2019
Posted: January 25, 2020 @ 07:57 AM
This here is a code test for testing of the code...
Code

// This example uses an Arduino Uno together with
// an Ethernet Shield to connect to shiftr.io.
//
// You can check on your device after a successful
// connection here: https://shiftr.io/try.
//
// by Joël Gähwiler
// https://github.com/256dpi/arduino-mqtt

#include <Ethernet.h>
#include <PubSubClient.h>
#include <ctype.h>

// Ethernet Settings
// Ethernet MAC address - must be unique on your local network
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x24 };

// Server to connect to
IPAddress server(192, 168, 1, 30);
const char* mqtt_server = "mqtt.myarduinohome.com";

// Setup LEDs
const int LEDA = 7;
const int LEDB = 8;
const int buttonPin = 6;

int buttonState = 0;
int buttonReading;
int lastButtonState = 0;
int lightState = LOW;
int lastLightState = LOW;

// Try send data from callback to loop
String cbdata =  "";
String payload_buffer = "";

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  for (int i=0;i<length;i++) {
    Serial.print((char)payload[i]);
    if(isdigit((char)payload[i])){
      payload_buffer += (char)payload[i];
    }
  }
  Serial.print("payload_buffer callback : ");
  Serial.println(payload_buffer);
  Serial.println();

  if(strcmp(topic,"LEDA")==0){
    if((char)payload[0] == '1'){
      digitalWrite(LEDA, HIGH);
//      Serial.println("LEDA ON");
    }else{
      digitalWrite(LEDA, LOW);
//      Serial.println("LEDA OFF");
    }
  }
  if(strcmp(topic,"LEDB")==0){
    if((char)payload[0] == '1'){
      digitalWrite(LEDB, HIGH);
//      Serial.println("LEDB ON");
    }else{
      digitalWrite(LEDB, LOW);
//      Serial.println("LEDB OFF");
    }
  }

  if(payload_buffer){
    cbdata = payload_buffer;
    Serial.print("cbdata callback : ");
    Serial.println(cbdata);
  }
  payload_buffer = "";
}

EthernetClient ethClient;
PubSubClient client(ethClient);

// Let system know if internet is working or not
bool internetEnabled = true;

unsigned long lastMillis = 0;

/** Connect to MQTT Broker **/
void connect_mqtt() {
  Serial.println("Connecting to MQTT Broker");
  while (!client.connect("arduino", "davar", "TDiwtcm3165*%")) {
    Serial.print(".");
    delay(1000);
  }

  Serial.println("\nconnected!");

  client.subscribe("mah-controller");
  // client.unsubscribe("/hello");
}

void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (client.connect("arduino", "davar", "TDiwtcm3165*%")) {
      Serial.println("connected");
      // Once connected, publish an announcement...
      client.publish("mah-controller","hello from arduino");
      // ... and resubscribe
      client.subscribe("mah-controller");
      client.subscribe("LEDA");
      client.subscribe("LEDB");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
    client.publish("mah-controller", "Reconnected to Arduino");
  }
}

void messageReceived(String &topic, String &payload) {
  Serial.println("incoming: " + topic + " - " + payload);
}

/** Setup **/
void setup() {
  Serial.begin(57600);

  pinMode(LEDA,OUTPUT);
  pinMode(LEDB,OUTPUT);
  pinMode(buttonPin, INPUT);

  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);

  // Connect to the local network
  if (Ethernet.begin(mac) == 0){
    Serial.println(" | Failed to connect to local network.  Running in   ");
    Serial.println(" | No Internet Mode.  Website and other internet     ");
    Serial.println(" | devices will NOT work.  Please check your network ");
    Serial.println(" | and reset the Arduino controller.                 ");
    Serial.println(" --------------------------------------------------- ");
    Serial.println("");
    Serial.println("");
    internetEnabled = false;
  }else{
    Serial.print(" | IP Address        : ");
    Serial.println(Ethernet.localIP());
    Serial.print(" | Subnet Mask       : ");
    Serial.println(Ethernet.subnetMask());
    Serial.print(" | Default Gateway IP: ");
    Serial.println(Ethernet.gatewayIP());
    Serial.print(" | DNS Server IP     : ");
    Serial.println(Ethernet.dnsServerIP());
    Serial.println(" --------------------------------------------------- ");
    Serial.println("");
    Serial.println("");
    internetEnabled = true;
  }

  delay(5000);
}

/** Loop **/
void loop() {

  buttonReading = digitalRead(buttonPin);
  if(buttonReading == HIGH && lastButtonState == LOW){    
    // Get button state and control LED based on that
    if (buttonState == HIGH){
      buttonState = LOW;
    }else{
      buttonState = HIGH;
    }
  }

  if (!client.connected()) {
    reconnect();
  }

  client.loop();

  // publish a message roughly every 10 seconds.
  if (millis() - lastMillis > 10000) {
    lastMillis = millis();
    client.publish("mah-controller", "loop ping");
  }

  if(buttonState == HIGH){ 
    if(lastLightState == LOW){     
      client.publish("LEDA", "1");
      lightState = HIGH;
    }
  }else{
    if(lastLightState == HIGH){
      client.publish("LEDA", "0");
      lightState = LOW;
    }
  }


  lastLightState = lightState;
  lastButtonState = buttonReading;

}


Signature I am DaVaR

Reply By: DaVaR
6 months ago #1

DaVaR
Offline
Administrator
Total Posts: 60
Joined: September 03, 2019
Posted: January 25, 2020 @ 07:59 AM
Code

// This example uses an Arduino Uno together with
// an Ethernet Shield to connect to shiftr.io.
//
// You can check on your device after a successful
// connection here: https://shiftr.io/try.
//
// by Joël Gähwiler
// https://github.com/256dpi/arduino-mqtt

#include &lt;Ethernet.h&gt;
#include &lt;PubSubClient.h&gt;
#include &lt;ctype.h&gt;

// Ethernet Settings
// Ethernet MAC address - must be unique on your local network
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x24 };

// Server to connect to
IPAddress server(192, 168, 1, 30);
const char* mqtt_server = &quot;mqtt.myarduinohome.com&quot;;

// Setup LEDs
const int LEDA = 7;
const int LEDB = 8;
const int buttonPin = 6;

int buttonState = 0;
int buttonReading;
int lastButtonState = 0;
int lightState = LOW;
int lastLightState = LOW;

// Try send data from callback to loop
String cbdata =  &quot;&quot;;
String payload_buffer = &quot;&quot;;

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print(&quot;Message arrived [&quot;);
  Serial.print(topic);
  Serial.print(&quot;] &quot;);
  for (int i=0;i&lt;length;i++) {
    Serial.print((char)payload[i]);
    if(isdigit((char)payload[i])){
      payload_buffer += (char)payload[i];
    }
  }
  Serial.print(&quot;payload_buffer callback : &quot;);
  Serial.println(payload_buffer);
  Serial.println();

  if(strcmp(topic,&quot;LEDA&quot;)==0){
    if((char)payload[0] == '1'){
      digitalWrite(LEDA, HIGH);
//      Serial.println(&quot;LEDA ON&quot;);
    }else{
      digitalWrite(LEDA, LOW);
//      Serial.println(&quot;LEDA OFF&quot;);
    }
  }
  if(strcmp(topic,&quot;LEDB&quot;)==0){
    if((char)payload[0] == '1'){
      digitalWrite(LEDB, HIGH);
//      Serial.println(&quot;LEDB ON&quot;);
    }else{
      digitalWrite(LEDB, LOW);
//      Serial.println(&quot;LEDB OFF&quot;);
    }
  }

  if(payload_buffer){
    cbdata = payload_buffer;
    Serial.print(&quot;cbdata callback : &quot;);
    Serial.println(cbdata);
  }
  payload_buffer = &quot;&quot;;
}

EthernetClient ethClient;
PubSubClient client(ethClient);

// Let system know if internet is working or not
bool internetEnabled = true;

unsigned long lastMillis = 0;

/** Connect to MQTT Broker **/
void connect_mqtt() {
  Serial.println(&quot;Connecting to MQTT Broker&quot;);
  while (!client.connect(&quot;arduino&quot;, &quot;davar&quot;, &quot;TDiwtcm3165*%&quot;)) {
    Serial.print(&quot;.&quot;);
    delay(1000);
  }

  Serial.println(&quot;\nconnected!&quot;);

  client.subscribe(&quot;mah-controller&quot;);
  // client.unsubscribe(&quot;/hello&quot;);
}

void reconnect() {
  // Loop until we're reconnected
  while (!client.connected()) {
    Serial.print(&quot;Attempting MQTT connection...&quot;);
    // Attempt to connect
    if (client.connect(&quot;arduino&quot;, &quot;davar&quot;, &quot;TDiwtcm3165*%&quot;)) {
      Serial.println(&quot;connected&quot;);
      // Once connected, publish an announcement...
      client.publish(&quot;mah-controller&quot;,&quot;hello from arduino&quot;);
      // ... and resubscribe
      client.subscribe(&quot;mah-controller&quot;);
      client.subscribe(&quot;LEDA&quot;);
      client.subscribe(&quot;LEDB&quot;);
    } else {
      Serial.print(&quot;failed, rc=&quot;);
      Serial.print(client.state());
      Serial.println(&quot; try again in 5 seconds&quot;);
      // Wait 5 seconds before retrying
      delay(5000);
    }
    client.publish(&quot;mah-controller&quot;, &quot;Reconnected to Arduino&quot;);
  }
}

void messageReceived(String &amp;topic, String &amp;payload) {
  Serial.println(&quot;incoming: &quot; + topic + &quot; - &quot; + payload);
}

/** Setup **/
void setup() {
  Serial.begin(57600);

  pinMode(LEDA,OUTPUT);
  pinMode(LEDB,OUTPUT);
  pinMode(buttonPin, INPUT);

  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);

  // Connect to the local network
  if (Ethernet.begin(mac) == 0){
    Serial.println(&quot; | Failed to connect to local network.  Running in   &quot;);
    Serial.println(&quot; | No Internet Mode.  Website and other internet     &quot;);
    Serial.println(&quot; | devices will NOT work.  Please check your network &quot;);
    Serial.println(&quot; | and reset the Arduino controller.                 &quot;);
    Serial.println(&quot; --------------------------------------------------- &quot;);
    Serial.println(&quot;&quot;);
    Serial.println(&quot;&quot;);
    internetEnabled = false;
  }else{
    Serial.print(&quot; | IP Address        : &quot;);
    Serial.println(Ethernet.localIP());
    Serial.print(&quot; | Subnet Mask       : &quot;);
    Serial.println(Ethernet.subnetMask());
    Serial.print(&quot; | Default Gateway IP: &quot;);
    Serial.println(Ethernet.gatewayIP());
    Serial.print(&quot; | DNS Server IP     : &quot;);
    Serial.println(Ethernet.dnsServerIP());
    Serial.println(&quot; --------------------------------------------------- &quot;);
    Serial.println(&quot;&quot;);
    Serial.println(&quot;&quot;);
    internetEnabled = true;
  }

  delay(5000);
}

/** Loop **/
void loop() {

  buttonReading = digitalRead(buttonPin);
  if(buttonReading == HIGH &amp;&amp; lastButtonState == LOW){    
    // Get button state and control LED based on that
    if (buttonState == HIGH){
      buttonState = LOW;
    }else{
      buttonState = HIGH;
    }
  }

  if (!client.connected()) {
    reconnect();
  }

  client.loop();

  // publish a message roughly every 10 seconds.
  if (millis() - lastMillis &gt; 10000) {
    lastMillis = millis();
    client.publish(&quot;mah-controller&quot;, &quot;loop ping&quot;);
  }

  if(buttonState == HIGH){ 
    if(lastLightState == LOW){     
      client.publish(&quot;LEDA&quot;, &quot;1&quot;);
      lightState = HIGH;
    }
  }else{
    if(lastLightState == HIGH){
      client.publish(&quot;LEDA&quot;, &quot;0&quot;);
      lightState = LOW;
    }
  }


  lastLightState = lightState;
  lastButtonState = buttonReading;

}
Code

[{&quot;id&quot;:&quot;ab47feb1.fbc318&quot;,&quot;type&quot;:&quot;tab&quot;,&quot;label&quot;:&quot;Flow 1&quot;,&quot;disabled&quot;:false,&quot;info&quot;:&quot;&quot;},{&quot;id&quot;:&quot;29c95fc8.f16cc8&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;light on&quot;,&quot;topic&quot;:&quot;mah-controller&quot;,&quot;payload&quot;:&quot;lighton&quot;,&quot;payloadType&quot;:&quot;str&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:170,&quot;y&quot;:140,&quot;wires&quot;:[[&quot;bf7279d1.e40448&quot;]]},{&quot;id&quot;:&quot;bf7279d1.e40448&quot;,&quot;type&quot;:&quot;mqtt out&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;mah-controller&quot;,&quot;qos&quot;:&quot;&quot;,&quot;retain&quot;:&quot;&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:510,&quot;y&quot;:140,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;cff0a85f.454aa&quot;,&quot;type&quot;:&quot;mqtt in&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;mah-controller&quot;,&quot;qos&quot;:&quot;2&quot;,&quot;datatype&quot;:&quot;auto&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:190,&quot;y&quot;:240,&quot;wires&quot;:[[&quot;2a3c385.c9fb7c8&quot;]]},{&quot;id&quot;:&quot;2a3c385.c9fb7c8&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;x&quot;:490,&quot;y&quot;:240,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;58d9c20.28f84c&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED A OFF&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;payload&quot;:&quot;0000000000000000&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:170,&quot;y&quot;:400,&quot;wires&quot;:[[&quot;e6ed666a.544648&quot;]]},{&quot;id&quot;:&quot;e6ed666a.544648&quot;,&quot;type&quot;:&quot;mqtt out&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;qos&quot;:&quot;&quot;,&quot;retain&quot;:&quot;&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:490,&quot;y&quot;:380,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;c9edfefb.fc94a8&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED A ON&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;payload&quot;:&quot;1111111111111111&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:160,&quot;y&quot;:360,&quot;wires&quot;:[[&quot;e6ed666a.544648&quot;]]},{&quot;id&quot;:&quot;dd4c6643.eb3448&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED B OFF&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;payload&quot;:&quot;0000000000000000&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:170,&quot;y&quot;:560,&quot;wires&quot;:[[&quot;f4968a9a.bbe4c&quot;]]},{&quot;id&quot;:&quot;f4968a9a.bbe4c&quot;,&quot;type&quot;:&quot;mqtt out&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;qos&quot;:&quot;&quot;,&quot;retain&quot;:&quot;&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:490,&quot;y&quot;:540,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;f7734762.619808&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED B ON&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;payload&quot;:&quot;1111111111111111&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:160,&quot;y&quot;:520,&quot;wires&quot;:[[&quot;f4968a9a.bbe4c&quot;]]},{&quot;id&quot;:&quot;3fc00992.2042be&quot;,&quot;type&quot;:&quot;mqtt in&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;qos&quot;:&quot;2&quot;,&quot;datatype&quot;:&quot;auto&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:130,&quot;y&quot;:440,&quot;wires&quot;:[[&quot;2ca0fa27.ad9eae&quot;]]},{&quot;id&quot;:&quot;2ca0fa27.ad9eae&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;x&quot;:510,&quot;y&quot;:440,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;59f3ce4b.7d3958&quot;,&quot;type&quot;:&quot;mqtt in&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;qos&quot;:&quot;2&quot;,&quot;datatype&quot;:&quot;auto&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:130,&quot;y&quot;:600,&quot;wires&quot;:[[&quot;a46a3d8e.8a9d6&quot;]]},{&quot;id&quot;:&quot;a46a3d8e.8a9d6&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;x&quot;:510,&quot;y&quot;:600,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;type&quot;:&quot;mqtt-broker&quot;,&quot;z&quot;:&quot;&quot;,&quot;name&quot;:&quot;DaVaR&quot;,&quot;broker&quot;:&quot;mqtt.myarduinohome.com&quot;,&quot;port&quot;:&quot;1883&quot;,&quot;tls&quot;:&quot;9e96a21f.8261e&quot;,&quot;clientid&quot;:&quot;davar&quot;,&quot;usetls&quot;:false,&quot;compatmode&quot;:false,&quot;keepalive&quot;:&quot;60&quot;,&quot;cleansession&quot;:true,&quot;birthTopic&quot;:&quot;&quot;,&quot;birthQos&quot;:&quot;0&quot;,&quot;birthPayload&quot;:&quot;&quot;,&quot;closeTopic&quot;:&quot;&quot;,&quot;closeQos&quot;:&quot;0&quot;,&quot;closePayload&quot;:&quot;&quot;,&quot;willTopic&quot;:&quot;&quot;,&quot;willQos&quot;:&quot;0&quot;,&quot;willPayload&quot;:&quot;&quot;},{&quot;id&quot;:&quot;9e96a21f.8261e&quot;,&quot;type&quot;:&quot;tls-config&quot;,&quot;z&quot;:&quot;&quot;,&quot;name&quot;:&quot;&quot;,&quot;cert&quot;:&quot;&quot;,&quot;key&quot;:&quot;&quot;,&quot;ca&quot;:&quot;&quot;,&quot;certname&quot;:&quot;&quot;,&quot;keyname&quot;:&quot;&quot;,&quot;caname&quot;:&quot;&quot;,&quot;servername&quot;:&quot;&quot;,&quot;verifyservercert&quot;:true}]


Signature I am DaVaR

Reply By: DaVaR
6 months ago #2

DaVaR
Offline
Administrator
Total Posts: 60
Joined: September 03, 2019
Posted: January 25, 2020 @ 07:59 AM
Code

[{&quot;id&quot;:&quot;ab47feb1.fbc318&quot;,&quot;type&quot;:&quot;tab&quot;,&quot;label&quot;:&quot;Flow 1&quot;,&quot;disabled&quot;:false,&quot;info&quot;:&quot;&quot;},{&quot;id&quot;:&quot;29c95fc8.f16cc8&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;light on&quot;,&quot;topic&quot;:&quot;mah-controller&quot;,&quot;payload&quot;:&quot;lighton&quot;,&quot;payloadType&quot;:&quot;str&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:170,&quot;y&quot;:140,&quot;wires&quot;:[[&quot;bf7279d1.e40448&quot;]]},{&quot;id&quot;:&quot;bf7279d1.e40448&quot;,&quot;type&quot;:&quot;mqtt out&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;mah-controller&quot;,&quot;qos&quot;:&quot;&quot;,&quot;retain&quot;:&quot;&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:510,&quot;y&quot;:140,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;cff0a85f.454aa&quot;,&quot;type&quot;:&quot;mqtt in&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;mah-controller&quot;,&quot;qos&quot;:&quot;2&quot;,&quot;datatype&quot;:&quot;auto&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:190,&quot;y&quot;:240,&quot;wires&quot;:[[&quot;2a3c385.c9fb7c8&quot;]]},{&quot;id&quot;:&quot;2a3c385.c9fb7c8&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;x&quot;:490,&quot;y&quot;:240,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;58d9c20.28f84c&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED A OFF&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;payload&quot;:&quot;0000000000000000&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:170,&quot;y&quot;:400,&quot;wires&quot;:[[&quot;e6ed666a.544648&quot;]]},{&quot;id&quot;:&quot;e6ed666a.544648&quot;,&quot;type&quot;:&quot;mqtt out&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;qos&quot;:&quot;&quot;,&quot;retain&quot;:&quot;&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:490,&quot;y&quot;:380,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;c9edfefb.fc94a8&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED A ON&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;payload&quot;:&quot;1111111111111111&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:160,&quot;y&quot;:360,&quot;wires&quot;:[[&quot;e6ed666a.544648&quot;]]},{&quot;id&quot;:&quot;dd4c6643.eb3448&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED B OFF&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;payload&quot;:&quot;0000000000000000&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:170,&quot;y&quot;:560,&quot;wires&quot;:[[&quot;f4968a9a.bbe4c&quot;]]},{&quot;id&quot;:&quot;f4968a9a.bbe4c&quot;,&quot;type&quot;:&quot;mqtt out&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;qos&quot;:&quot;&quot;,&quot;retain&quot;:&quot;&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:490,&quot;y&quot;:540,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;f7734762.619808&quot;,&quot;type&quot;:&quot;inject&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;LED B ON&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;payload&quot;:&quot;1111111111111111&quot;,&quot;payloadType&quot;:&quot;num&quot;,&quot;repeat&quot;:&quot;&quot;,&quot;crontab&quot;:&quot;&quot;,&quot;once&quot;:false,&quot;onceDelay&quot;:0.1,&quot;x&quot;:160,&quot;y&quot;:520,&quot;wires&quot;:[[&quot;f4968a9a.bbe4c&quot;]]},{&quot;id&quot;:&quot;3fc00992.2042be&quot;,&quot;type&quot;:&quot;mqtt in&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDA&quot;,&quot;qos&quot;:&quot;2&quot;,&quot;datatype&quot;:&quot;auto&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:130,&quot;y&quot;:440,&quot;wires&quot;:[[&quot;2ca0fa27.ad9eae&quot;]]},{&quot;id&quot;:&quot;2ca0fa27.ad9eae&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;x&quot;:510,&quot;y&quot;:440,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;59f3ce4b.7d3958&quot;,&quot;type&quot;:&quot;mqtt in&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;topic&quot;:&quot;LEDB&quot;,&quot;qos&quot;:&quot;2&quot;,&quot;datatype&quot;:&quot;auto&quot;,&quot;broker&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;x&quot;:130,&quot;y&quot;:600,&quot;wires&quot;:[[&quot;a46a3d8e.8a9d6&quot;]]},{&quot;id&quot;:&quot;a46a3d8e.8a9d6&quot;,&quot;type&quot;:&quot;debug&quot;,&quot;z&quot;:&quot;ab47feb1.fbc318&quot;,&quot;name&quot;:&quot;&quot;,&quot;active&quot;:true,&quot;tosidebar&quot;:true,&quot;console&quot;:false,&quot;tostatus&quot;:false,&quot;complete&quot;:&quot;payload&quot;,&quot;targetType&quot;:&quot;msg&quot;,&quot;x&quot;:510,&quot;y&quot;:600,&quot;wires&quot;:[]},{&quot;id&quot;:&quot;b16335e9.c8c3b8&quot;,&quot;type&quot;:&quot;mqtt-broker&quot;,&quot;z&quot;:&quot;&quot;,&quot;name&quot;:&quot;DaVaR&quot;,&quot;broker&quot;:&quot;mqtt.myarduinohome.com&quot;,&quot;port&quot;:&quot;1883&quot;,&quot;tls&quot;:&quot;9e96a21f.8261e&quot;,&quot;clientid&quot;:&quot;davar&quot;,&quot;usetls&quot;:false,&quot;compatmode&quot;:false,&quot;keepalive&quot;:&quot;60&quot;,&quot;cleansession&quot;:true,&quot;birthTopic&quot;:&quot;&quot;,&quot;birthQos&quot;:&quot;0&quot;,&quot;birthPayload&quot;:&quot;&quot;,&quot;closeTopic&quot;:&quot;&quot;,&quot;closeQos&quot;:&quot;0&quot;,&quot;closePayload&quot;:&quot;&quot;,&quot;willTopic&quot;:&quot;&quot;,&quot;willQos&quot;:&quot;0&quot;,&quot;willPayload&quot;:&quot;&quot;},{&quot;id&quot;:&quot;9e96a21f.8261e&quot;,&quot;type&quot;:&quot;tls-config&quot;,&quot;z&quot;:&quot;&quot;,&quot;name&quot;:&quot;&quot;,&quot;cert&quot;:&quot;&quot;,&quot;key&quot;:&quot;&quot;,&quot;ca&quot;:&quot;&quot;,&quot;certname&quot;:&quot;&quot;,&quot;keyname&quot;:&quot;&quot;,&quot;caname&quot;:&quot;&quot;,&quot;servername&quot;:&quot;&quot;,&quot;verifyservercert&quot;:true}]


Signature I am DaVaR

Forum Permissions
You cannot post in this forum.
You cannot moderate this forum.
You cannot administrate this forum.
Search Forums
Forum Recent Posts
Website Security Test