Aircoookie / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi!
https://kno.wled.ge
MIT License
14.24k stars 3.03k forks source link

Integration with Google assistant #31

Open pradhyuman18 opened 6 years ago

pradhyuman18 commented 6 years ago

How can I Control it with Google assistant

Aircoookie commented 6 years ago

Hi,

sorry that is not possible because the Google Assistant doesn't have a local API. I'd need to have a complicated cloud infrastructure to support Google home which I can't do as a small open source project.

You can do it with the free IFTTT website though, which is compatible with google Assistant. It requires you to do a router port forwarding so the ESP8266 is accessible from the internet. Then you need two IFTTT Webhooks applets that trigger <YourPublicIP>:<YourESPNetworkPort>/win&T=1 for on and <YourPublicIP>:<YourESPNetworkPort>/win&T=0 for off, respectively.

Aircoookie commented 5 years ago

This is not a bug, and there is no way for me to add native Assistant support in the near future sadly. Therefore I close this issue now. Feel free to reopen it if you have any further ideas :)

nightflasher commented 5 years ago

Könnte man nicht eine von Google unterstütze api integrieren? Die api von tuya smart (smart life) ist offen und soll leicht verständlich sein. Viele sub-hersteller (smart life oder auch hama) nutzen die. Vielleicht hilft ja der link? https://docs.tuya.com/en/cloudapi/cloud_access.html#access-mode

Aircoookie commented 5 years ago

Könnte man überlegen. Würde sicherlich funktionieren, aber im Moment möchte ich keine cloudabhängige API integrieren. Es ist aber möglich, das Ganze mithilfe von IFTTT und Blynk zu bauen: https://www.instructables.com/id/GOOGLE-ASSISTANT-CONTROLLED-SWITCH-USING-NODEMCU/ dazu könnte ich mal ein an WLED angepasstes Tutorial erstellen, weil Blynk ja schon implementiert ist.

nightflasher commented 5 years ago

Hey, ja mit ifttt habe ich schon einiges umgesetzt; aber die weiblichen Mitglieder der Familie bombardieren die Google home Geräte mit Phrasen die ich vorher nicht angelegt habe und sind dann enttäuscht, wenn auf "hey Google, lightbox Farbe Lavendel" die Farbe dann nicht umgesetzt wird. In cloud APIs geht's dann aber.

Vielleicht könnte man die Farben ja sprachbasiert mit rgb Werten hinterlegen? /win&color=red/rot

aenertia commented 4 years ago

This is now possible as there is a local API exposed in the New SDK i think this should be reopened. https://developers.google.com/assistant/smarthome/concepts/local

bitterdog commented 4 years ago

This is now possible as there is a local API exposed in the New SDK i think this should be reopened. https://developers.google.com/assistant/smarthome/concepts/local

right on!

Aircoookie commented 4 years ago

Not yet looked into it in detail, but I agree that this is a promising change!

Algebruhm8 commented 4 years ago

Any update as to having google automation? I've tried using WebCoRE with Smartthings, no luck. Couldn't do Blynk as I'm new to programming. I already set up my ESP8266 with my WS2812b lights and WLED but I want at least Google home to turn them off or on. Any other ideas? I tried adafruit but i'll have to see as I followed a tutorial and I got a bit lost

tommasopeduzzi commented 4 years ago

Are there any updates for this feature? I'm looking forward to being able to control my lights with my google home natively!

axlan commented 4 years ago

I spent a little time getting the Blynk webhook working for one of my projects. It takes a bit of leg work, but here's a write up of what I went through to use Google Assistant via IFTTT and Blynk: http://www.robopenguins.com/web-based-door-control-update/

null-route commented 4 years ago

Relevant to this issue: Google announced that their Local Home SDK has emerged from developer preview and is now GA:

https://developers.googleblog.com/2020/04/local-home-sdk-ready-for-actions.html

t6a commented 4 years ago

This would make WLED even more user friendly and ready for the mass

geekafy commented 4 years ago

Just reading the updates, this is exciting! Can't wait to see this feature land! :-) Keep up the great work!

akshat-aqui commented 4 years ago

Is there a tutorial how can i integrate wled with google assistant?

jgrafwallner commented 4 years ago

Watching this open issue eagerly!

spiff72 commented 4 years ago

