Configuration with Alexa Echo Dot

Hello,

I’ve installed OpenHAB2.3 on RPI and have followed through this tutorial. https://www.openhab.org/docs/ecosystem/alexa/#general-configuration-instructions

I’ve also installed Amazon Echo Control Binding https://www.openhab.org/addons/bindings/amazonechocontrol/#note
And my Things are all online.

I have no idea how to create anything with this. I’d like to test the environment with a rule that when my phone enables bluetooth, RPI notices this and makes Alexa greet with “hello”.

rule "Say hello when recognizes bluetooth device"
when
   Item Echo_Living_Room_BluetoothMAC
 then
     Echo_Living_Room_TTS.sendCommand('Hello World')
 end

Is there any way to know if even the syntax is correct?
Any help is appreciated. Thank you.

  • Platform information:
    • Hardware: RPI 3 model B+
    • OS: openhab2.3.1

Also, see How to use code fences for a way to post code in a way that is readable on the forum.

The syntax is NOT correct.

On what event on Item Echo_Living_Room_BluetoothMAC do you want to trigger the Rule? When this Item changes? When it changes to a specific value? When it is updated? See the second link for all the possible Rule triggers.

Does the Alexa binding somehow see when your phone enables BT and change this Item accordingly? Or are you using some other binding to detect your phone?

Hello,

Sorry for late reply. So about the syntax. I’ve understood that while writing rules, with when it is possible to use events from log viewer as the argument.

I’ve edited my rule:

rule "Say hello when recognizes bluetooth device"
when
   Item Echo_Living_Room_Bluetooth changed from OFF to ON
then
   Echo_Living_Room_TTS.sendCommand('Hello bluetooth')
end

This is just test as it just makes Alexa to greet when I’ve clicked bluetooth ON from paper ui control panel.

No it doesn’t see. Alexa binding reacts (or as the log viewer shows) when I’ve connected my phone to Alexa through bluetooth, but after that I don’t know how to proceed.

I am not sure if using Item Echo_Living_Room_BluetoothMAC is best way to go about this. Actually I don’t know how I would get the information about phone connecting to bluetooth. Maybe by using some bash script in a rule to scan with rpi some predetermined device MAC address and when a known address is found then have Alexa greet. Actually this self reflection session was really helpful.

It may be worth stepping back a little and explaining what your trying to achieve first. I read a lot of the posts, mainly because I’m looking at what ideas people have had and see if I can use them myself. I’m also nosy. What I have found recently is that a lot of people are trying to resolve issues they have come across or put in solutions to a problem they want to fix but don’t really understand fully what openHAB or Home Automation can do.

I’d really like to be as helpful as possible but for me to be able to do that I need to really understand where the problem lies. Sadly I don’t always have the answers but do try and give pointers.

Although you’ve asked if the syntax is correct, you haven’t given much context to work with.

1 Like

Hello,

I’m new with using forum as a problem solving tool. I need to get some perspective how to open things systematically. Bear with me.

Yes you are correct, I don’t fully understand whan openHAB can do.

I am trying to get Alexa to greet me when some device with a known MAC address is detected ie. my phone in this case. Earlier the problem was totally that I didn’t at all understand how openHAB works.

Now I’ve got the rule to work so the syntax is not my main problem anymore.
I want to find a way to automatically detect my phone. Maybe the way to go is to implement some simple hcitool script and check if it is possible to get openhab rules work with it.

This is commonly called the XYProblem. http://xyproblem.info/

Here is a good place to start with that.

Step back a bit. Why MAC address? Why not IP address or some combination of sensor readings? See Generic Presence Detection for how you would combine multiple sensor readings into one “presence” Swtich.

Have you searched for “presence detection” on the forum? There are hundreds of postings a good portion of which are tutorials.

1 Like

With “presence detection” keyword I found a new realm of possibilities. Just what I needed. Thank you!

A good place for new ideas to use with Alexa is this thread.
I know it has 1400 replies but you´ll find some good ideas how to use Alexa with openHAB.

I´m currently building rules to get informations that are normally not known in the Alexa world.
Like “Where is Michael” and openHAB will reply through Alexa with my current address based on my phone location.

As Rich already said, it´s easier to help you if you tell us what your goal is and not what your current problem is.

kind regards
Michael

Thank you for the tips!

Jesse