vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
383 stars 69 forks source link

getting Colors #75

Closed pvint closed 3 years ago

pvint commented 5 years ago

Original report by Melric (Bitbucket: ErnyBert, ).


Hi,

at first: thanks for the great lib. Is there a posibillity to get out an color from Alexa? Like: "Alexa, Set XY Color to Orange".

I have a ws2812-stripe connected with an esp8266 (fauxmo V3.10) and an Echo gen2. At the moment i change the color by using the brightness-value.

Thanks, Erny

pvint commented 5 years ago

Original comment by Kyle Mcbride (Bitbucket: Kyle471, GitHub: Kyle471).


Can you share the code for this as I am trying to do the same, thanks

pvint commented 5 years ago

Original comment by Kyle Mcbride (Bitbucket: Kyle471, GitHub: Kyle471).


I wonder if the FastLED library as that allows color control with hue sat and bri is the answer?

Looking at the coding for the hue bulbs

"state": { "on": false, "bri": 1, "hue": 33761, "sat": 254, "effect": "none", "xy": [ 0.3171, 0.3366 ], "ct": 159, "alert": "none", "colormode": "xy", "mode": "homeautomation", "reachable": true },

and the code on templates.h "\"state\":{" "\"on\":%s,\"bri\":%d,\"xy\":[0,0],\"reachable\": true"

possibly editing this could add the function we are looking for?

https://developers.meethue.com/develop/hue-api/lights-api/

pvint commented 5 years ago

Original comment by User_0815 (Bitbucket: LtheF, ).


Hey Melric, i am currently trying to do the same thing like you, i am trying to controll a ws2812b with alexa using a wemos d1 mini. But everytime i set more than around 100 Leds at the same time to a color using the leds[number] = CRGB(values); and then show them with the FastLED.show(); method the Wemos gets displayed as "Unreachable" in the Alexa App... Maybe you have any Idea what the problem could be, i allready tried setting the cpu frequency to 160 mhz, i would appreciate every sort of help :D (btw. sorry for my bad english)

pvint commented 5 years ago

Original comment by ThorC (Bitbucket: thorlucasdev, ).


I'm taking a look at the code for fauxmoESP. Looks like they don't handle sat or xy requests, instead only the bri. After dumping the request body, it seems that alexa is indeed sending out xy info. I'm trying to implement support for xy values right now.

pvint commented 5 years ago

Original comment by Aircoookie Development (Bitbucket: Aircoookie, GitHub: Aircoookie).


My library Espalexa emulates parts of the Philips hue bridge and has color devices support: https://github.com/Aircoookie/Espalexa Feel free to take a look at the source if you'd like to add similar functionality to FauxmoESP! While testing I noticed though that xy is not yet supported, which only causes certain Echos that send hue + sat to work with color support.

pvint commented 3 years ago

Done in 9702aec8d6c82e41c21c6e528cf02d14e98ca807