Following this one as well. My kids will appreciate the ability to control their desk LEDs with the Google home speakers in their rooms!

Legsmaniac commented 4 years ago

+1 here for Google Integration in the near future too. I'm a Google fan more than I am an Alexa fan. Although, besides IFTTT, I could control it with Home Assistant but I would rather see direct native support. 🙃

Legsmaniac commented 4 years ago

Is there a tutorial how can i integrate wled with google assistant?

Found this. Any help? @Aircoookie ?

justusiv commented 3 years ago

I was able to set this up. First using this guide for having a static FQDN with a cert https://www.youtube.com/watch?v=hqRT2VKhxJ0 i had no router loopback problems. Then i mainly used the https://www.home-assistant.io/integrations/google_assistant/ guide to do the rest. I think i also watched https://www.youtube.com/watch?v=MMtCzX6US9M and https://www.youtube.com/watch?v=mDqllkmxiOI the only gotcha was google no longer accepts the apikey and will only accept a json fil. so i had upload my json file i got from google to home assist and make my config file look have this. google_assistant: project_id: myproj-845100 service_account: !include myproj-43756435645.json

The part i dont have working and would be happy to do a write up if i figured out how would be how to change things like fx via google.

justusiv commented 3 years ago

after briefly talking to @Aircoookie and "e_town" on discord i was able to setup saying things like "OK google turn on Bedroom popcorn effect" Since there are currently 103 effects and 52 palettes i decided to whip up a quick PowerShell the generates the data for the configuration files. No real time was spent on this but should work for the basics. https://gist.github.com/justusiv/177c0750a1936486b735a2a2d503e424

EDIT I should also note that there are several words that google assist doesn't really like. Things like "twinklecat" should be twinkle cat otherwise google doesn't know what to do. also things like "eyes" and "ice" get it easily confused. maybe adding triggers for both would be the best handle of that. and the last thing i added was a random one as well.


bedroom_random:
    name: Bedroom Random

set_random: 'curl "http://192.168.0.123/win&FP=$(( $RANDOM % 51 ))&FX=$(( $RANDOM % 102))"'

- id: '9999999950051'
  alias: random
  description: ''
  trigger:
  - entity_id: input_boolean.bedroom_random
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data: {}
    service: shell_command.set_random
  - delay: 00:00:10
  - data: {}
    entity_id: input_boolean.bedroom_random
    service: input_boolean.turn_off
Fade97 commented 3 years ago

Hi, just wanted to ask if there are any news on the integration?

anjeshshrestha commented 3 years ago

maybe it can have more future support once Connected Home over IP becomes more developed and supported

https://github.com/project-chip/connectedhomeip#connected-home-over-ip https://www.connectedhomeip.com/

Aircoookie commented 3 years ago

CHIP seems awesome! Perhaps this is finally the standard we've been waiting for that will ideally work with all major voice assistants without needing a "manufacturer server". I just hope that the overhead for implementing security won't be too much for an ESP8266, they tend to be quite unusable in most things crypto.

flipside101 commented 3 years ago

maybe it can have more future support once Connected Home over IP becomes more developed and supported

https://github.com/project-chip/connectedhomeip#connected-home-over-ip https://www.connectedhomeip.com/

isnt this what zigbee was suppoed to be until it got butcherd by the very people involved in CHIP ?

Ahh so its not a radio its piggybacking over other radio stacks, ooh i wonder if this could be used to run connected lights/switches/sockets on ethernet over power (powerline) well when they support ethernet that is

ShiHotKeyMushroom commented 3 years ago

The part i dont have working and would be happy to do a write up if i figured out how would be how to change things like fx via google.

I haven't had the chance to go through those links yet, but is it controlling it via http request on the local network? If so I think I can help you with controlling the fx.

tronicsmasta commented 3 years ago

Ok got it working using Google assistant and IFTTT. Took all day of experimentation. Will make an instructable soon

ShiHotKeyMushroom commented 3 years ago

I am looking forward to it! Does it allow for the effect to be changed?

On Fri, Nov 27, 2020, 19:14 tronicsmasta notifications@github.com wrote:

Ok got it working using Google assistant and IFTTT. Took all day of experimentation. Will make an instructable soon

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Aircoookie/WLED/issues/31#issuecomment-735015952, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARX5XD35GF5SXIWVAINFDCTSSA6IFANCNFSM4FH2MTMQ .

