mirror of
https://github.com/mrcory/arduino-home-assistant.git
synced 2026-08-02 15:24:26 -04:00
update examples
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#include <Ethernet.h>
|
||||
#include <ArduinoHA.h>
|
||||
|
||||
#define INPUT_PIN 9
|
||||
#define INPUT_PIN 9
|
||||
#define BROKER_ADDR IPAddress(192,168,0,17)
|
||||
|
||||
byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A};
|
||||
unsigned long lastReadAt = millis();
|
||||
@@ -24,7 +25,7 @@ void setup() {
|
||||
device.setSoftwareVersion("1.0.0");
|
||||
|
||||
// please change IP address to yours
|
||||
mqtt.begin(IPAddress(192,168,0,17));
|
||||
mqtt.begin(BROKER_ADDR);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#include <Ethernet.h>
|
||||
#include <ArduinoHA.h>
|
||||
|
||||
#define LED_PIN 9
|
||||
#define LED_PIN 9
|
||||
#define BROKER_ADDR IPAddress(192,168,0,17)
|
||||
|
||||
byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A};
|
||||
|
||||
@@ -30,7 +31,7 @@ void setup() {
|
||||
led.onStateChanged(onSwitchStateChanged);
|
||||
|
||||
// please change IP address to yours
|
||||
mqtt.begin(IPAddress(192,168,0,17));
|
||||
mqtt.begin(BROKER_ADDR);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#include <Ethernet.h>
|
||||
#include <ArduinoHA.h>
|
||||
|
||||
#define LED_PIN 9
|
||||
#define USERNAME "user" // replace with your credentials
|
||||
#define PASSWORD "pass"
|
||||
#define LED_PIN 9
|
||||
#define BROKER_ADDR IPAddress(192,168,0,17)
|
||||
#define BROKER_USERNAME "user" // replace with your credentials
|
||||
#define BROKER_PASSWORD "pass"
|
||||
|
||||
byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A};
|
||||
|
||||
@@ -32,7 +33,7 @@ void setup() {
|
||||
led.onStateChanged(onSwitchStateChanged);
|
||||
|
||||
// please change IP address to yours
|
||||
mqtt.begin(IPAddress(192,168,0,17), USERNAME, PASSWORD);
|
||||
mqtt.begin(BROKER_ADDR, BROKER_USERNAME, BROKER_PASSWORD);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <Ethernet.h>
|
||||
#include <ArduinoHA.h>
|
||||
|
||||
#define BROKER_ADDR IPAddress(192,168,0,17)
|
||||
|
||||
byte mac[] = {0x00, 0x10, 0xFA, 0x6E, 0x38, 0x4A};
|
||||
unsigned long lastSentAt = millis();
|
||||
double lastValue = 0;
|
||||
@@ -34,7 +36,7 @@ void setup() {
|
||||
temp.setUnitOfMeasurement("°C");
|
||||
|
||||
// please change IP address to yours
|
||||
mqtt.begin(IPAddress(192,168,0,17));
|
||||
mqtt.begin(BROKER_ADDR);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
Reference in New Issue
Block a user