Introduction: Control Your Fireplace With HomeKit and Alexa
If your other devices have Bluetooth, you can pair them to the Mac and wirelessly share the Wi-Fi connection over Bluetooth. A Bluetooth PAN can take a bit longer to connect to—thanks to the Bluetooth pairing process—and can’t reach the speeds of Wi-Fi. However, it is also a bit lighter on your Mac’s battery life, so it’s not all bad. For instance, you can use a pre-made recipe to have Alexa call your mobile phone when you say, 'Alexa, trigger find my phone,' or with another recipe, you can automatically keep your Alexa to-do list synced with your iOS reminders.
I recently had a gas fireplace installed, that included a remote control. And after seeing a few examples of people integrating their fireplaces into their home control setup's I started looking for the same. My fireplace has this remote control https://valorfireplaces.com/features/remote-contr... which uses Radio between the remote and and the fireplace on 315 Mhz.
Step 1: Pre-RequisitesAs a prerequisite for this instructable, I have a gas fireplace with this remote control. If you look at the back of your remote, it needs to have the FCC ID RTD-G6RH and a frequency of 315 Mhz. If you don't have this remote, this instructable is not for you.
Also I have HomeBridge installed and working, and it is integrated with my Alexa.
Step 2: Bill of MaterialsFor this instructable, I leveraged my existing HomeBridge and Alexa implementation. I have had Homebridge running for a few years, and have also integrated it to my Alexa. The HomeBridge to Alexa integration used this https://www.npmjs.com/package/homebridge-alexa. These are a perquisite and I won't be detailing their setup.
To link my fireplace to this, I needed to add this to the system
Nodemcu ESP8266 - https://www.aliexpress.com/item/10pcs-lot-NodeMcu...
315 Mhz Transmitter - https://www.creatroninc.com/product/315mhz-rf-lin...
Breadboard
To find the codes for the radio remote, I used this NooElec NESDR Mini 2+ 0.5PPM TCXO RTL-SDR & ADS-B USB Receiver Set w/ Antenna, Suction Mount, Female SMA Adapter & Remote Control, RTL2832U & R820T2 Tuner. Low-Cost Software Defined Radio - https://www.amazon.com/gp/product/B00VZ1AWQA/ref=...
To find the radio remote codes for the fireplace, I followed the steps up to #7 in this instructable. And used the IR Blaster code rather than their code. https://www.instructables.com/id/Reverse-Engineer...
For the fireplace remote I found that the signal was 23 bits long, and that it was repeated 10 times per button press. After analyzing the data in Audacity I came up with these bit patterns for each remote button:
On - 01110100010111000110011
Off - 01110100010111000110111
Up - 01110100010111000111011
Use Alexa To Turn On Samsung TvDown - 01110100010111000000000
With Zero's being 200 ms of signal and 700 ms of no signal, and One's being 700 ms of signal and 200 ms of no signal. I suspect that the first portion of the data is unique information that identifies my fireplace, and the tail end is the unique command.
My workflow for determining the remote control code was:
1) Capture a button press in QGRX
2) Open the wav file created in step 1, and zoom into the relevant section until it was almost full screen width.
3) Did a screen grab of the individual button press, and saved the file.
4) Opened the screen grab in a spreadsheet, and adjusted the column width so that a column was equal to the width a bit.
5) Recorded if the bit was a zero or one in the row below.
7) Created a formal in the row below, =if(D19=0,'200,700,','700,200,'), and copied this across all the columns. Where D19 was the row above.
8) I then copied the text created by the if statements to my editor
If you convert the On code it would be
Do this for each button. The result should be 46 numbers for each button.
Step 4: Setup the Nodemcu As a Radio TransmitterFor the NodeMCU, I used Michael Higgins IR Blaster code to control the transmitter. Details on the installation are here:
To connect the Radio Transmitter, I just connected it as if it was an LED, but didn't use any of the resistors or transistor as the transmitter didn't need them.
Transmitter Pins to NodmePins
1 - Ground - Ground on the nodeMCU
2 - Data in - Connected directly to D2
3 - Vcc - Connected directly to Vin ( 5 volts )
4 - Antenna - Connected a 23cm length of wire
Step 5: Setup Homebridge With the Homebridge-HTTP-IRBlaster PluginTo setup the plugin in HomeBridge I followed the instructions here
And to configure the plugin I created the following config.json entry
This entry will not work for your device as the unique code and URL of your device will be different.
The URL would be the address of your device on your network, and you should only change the address portion. i.e. 192.168.1.175 to the values from your setup.
To find the radio remote codes for the fireplace, I followed the steps up to #7 in this instructable. And used the IR Blaster code rather than their code. https://www.instructables.com/id/Reverse-Engineer...
For the fireplace remote I found that the signal was 23 bits long, and that it was repeated 10 times per button press. After analyzing the data in Audacity I came up with these bit patterns for each remote button:
On - 01110100010111000110011
Off - 01110100010111000110111
Up - 01110100010111000111011
Use Alexa To Turn On Samsung TvDown - 01110100010111000000000
With Zero's being 200 ms of signal and 700 ms of no signal, and One's being 700 ms of signal and 200 ms of no signal. I suspect that the first portion of the data is unique information that identifies my fireplace, and the tail end is the unique command.
My workflow for determining the remote control code was:
1) Capture a button press in QGRX
2) Open the wav file created in step 1, and zoom into the relevant section until it was almost full screen width.
3) Did a screen grab of the individual button press, and saved the file.
4) Opened the screen grab in a spreadsheet, and adjusted the column width so that a column was equal to the width a bit.
5) Recorded if the bit was a zero or one in the row below.
7) Created a formal in the row below, =if(D19=0,'200,700,','700,200,'), and copied this across all the columns. Where D19 was the row above.
8) I then copied the text created by the if statements to my editor
If you convert the On code it would be
Do this for each button. The result should be 46 numbers for each button.
Step 4: Setup the Nodemcu As a Radio TransmitterFor the NodeMCU, I used Michael Higgins IR Blaster code to control the transmitter. Details on the installation are here:
To connect the Radio Transmitter, I just connected it as if it was an LED, but didn't use any of the resistors or transistor as the transmitter didn't need them.
Transmitter Pins to NodmePins
1 - Ground - Ground on the nodeMCU
2 - Data in - Connected directly to D2
3 - Vcc - Connected directly to Vin ( 5 volts )
4 - Antenna - Connected a 23cm length of wire
Step 5: Setup Homebridge With the Homebridge-HTTP-IRBlaster PluginTo setup the plugin in HomeBridge I followed the instructions here
And to configure the plugin I created the following config.json entry
This entry will not work for your device as the unique code and URL of your device will be different.
The URL would be the address of your device on your network, and you should only change the address portion. i.e. 192.168.1.175 to the values from your setup.
For off_data, on_data, up_data, and down_data change the 'data' line to be the value you determined earlier in this.
Step 6: Try It OutRestart HomeBridge, and you should now see a new accessory called Fireplace, that uses the FAN icon. You should be turn on, off and control the flame height with the Home app. Please note that when the fireplace is busy turning on or off, additional commands will be ignored and the Home app will show an error.
Step 7: CreditsFor this particular setup, I have to thank a large number of people for their efforts as my piece of this was rather simple thanks to them sharing their efforts to the community
- Michael Higgins and his ESP8266-HTTP-IR-Blaster project. This was most of the inspiration
- veggiebenz and his Instructable
https://www.instructables.com/id/Reverse-Engineer-... for providing the details around decoding radio based remote controls.
- Mark Szabo and his IRremoteESP8266 library https://github.com/markszabo/IRremoteESP8266
- The Homebridge and HAPNodeJS community for the Apple HomeKit Integration.
- The 1000th Contest
- Battery Powered Contest
- Hand Tools Only Challenge
Apple Music for Alexa is available only in Austria, Australia, Brazil, Canada, France, Germany, India, Ireland, Italy, Japan, Mexico, New Zealand, Spain, United Kingdom, and United States.
Here’s what you need- An Apple Music subscription. If you’re not a subscriber, you can join on your iPhone, iPad, or iPod touch, or on your Android device.
- An Amazon Echo, Amazon Fire TV, or Alexa-enabled Sonos speaker that you already set up with the Amazon Alexa app on your iOS or Android device.
- The iOS or Android device that you already set up with Alexa. Make sure that you update to the latest iOS and check the App Store to see if there are updates for the Amazon Alexa app. If you use an Android device, check the Google Play Store for any updates to the Apple Music app or Amazon Alexa app.
- Open the Amazon Alexa app, then tap the menu button in the upper-left corner.
- Tap Settings.
- In Alexa Preferences, tap Music.
- Tap Link New Service.
- Tap Apple Music.
- Tap Enable To Use.
- Follow the instructions to sign in with your Apple ID. You can get help to sign in using two-factor authentication.
You can also enable the Apple Music skill in the Alexa skill store on the web.
Set up Apple Music as your default music serviceIf you don’t want to say “on Apple Music” each time you ask Alexa to play something, you can make Apple Music your default music service on Alexa. Here's how.
- Open the Amazon Alexa app, then tap the menu button in the upper-left corner.
- Tap Settings.
- Tap Music.
- Under Account Settings, tap Default Services.
- Tap Apple Music.
You can ask Alexa to play songs, artists, albums, or genres from Apple Music. You can also play playlists from Apple Music's editors or playlists in your iCloud Music Library. Say something like 'Alexa, play Chill radio on Apple Music,' or 'Alexa, play Ariana Grande on Apple Music.'
If you want to listen to Apple Music in stereo or across multiple rooms, create a Multi-Room Music group in the Alexa app. After you set this up, you can listen to Apple Music on two or more Echo devices at the same time.
Unlink Apple Music and Alexa- Open the Amazon Alexa app, then tap the menu button in the upper-left corner.
- Tap Settings.
- In Alexa Preferences, tap Music.
- Tap Apple Music.
- Tap Disable Skill.
If you need help setting up or using Alexa, your Amazon Echo device, or your Fire TV device, get help from Amazon.
If you need help setting up or using your Sonos speaker, get help from Sonos.
Use Alexa To Turn On Mac Desktop Learn more- You can use Siri to play Apple Music on your Apple devices. With Siri, you can choose from a wider variety of commands.
- Learn more about how to use Apple Music in the Music app.
- You can also play Apple Podcasts with Alexa.