Replies: 3 comments
-
If anybody is curious, I am doing some testing. I think I have a solution that will work through a python script that queries the bluetooth input and sends commands to HyperHDR via the JSON interface. If it all works as expected I will share the results and the script and a walkthrough of how I achieved it. |
Beta Was this translation helpful? Give feedback.
-
Provoded Python Script Ok, so I wanted to share my solution here. I went with a custom python script I wrote which listens to bluetooth events and then sends commands to HyperHDR via the json API. I tried another python script which used the web sockets API to communicate with HyperHDR, however, I found it to be significantly slower. I only included the commands I needed in this script and it is pretty simple, but it can be extended to do whatever you want. The important part is getting the bluetooth events, I'm going to assume you have the basic packages installed on your by, but if not, you will need at least a few.
I'd also recommend an in terminal python editor like micro So first thing I did was to get my harmony remote talking to my Pi over bluetooth. To achieve this I simply ran a few different commands in the terminal. I followed this simple tutorial to do so. First, check the status of your Pi's bluetooth by running If your blootooth is not enabled or active, you need to enable / activate it by running Once it is active. run this command to bluetooth interactive mode. This just makes it easier to work with the bluetooth service so you don't have to type "bluetoothctl" every time Now, scan for devices by running It will run a continuous scan and you should see your harmony remote at some point. Mine was there with the name "Harmony Keyboard". Find it and write down the mac address of your remote. It is in the format "FC:69:47:7C:9D:A3". Next, before actually pairing your device, you need to add it to your Harmony remote. To do so, add a new "Entertainment" device. For the manufacturer use "Microsoft" and for the device name use "Kodi". It should find one option. Finish setting up your device as normal on the remote. At this point, the device is added, not not linked to your. In order to do that you need to add it to an activity. So make a simple activity ( you can delete it after if you want ) and add just the Pi device to it. Proceed through the setup and before it completes it will then ask you to pair your device. Now run this command on your Pi. ( replace with the mac address of your harmony ) It should ask you to confirm the pairing ( If I recall correctly ) so choose yes. It should now be paired and connected, but if for any reason it did not connect, just run this to connect. And lastly, tell the Pi to trust your device. Now that your Harmony is paired with your Pi, we can start receiving commands. To do that, I used a package called evdev which you should already have installed. First thing to do is get a list of your connected devices and their paths. Run this command Now copy the supplied python script harmony.zip to the root of your home/pi directory and then open it in the micro editor There are some variables you can set, but the most important one is DEV_PATH. Replace that with the path to your harmony device. You can change the defined key codes used for different events you want to send to HyperHDR or add your own as well. Save the file with ctl-q and then quit micro with ctl-q at this point if you want to test the script you and run it with It should say it is waiting to connect to the device and once it stops saying that it will be connected. If it doesn't stop, press a button on your remote. Now press any button and it will print out the command it received ( as well as send certain ones to HyperHDR already ) stop the script with ctrl-c, or in my case I had to use ctrl'\ because ctrl-c wasn't working. Now the last thing we want to do is set this script up to run as a service so it is always running. In the terminal run the following This will open a new file in micro at that location. Add the following to the file, and yes, copy and paste works in micro. [Service] [Install] save with ctrl-s and quit micro with ctrl-q. Now run the following to register the service. That's it. If you want to check the status of the service you can do so with. Now your harmony remote should be able to control HyperHDR all you want. The only unfortunate part is that you cannot run it as a "Home Control", which means you can't use those bottom buttons ( if you have the elite ) which you use for your Hue Lights. However, there is another solution I am investigating which if it works would allow me todo trick my Harmony remote into thinking that HyperHDR is just another Hue light. That would allow me to use the Home Controls on the remote as well as control HyperHDR with the Hue app. It's called DYIHue. For now though, this seem to do the trick and work well. One additional thing to note is that the bluetooth seems to go to sleep after a bit and you need to press the remote button two times to get a result. Once to wake it up and once to send the command. For this reason I adjusted the power routine of the Raspberry Pi device on my Harmony app so that it sends the commands to turn HyperHDR on/off twice with a 2 second delay in between. It seems to be working. I also just added these to my bluetooth config, but have not tested if it made a difference or not. I just ran and don't forget to restart bluetooth after that Hope this helps someone and if I have any luck with the DYIHue and it seems better, I will update this thread. If anybody runs into trouble following these steps, just reach out and I will try to help. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Great job! I will pin it to the Wiki later. I use Harmony Remote (650 without a hub) with flirc. It's a pity, it really is a pity that Logitech abandoned the Remote branch. Maybe it's the upcoming automation and assistants from Google or Amazon (but maybe we don't want to use them at all?), but these products were great and actually reached the pinnacle of what's possible in this field. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm curious if anybody has successful been able to control your lights with a harmony remote / hub. I have read that the harmony can connect to a raspberry via bluetooth, but I also have a usb flirc if I must use that. What would be the best approach? Would I need to install some additional software onto the pi which listens to these commands and notifies HyperHDR via the JSON interface?
What I would like to do is have the option to turn the lights on / off for certain activities. Ideally, I would also be able to control the brightness as well by pressing up and down, increasing and decreasing by 5 to10%.
If that is the correct way, does anybody know what / how to install software for receiving those commands and doing some logic, like sending the REST commands?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions