originallyus / node-red-contrib-alexa-local

An easy-to-use NodeRED node for adding Alexa capability to NodeRED. NO Alexa Skills required.
108 stars 25 forks source link

Feedback inside the Alexa app. #45

Closed burleanu closed 6 years ago

burleanu commented 6 years ago

Hello, Thank you for creating this node. It is working very nice.

Is there any chance of getting the feedback from the node inside the Alexa application? For example I'm thinking that you can put inside the configuration of the node inside node-red for the settings of increase/decrease value. This way can be used like now. I think... Also we can set how much means increase/decrease. In my opinion I think is very helpful to have inside the Alexa app the feedback of what light is on. For example in case I forgot one open and I left my house. This way is not needed to create some other cloud app to check out the status. Of course if is not that difficult to make. If you don't want to modify that much the node maybe teach me how to change inside that "index. js" file what I need to change to get there. Thanks again for the creation of this.

torinnguyen commented 6 years ago

The on/off state shown in Alexa previously was always ON. This has been fixed in version 0.3.16 onwards. However, the brightness shown in Alexa app will always be 49%. This is intentional.

You can make use of 'change_direction' and 'bri' output parameter & your own custom logic to define how much increase/decrease you want inside NodeRED. This can't be done via Alexa app.

thePhilipp commented 6 years ago

Hello Torin,

I'm also looking for a way to show the status of a switch in the Alexa app. Is it possible to configure the input of the Alexa Node so that it can forward the mqtt feedback of a smart-switch to the Alexa app? Unfortunately, if I switch the switches over my Node Red Dashboard, I can not see it in the app.

regards Philipp

torinnguyen commented 6 years ago

@thePhilipp can you take a screenshot of your NodeRED flow? It should be already possible in the latest version of alexa node.

thePhilipp commented 6 years ago

the base of my flow is from this video https://www.youtube.com/watch?v=vg436GGmvfM

flow_switch with alexa dashboard kuche

The mqtt feedback from my sonoffs ( msg.payload = "ON" or "OFF") change the status off the the Dashboard switch but doesn't change the status in the Alexa app. What is the right msg.payload for the alexa node input to switch the status in the app?

if you need more explenation to my flow let me know

torinnguyen commented 6 years ago

I've mentioned in the previous comment, this is already possible in the current version of the node. The on/off state shown in Alexa app is updated correctly. However, the brightness shown in Alexa app will always be 49%. This is intentional, not a bug. Take a look at this demo video https://youtu.be/a6hX_959ID8

The input payload format is directly compatible with SONOFF switch because I've designed it that way. Take a look at the documentation embedded in the node info.

input_payload

The important thing is you need to enable Input Trigger option in Alexa node. It is disabled by default.

input_trigger
thePhilipp commented 6 years ago

I know this checkbox but If i enable the input trigger there is a infinite Loop because i have the dashboard Switch in my Flow. Ok, i will try another Set Up in my Flow and then report

torinnguyen commented 6 years ago

i see. In that case, you can use a Function node behind Alexa node to do some filtering based on topic parameters to avoid infinite loop.

thePhilipp commented 6 years ago

have you a example for me? Unfortunately, I have almost no idea of javascript

thePhilipp commented 6 years ago

ok, i have a solution. It's not nice but it work. I block the infinite loop with two trigger nodes. The first one let the feedback from my Sonoffs pass one times and the second trigger-node reset the first one after 70 milliseconds. flow_switch with alexa and feedback trigger1 trigger2

torinnguyen commented 6 years ago

I have no problem using SONOFF + UI Switch with Alexa Node. Both Alexa app & UI Switch are updated when I interact with UI Switch or issue voice commands.

Video showing no infinite loop http://take.ms/0D8bF

node-red 2018-04-06 05-59-38