Tutorial: Controlling any Device with Alexa and Node Red, NO CLOUD

Control any of your #HomeAssistant devices, including lights, using alexa and #NodeRed. You’ll still need an internet connection but, you won’t need a cloud subscription or make any Alexa skills…

Edit: GitHub Page for Function Node Code: [u]https://github.com/3ative/HA-Alexa[/u]

6 Likes

Good catch.
Does it work with any echo device?
Like Dot, Echo, Echo Plus…etc?
I remember a module that worked only with particular amazon echo version.

I haven’t tried with all - My setup works with my 2nd Gen Dots and the APP on my phone.

1 Like

Oh god another video. Is this written down anywhere?

1 Like

What would you like written down?

I have included the code - See video description for a GitHub page link.

What github page? There is no link in your post at all

1 Like

I think you missed the point.

Post the link in this thread so people don’t have to go to the video and find it.

yep, hit the nail!

The point of this post is to direct you to watch the video, just viewing the code out of context would be futile IMO :slight_smile:

Because we have never seen a node-red flow before?

GitHub Page for Function Node Code: https://github.com/3ative/HA-Alexa

I’m sorry my OP caused you to click the mouse a few extra times and do a bit more reading.
I don’t understand why you would rather take the extra time to type this conversation than simply sit back and watch a video. :rofl:
Trust me, It would take a lot less time do write out the tutorial but, then you would lose the demo! :crazy_face:

Not putting the link in the original post make it look like you just want video views. I could care less about clicking.

Ermm… wanting views is the whole point of making a video!
The same way as writing text is wanting people to read it. :smiley:

I use a similar method, but without node red, only with home assistant and ‘Live Sensor Reports’ with alexa_media_player. You need to then expose the “light.alexa_virtual” to your alexas.
This is the same as exposing any HA device to your alexa’s and not directly related to this component. You can do this with emulated_hue, haaska, or the HA cloud.

live-sensor-reports

see: https://github.com/custom-components/alexa_media_player/wiki/Examples%3A-Automation#live-sensor-reports

This requires:

  • Alexa routine
  • Home assistant alexa_virtual (255 actions per sensor)
  • Home assistant automation
    with script.

automation sample

## ##################################################
##   Live Sensor Reports EMULATED HUE DEVICE
## ##################################################

- id: alexa_report
  alias: "Alexa Report"
  initial_state: true
  trigger:
  - platform: state
    entity_id: light.alexa_info
    to: 'on'
  condition:
  action:
    - delay: 00:00:01 
    - service: system_log.write
      data_template:
        message: "Automations: Alexa-Reoport Value: {{states.input_number.alexainfotask.state}} | Index:{{(( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int}} "
        level: info
    - service: light.turn_off
      entity_id: light.alexa_info
    - service_template: >
        {% if( (( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 1  %}
           script.taskmessage1  
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 0 %}
          script.taskmessage1
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 2 %}
          script.taskmessage2
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 3 %}
           script.taskmessage3
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 4 %}
           script.taskmessage1
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 5 %}
           script.taskmessage2
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 6 %}
           script.taskmessage3
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 7 %}
           script.taskmessage1
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 8 %}
           script.alexaheizunginfo 
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 9 %}
           script.housetempinfo
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 10 %}
           script.taskmessage3
        {% elif((( states.input_number.alexainfotask.state | int)  / 255 * 20  |  round)  |  int )   == 16 %}
           script.alexahausinfo   
        {% else %}
           script.taskmessagenotfound
        {% endif %}
      data_template:
        mode: 1

Thanks to the excellent implementation of Alan Tse, this is easy to use and no additional programs are required. Easy to use :smile:

1 Like

Except for the monetization angle and the fact it’s awkward to read code displayed in a video (hence the request to post the link to the code here).

I already use node-red-contrib-amazon-echo but I watched the video and appreciate the part about controlling color lights (i.e. the code in the function node). Thanks for that. However, you are detracting from the video’s usefulness by not posting a simple link to the code in your first post. Explaining why you don’t want to do it is far less useful to your audience than simply posting it.

1 Like

Do you see ADs on any of my videos?? :sweat_smile:

  • (If there is, it’s not my doing) - I don’t get a penny for making these tutorials, nor do I make them for profit. I do so to share what I use and/or have learnt. :sunglasses:
    The purpose for my post was to share the video, the code link is in the description for those that want to take it further and replicate my setup after watching the video. :flushed:

So, everyone else… I’m sorry for the confusion - I read this forum title as “Share your Projects!” and assumed that sharing my project (in the form of a video) was the best way of showing what I’ve made. :upside_down_face:

3 Likes

Thank you for adding the link to your GitHub repo in the first post.

2 Likes

Well, everyone seemed to be wanting it - Can’t please them all, ah? LMAO

Thanks, really interesting!

Is there any way to get it to work with thermostats (climate devices) as well or can you just control lights and switched with this?