I'm using the BEOMOTE arduino sketc
I have just tried it today, but it recognises a code, and you need to wait a second or 2 before it can recognise the next code... Do you have this problem?
I'm using the BEOMOTE arduino sketc
I have just tried it today, but it recognises a code, and you need to wait a second or 2 before it can recognise the next code... Do you have this problem?
No, this can and should be much faster. Without a proper 'repeat' code, ie holding a button, the base IR can repeat 4 times a second.
No, this can and should be much faster. Without a proper 'repeat' code, ie holding a button, the base IR can repeat 4 times a second.
I bought an Arduino starter kit as something my 9 year old son and I can experiment with together. He's pretty keen on the " hacking" project as they call remote control.
our first issue is getting started with our computer which runs windows 8!
Looking forward to working with him on it.
Hi,
Is the link above still working ? i will be happy to try it and use it ! Thanks !
ER
link does not work
Link still not working.
Hi,
i was working on a solution to control my Philips HueLight System. I had a MLGW in use and this was working fine with macros.
I updated my Beo stuff more and mor to the newer NL products, such as Beoplay M5, A6 etc.
A Beosound 9000 and a Beosision 8 were still remaining and should stay for a while.
I added a Beolink Nl/ML to add TuneIn and Deezer to my ML System.
My first approach was to connect a raspberryPi using RS485 connection directly to the ML This was working fine, but the problem now is, that the neither Beosound 9000 or Beosvision 8 will forward any Light Commands.
So I added a TSOP7000 to the GPIO Interface using lirc and a python script to control Hue with my Beo4 or Beoremote one.
I can send you the python script if anybody is interested in.
But this solution is not very reliable! Sometimes tooks some seconds to work or needs rebooting. Days of debugging with lirc and refining the code were not very successful. I suppose the raspberry has a lot of other things to do and the bandwith of the TSOP7000 achieves nearly 20khz is too much as to keep synchronised.
My next approach was to use a dedicated Arduino Uno, since they have Ethernet or WIFI on board.
This is working very reliable for more than 3 month now.
What does it do?
1. Pressing Light+ 0...9 selects a Lamp (according to the number in the HUE system)
2. Pressing Light+ GO will turn the lamp on
3. Pressing Light+ UP will increase the lamps brightness in 4 steps
4. Pressing Light+ DOWN will decrease the lamps brightnessin 4 steps
4. Pressing long Red DOT will turn everything on ML and NL and all lights off
I will post the code here if anybody likes to join the project.
Hardware:
- Arduino Uno Ethernet connected to a TPLink Powerline or Arduino Uno WIFI
- TSOP7000 with RC Filter connetd to PIN 2 and 3.3V
Software:
MAC Adress, IPadresse of Arduino
IP Address and user from HUE (generated by HUE REST API, see documnetation)
Light mapping
e.g.
Beo4 Light0 => Hue Lamp 9
May be some timings needs to be adopted (MAXPULSE, RESOLUTION),but this is working on several Aruinos in my home.
sourcecode for the sketch:
#include <Ethernet.h>
#define IRpin_PIN PIND
#define MAXPULSE 6200
#define IRpin 2
#define RESOLUTION 20
const char hueHubIP[] = "192.168.1.64";
const char hueUsername[] = "uJqbOtzyOGsKXgY8-2hE8YftJm8DUC8X654dsTFI";
const int hueHubPort = 80;
byte mac[] = {0x90, 0xA2, 0xDA, 0x10, 0x24, 0x33};
IPAddress ip(192, 168, 1, 39);
uint16_t pulses[64];
uint8_t currentpulse = 0;
boolean startFlag = false;
uint8_t current_light = 128;
int light_map[10] = {9, 11, 12, 13, 14, 15, 16, 19, 20, 23};
int light_brighthness[10] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255};
EthernetClient client;
void setup()
{
Ethernet.begin(mac, ip);
delay(1000);
}
void loop()
{
uint16_t highpulse;
highpulse = 0;
startFlag = false;
while (IRpin_PIN & (1 << IRpin)) {
highpulse++;
delayMicroseconds(RESOLUTION);
if ((highpulse >= MAXPULSE) && (currentpulse != 0)) {
currentpulse = 0;
}
}
if ((highpulse * RESOLUTION) > 14000 && (highpulse * RESOLUTION) < 15800) {
currentpulse = 0;
startFlag = true;
} else {
pulses[currentpulse] = highpulse;
}
if ((highpulse * RESOLUTION) > 11000 && (highpulse * RESOLUTION) < 12500 && currentpulse != 0) {
send_command_toHue();
currentpulse = 0;
}
delayMicroseconds(RESOLUTION * 12);
if (startFlag == false)
currentpulse++;
}
void send_command_toHue()
{
if (currentpulse == 17) {
String command_off = "{\"on\": false}";
String command_on = "{\"on\": true,\"bri\":255}";
String command_up_down = "{\"on\": true,\"bri\":";
byte receiver = 0;
byte command = 0;
receiver = get_hex_digit(pulses, 4, 9);
command = get_hex_digit(pulses, 9, 17);
if (receiver == 0x1B) {
if (command == 0x36) {
if (current_light != 128) {
setHue(light_map[current_light], command_off);
light_brighthness[current_light] = 0;
}
}
else if (command == 0x35) {
if (current_light != 128) {
setHue(light_map[current_light], command_on);
light_brighthness[current_light] = 255;
}
}
else if (uint8_t(command) <= 9) {
current_light = uint8_t(command);
}
else if (command == 0x1F) {
if (current_light != 128) {
int tmp_brightness = light_brighthness[current_light];
tmp_brightness = tmp_brightness - 50;
if (tmp_brightness < 0) {
tmp_brightness = 0;
}
setHue(light_map[current_light], command_up_down + String(tmp_brightness) + "}" );
light_brighthness[current_light] = tmp_brightness;
}
}
else if (command == 0x1E) {
if (current_light != 128) {
int tmp_brightness = light_brighthness[current_light];
tmp_brightness = tmp_brightness + 50;
if (tmp_brightness > 255) {
tmp_brightness = 255;
}
setHue(light_map[current_light], command_up_down + String(tmp_brightness) + "}" );
light_brighthness[current_light] = tmp_brightness;
}
}
}
else if (receiver == 0x0F) {
if (command == 0x0C) {
for (int i = 0; i < 10; i = i + 1) {
setHue(light_map💡, command_off);
light_brighthness💡 = 0;
delay(200);
}
}
}
}
delay(100);
}
byte get_hex_digit(uint16_t pulses[64], uint8_t from, uint8_t to)
{
int bit = 0;
byte digit = 0;
byte receiver = 0;
for (uint8_t i = from; i < to; i++) {
int pulse = pulses💡 * RESOLUTION;
if (pulse > 2500 && pulse < 3500) {
bit = 0;
}
if (pulse > 7500 && pulse < 9500) {
bit = 1;
}
if (pulse > 5000 && pulse < 6500 && i == 0) {
bit = 1;
}
digit <<= 1;
digit |= bit;
return digit;
}
}
boolean setHue(int lightNum, String command)
{
if (client.connect(hueHubIP, hueHubPort))
{
while (client.connected())
{
client.print("PUT /api/");
client.print(hueUsername);
client.print("/lights/");
client.print(lightNum);
client.println("/state HTTP/1.1");
client.println("keep-alive");
client.print("Host: ");
client.println(hueHubIP);
client.print("Content-Length: ");
client.println(command.length());
client.println("Content-Type: text/plain;charset=UTF-8");
client.println();
client.println(command);
}
client.stop();
return true;
} else {
return false;
}
}
So, with your solution you can build B&O light receivers in every room and simply connect them to the ML-Bus?
Hi,
no the ML-Bus solution with Raspberry was not reliable for me. Actually this is a IR solution connected to the Ethernet based on Arduino WIFI / Ethernetshield.
And my remaining ML products (BS9000 MK1 and BV8 with older software) do not forward light commands. So my MLGW could not be triggered to control the HueSystem anymore.
But i have just bought a RS485 converter and playing around with Arduino and ML again.
I enhanced the software to play with light colours. Pressing on one of the colour buttons of the BEO4 will select the appropiate colour and UP/DOWN sets the saturation for that colour.
Does someone knows the IR code for LIGHT LAMP? My Beo4 sends 0x1B 0x1B , 0x1B 0x1 when i press LIGHT LIST LAMP 1
May be the first byte is responsible like 0x8 for LINK or something else.
By now i don't regard the first byte.
Ralf
Does someone knows the IR code for LIGHT LAMP? My Beo4 sends 0x1B 0x1B , 0x1B 0x1 when i press LIGHT LIST LAMP 1
May be the first byte is responsible like 0x8 for LINK or something else.
0x1b seems to be the prefix for all light-related commands. Here's an excerpt of what I have dumped earlier:
* 0x1b9b light (bl1000 shift+link) * 0x1b58 light timeout (when "LIGHT" exits from Beo4 display) * 0x1b5c light menu * 0x1b1e light-up * 0x1b1f light-down * 0x1b32 light-left etc * 0x1b35 light-go * 0x1b36 light-stop * 0x1b7f light-exit (-> Beo4 changes to previous device selection) * 0x1b00-09 light-0...9
You must be logged in as a BeoWorld member to post replies to forum threads.
Register to access the forums, reference material, and exclusive member benefits — including our monthly prize draw.
Become a Member