tronicsmasta commented 3 years ago

I am looking forward to it! Does it allow for the effect to be changed? On Fri, Nov 27, 2020, 19:14 tronicsmasta @.***> wrote: Ok got it working using Google assistant and IFTTT. Took all day of experimentation. Will make an instructable soon — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#31 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARX5XD35GF5SXIWVAINFDCTSSA6IFANCNFSM4FH2MTMQ .

Yes!!

tronicsmasta commented 3 years ago

Done! Thanks Aircookie for making such a flexible platform! https://www.instructables.com/WLED-on-ESP8266-IFTTT-Google-Assistant/

ShiHotKeyMushroom commented 3 years ago

Would it be possible to use ingredients in the "if" side of ifttt to control certain aspects of the lights?

On Sat, Nov 28, 2020, 00:09 tronicsmasta notifications@github.com wrote:

Done! Thanks Aircookie for making such a flexible platform! https://www.instructables.com/WLED-on-ESP8266-IFTTT-Google-Assistant/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Aircoookie/WLED/issues/31#issuecomment-735041056, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARX5XDYB6PV3ZPFIDHNSIP3SSCAZHANCNFSM4FH2MTMQ .

tronicsmasta commented 3 years ago

Would it be possible to use ingredients in the "if" side of ifttt to control certain aspects of the lights? On Sat, Nov 28, 2020, 00:09 tronicsmasta @.***> wrote: Done! Thanks Aircookie for making such a flexible platform! https://www.instructables.com/WLED-on-ESP8266-IFTTT-Google-Assistant/ — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#31 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARX5XDYB6PV3ZPFIDHNSIP3SSCAZHANCNFSM4FH2MTMQ .

I haven't tried that yet. I was excited I got it to work with http requests. Will try with dynamic parameters today and maybe I can get json working with it.

ShiHotKeyMushroom commented 3 years ago

I tried setting this up for myself...but my port forwarding doesn't have specific internal ip as one of the parameters...so...gotta figure out what's going on there...

On Sat, Nov 28, 2020, 09:47 tronicsmasta notifications@github.com wrote:

Would it be possible to use ingredients in the "if" side of ifttt to control certain aspects of the lights? … <#m-5665600193391410153> On Sat, Nov 28, 2020, 00:09 tronicsmasta @.***> wrote: Done! Thanks Aircookie for making such a flexible platform! https://www.instructables.com/WLED-on-ESP8266-IFTTT-Google-Assistant/ — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#31 (comment) https://github.com/Aircoookie/WLED/issues/31#issuecomment-735041056>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARX5XDYB6PV3ZPFIDHNSIP3SSCAZHANCNFSM4FH2MTMQ .

I haven't tried that yet. I was excited I got it to work with http requests. Will try with dynamic parameters today. That is what the little + symbols are in between if this + then that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Aircoookie/WLED/issues/31#issuecomment-735239714, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARX5XD6BTF4KTMII7RCVKFLSSEEQXANCNFSM4FH2MTMQ .

tronicsmasta commented 3 years ago

Send me an email, my username @ gmail dot com

f1vefour commented 3 years ago

Done! Thanks Aircookie for making such a flexible platform! https://www.instructables.com/WLED-on-ESP8266-IFTTT-Google-Assistant/

Thank you for the instructions.

tronicsmasta commented 3 years ago

Welcome!

On Sun, Dec 6, 2020, 12:33 AM Tim notifications@github.com wrote:

Done! Thanks Aircookie for making such a flexible platform! https://www.instructables.com/WLED-on-ESP8266-IFTTT-Google-Assistant/

Thank you for the instructions.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Aircoookie/WLED/issues/31#issuecomment-739472494, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR5KSXPDTZPRWBFIM33YAQTSTM6U5ANCNFSM4FH2MTMQ .

LukePrior commented 3 years ago

Looking forward to an official integration!

kurtjcu commented 3 years ago

I HATE the idea of opening ports and using IFTTT. Very bad idea imho! Is there anyone working on a direct GA integration? I am keen to work on one just checking to make sure I am not re-inventing the wheel. :)

luismasg commented 3 years ago

google launches something called google actions local SDk. it says all the right things.

it allows thr google.home mini to make requests to other devices.

https://developers.googleblog.com/2019/07/developer-preview-of-local-home-sdk.html?m=1

i haven't read it completely yet

axl12ap commented 3 years ago

google launches something called google actions local SDk. it says all the right things.

it allows thr google.home mini to make requests to other devices.

https://developers.googleblog.com/2019/07/developer-preview-of-local-home-sdk.html?m=1

i haven't read it completely yet

Good starting point, have you any idea on how to do it? @Aircoookie did you read the article?

Aircoookie commented 3 years ago

@axl12ap yes, they even had a preview of it two years ago. Unfortunately, it does not seem like the new SDK would be useful for WLED's use case as the local option is merely there to reduce latency, device discovery is to my understanding still not possible without a "manufacturer cloud"...

luismasg commented 3 years ago

ok screw it. it can't be done stand alone. but then wled is DIY.

I have no problem writing an express app on a raspberry pi and have it send GET requests to WLED.

or something

I'm intrigued with getting a hubitat. I've seen i believe, the hookup guy mention it.

on 'google, light up my bed', send GET to wled

i've seen no comments or projects or tutorials on something like this.

any ideas? a mere link would do.

we could get a old android to act as a wled bridge in liu of a rpi.

balucanb commented 3 years ago

Just read through the whole issue, I noticed only ESP8266 was mentioned, will a ESP32 work with this also?

Aircoookie commented 3 years ago

@balucanb sorry, it does not work with ESP32 either. Almost all WLED features are the same on both platforms.

spiff72 commented 3 years ago

Not sure this is 100% relevant to this thread issue thread, but if you have Samsung Smartthings, WLED can be integrated with that, and Google assistant has some ability to control them. I used this to do it: https://community.smartthings.com/t/wled-with-smarthings/175628/8

Ryanb58 commented 3 years ago

I might be able to build a service that does this.

IMO, the hard part would be building a way for IT to talk to our WLED instances without port forwarding.

One method I thought of would be to have a setting in WLED where it would poll an HTTP server every few seconds until it got a response that told it to change its current settings.

It's not the push like notifications we've come to love, but it's an idea. I'll let everyone know if I actually make an attempt at setting something up like this.

luismasg commented 3 years ago

@Ryanb58 i just realized my comment was imcomplete. yes, the port forwarding thing. i was talking about installing the Google smarthings sdk on a rpi and make the rpi masquerade as a lamp or whatever.

after it recieves the command from the google cloud. then it forwards it to your local network to wled. it it posible that I'm simply describing what node-red does(doh!) or home assistant. i still have some learning to do.

surely all the google enabled things don't require port forwarding.

Aircoookie commented 3 years ago

@Ryanb58 that would be absolutely amazing!

One method I thought of would be to have a setting in WLED where it would poll an HTTP server every few seconds until it got a response that told it to change its current settings.

It's not the push like notifications we've come to love, but it's an idea. I'll let everyone know if I actually make an attempt at setting something up like this.

How about MQTT? The publish/subscribe type messages mean no polling and thus almost instant change. I've thought about the architecture [Google] <> [Integration] <> [MQTT-Broker] <> [WLED-Device] before, but I honestly have no idea how to build a service that integrates with Assistant, authenticates the user, and so on.

Ryanb58 commented 3 years ago

Little bit of progress: Today, I was able to successfully send commands from my Google Assistant to an AWS Ec2 instance I set up(after the oauth 2.0 authentication was established). No progress with sending commands to the actual WLED devices yet. Still need to figure out a way to get it to connect to my public server that is exposed to the internet(required by Google Assistant).

@Aircoookie The ways to send change requests(JSON, MQTT, etc…) are only available on the local network(inbound/outbound traffic issue). To pursue the MQTT approach, I think I would need a Samsung SmartThings device or something similar. I'd like to go at this with an approach that doesn't require me to have to buy any more hardware. Depending on how I can establish the connection.

Side Note/Discovery: With Google's requirement to have a public OAuth 2.0 server running for authentication... it is going to(already is) costing me $$ to operate. IDK how I am going to deal with that, but one thing at a time.

Ryanb58 commented 3 years ago

@Aircoookie I may not understand MQTT. I'm going to do more research into it. My last comments about it may not apply.