Closed computerfreek274 closed 5 years ago
What you want to do is to notify to some google homes, isn't it?
This library doesn't support to notify to multiple google homes. Maybe, drastic design change is needed to support it.
# I think you can do that if you prepare as many ESPs as Google Home and each Google Homes have different name.
What about if I just Define another GoogleHomeNotifier for each google home. I have it setup and wired to a doorbell now. I will try it that way if I can get the code right. So far it has been working great for a doorbell no need for ifttt or any other outside server. Just connected for my wifi and done.
Is what you want to know the way to notify to multiple google-homes concurrently?
Maybe it's not impossible by current internal design.
I don't have a plan to support it because I don't have such an environment(I have only one google-home).
could I close this issue?
close
close
I have it working with this Code here.
I would just like to add all my google home's in. So this way it send's it to all devices.
Code I am using is.
include
include // https://github.com/thomasfredericks/Bounce2
include // https://github.com/horihiro/esp8266-google-home-notifier
define BUTTON_PIN D2 // D2/GPIO4
const char ssid = "xxx"; const char password = "xxx";
Bounce debouncer = Bounce(); GoogleHomeNotifier ghn;
void setup() {
// Setup the button with an internal pull-up : pinMode(BUTTON_PIN,INPUT_PULLUP);
// After setting up the button, setup the Bounce instance : debouncer.attach(BUTTON_PIN); debouncer.interval(5); // interval in ms
Serial.begin(115200); Serial.println(""); Serial.print("connecting to Wi-Fi"); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) { delay(250); Serial.print("."); } Serial.println(""); Serial.println("connected."); Serial.print("IP address: "); Serial.println(WiFi.localIP()); //Print the local IP
const char displayName[] = "Devin"; /// Change this, must match the name of Google Home
Serial.println("connecting to Google Home..."); if (ghn.device(displayName, "en") != true) { Serial.println(ghn.getLastError()); return; } Serial.print("found Google Home("); Serial.print(ghn.getIPAddress()); Serial.print(":"); Serial.print(ghn.getPort()); Serial.println(")"); }
void loop() { debouncer.update(); if ( debouncer.fell() ) { if (ghn.notify("Someone is at the door!") != true) { Serial.println(ghn.getLastError()); return; } } }