Posts

Showing posts from 2019

how to IR remote control via wemos d1 (esp8266) & mqtt & sonoff tasmota

Image
I used wemos d1 and connected like this: (source: https://github.com/witnessmenow/ESP8266-IR-Remote-Example) Receiver module is tsop38238 Transistor :  2N3904 (without it , LED is not bright enough to send IR signal) Led diode is Infrared diode. I used this library with arduiono :  https://github.com/markszabo/IRremoteESP8266 From examples  with this one:  IRrecvDumpV2.ino you can capture IR codes from the remote by pressing the remote button and it will be captured  and it generates codes like this:

Bose speaker hack (companion 5) to turn on/off automatically

Image
I have on of these Bose companion 5 speakers. The problem with it is when you don't use it actively it turns off to save energy, next time when you want to use it you should press the button on the control pod to activate it. This is a problem when you use the aux cable as input as a standalone speaker. Solution was not the easiest but it's a quick hack.  I designed a system where when an audio detected from the aux input , it Bose speakers turn on automatically to green. Here is how it goes: Tested the pins of the control pod, looks like there are different voltages supplied to the control pod. It all ends up here because I couldn't find how the audio transmitted to the main device.I had to find a way to open this: There were 2 screws at the back. It turns out it uses the same screws apple uses T5 When I opened it the top came off You need to unscrew these as well, and you have to cut the wheel, (you can glue it ba

how to connect xiomi temperature and humidity sensor to openhab without a gateway

I've a xiomi temperature and humidity sensor with bluetooth. I'm Using openhab and MQTT so it's easy to connect: 1) Create this script (xiomi.sh) : Replace BT with your sensor's mac address. You can find it with:   sudo hcitool lescan (look for  MJ_HT_V1) Change the IP address (192.168.1.100) to your MQQT server address. #!/bin/bash for pid in $( pidof -x xiomi.sh ); do     if [ $pid != $$ ]; then         echo "[$(date)] : xiomi.sh : Process is already running with PID $pid"         exit 1     fi done bt = "4C:65:A8:DC:AD:CF" sensor = "sensor" RET = 1 until [ ${RET} -eq 0 ]; do     data =$( /usr/bin/timeout 20 /usr/bin/gatttool -b $bt --char-write-req --handle = 0x10 -n 0100 --listen | grep "Notification handle" -m 2 )     RET = $?     sleep 5 done RET = 1 until [ ${RET} -eq 0 ]; do     battery =$( /usr/bin/gatttool -b $bt --char- rea