Bed Occupancy and IR transmitter for Home Assistant

Поділитися
Вставка
  • Опубліковано 23 чер 2024
  • This project consists of two device builds... an IR transmitter and a bed occupancy sensor using ESPHome that I used for local AC integration and automation in Home Assistant. But either device has a multitude of potential other uses for your own projects.
    You can find full wiring diagrams, step-by-step details and more in my related blog article: resinchemtech.blogspot.com/20...
    Chapter Links:
    =============
    00:00 Introduction and Goals
    01:35 Building the IR Transmitter
    09:46 Building the Bed Occupancy Sensor
    23:01 Home Assistant Integration and Automations
    25:54 Conclusions and Wrap-up
    Parts List:
    ==========
    These are the parts that I used for my build. Some are optional and some can be substitued. I've broken the parts out by the two diffent builds, with a section that is common to both.
    Bed Sensor:
    ----------
    Force Sensitive Resistor Strip: amzn.to/42e6EWm
    Wemos D1 Mini: amzn.to/3qd50r0
    Resistor Kit: amzn.to/43cxhwr
    ElecroCookie 1/2 Size Protoboard: amzn.to/3MCBRNi
    USB Slim wall charger: amzn.to/3WFeszf
    MicroUSB cable: amzn.to/3oDui0X
    Spade Connectors: amzn.to/3N0VaBh
    Normally open push buttons (optional): amzn.to/43tA43P
    Logic Level Shifter (optional): amzn.to/3N0KL8E
    IR Transmitter/Receiver:
    -----------------------
    Mini ESP32: amzn.to/3oubRMf
    (only one of these transmitters are needed, but I'm including all three that I showed):
    IR Transmitter (KY005): amzn.to/3N00TY9
    IR Transmitter/Receiver Pair: amzn.to/42dpHQT
    IR Transmitter/Receiver with ESP8265: amzn.to/3BYsToz
    Logic Level Shifter (optional): amzn.to/3N0KL8E
    ElecroCookie 1/2 Size Protoboard: amzn.to/3MCBRNi
    USB Slim Wall Charger: amzn.to/3WFeszf
    Micro USB cable: amzn.to/3oDui0X
    Dupont Connector & Crimper Set: amzn.to/3BZJYi3
    Common Parts (Used in both projects):
    ------------------------------------
    1/4" Braided Sleeve: amzn.to/43w2iuV
    Heat Shrink Tubing: amzn.to/42c002X
    Breadboard: amzn.to/3MCFjr9
    Breadboard jumpers: amzn.to/3MD7dn1
    Alligator Test Leads: amzn.to/43hLlVy
    Project Boxes: amzn.to/3WHh14a
    Misc. wire 20-24 Gauge
    Some of these links may be Amazon affiliate links. Use of these links will not affect your pricing, but this channel may earn a small commission if you make a purchase.
    Additional Links and More Information:
    =====================================
    Written version of this project: resinchemtech.blogspot.com/20...
    ESPHome IR Remote Climate Documentation: esphome.io/components/climate...
    Gist file with all ESPHome, Helper entities and HA automation YAML: gist.github.com/Resinchem/831...
    Original Bed Sensor post by tom_l: community.home-assistant.io/t...
    If you'd like to help support the channel or just say thanks if I've helped you out, you can buy me a cup of coffee or two at:
    www.buymeacoffee.com/resinche...
    #homeassistant #esphome #automation
  • Наука та технологія

КОМЕНТАРІ • 38

  • @rodneysmith1750
    @rodneysmith1750 Рік тому +1

    Great and timely video, thanks for sharing.
    I plan to use the IR controls for my mini split A/C as well as my ceiling fans coupled with a temp/humidity sensor.

    • @ResinChemTech
      @ResinChemTech  Рік тому +2

      Thanks! Now that I've gotten this to work for the AC unit, it's started me thinking about how I could do something similar to control/automate other IR devices in my home that are normally "dumb" devices. I think it should work with something like a ceiling fan as well, assuming you can capture the needed IR codes from the existing remote.

  • @Tntdruid
    @Tntdruid Рік тому +1

    Very nice guide, thanks 👍

    • @ResinChemTech
      @ResinChemTech  Рік тому +2

      You are very welcome! Thanks for watching and taking the time to leave a comment.

  • @prezbenny7842
    @prezbenny7842 2 місяці тому

    Very useful project, nice. Thanks

    • @ResinChemTech
      @ResinChemTech  2 місяці тому

      You are welcome. While the final project is a bit specific for my use case, hopefully the idea of a bed sensor or a custom IR transmitter can be adapted for a lot of other uses and projects.
      Thanks for watching and taking a moment to leave a comment.

  • @RealMangaAddict
    @RealMangaAddict Рік тому +3

    I'm new to Home Assistant and your videos have been extremely helpful. I live in the Caribbean and we use Air Conditioning rather than Thermostats, so I was looking for a solution to managing my Ac through HA, this video could not have come at a better time. Thank you, I've learnt soo much from you!

    • @ResinChemTech
      @ResinChemTech  Рік тому +2

      You are most welcome... and I'm happy you find my videos helpful. While it might take a little extra work if your model of AC isn't one of the officially supported ones by ESPHome, as long as it has an IR remote it should be possible to capture those codes from a receiver and reuse them. The IR transmitter is really the only part needed to do a lot of Home Assistant automation. The bed sensor was just an additional piece for me... because I've wanted one for a while now to use in other automations.
      Thanks for watching... and taking time to leave a comment!

    • @RealMangaAddict
      @RealMangaAddict Рік тому

      @@ResinChemTech Thank you, now that I know it's possible, I'm sure I'll find a way to make it work

    • @rodneysmith1750
      @rodneysmith1750 Рік тому +1

      I am in a similar situation, I am an expat living in Mexico. We use mini split types of A/C and fortunately for me my new Trane units do support IR so I am looking forward to automating them with Home Assistant as well. This is a very timely video for me.

    • @RealMangaAddict
      @RealMangaAddict Рік тому +1

      @@rodneysmith1750 Hope everything works out for you!

  • @davidprocaccini3153
    @davidprocaccini3153 Рік тому

    Cool video. Very informative. Thank you for sharing all your various projects.

    • @ResinChemTech
      @ResinChemTech  Рік тому +1

      Thanks! Hopefully my videos can help you with your own projects in some way.
      And thanks for taking time to leave a kind comment!

  • @LukeAurio
    @LukeAurio 10 місяців тому

    I just wanted to leave a comment saying thanks! You inspired me to upgrade my place with an ESP8265 with IR Receiver and Transmitter combo similar to (but a titch cheaper haha) than the one you linked to.
    My Frigidaire units aren't (yet) supported for the climate integration but I managed to clone my Remote signals from the IR Reciever too! You've provided a lot of much needed inspiration to make my apartment a whole lot "cooler".
    This was my first time making a model from scratch, which made me feel super proud. Files will be on thingiverse after I clean up the files and and some personal touches.
    You've been a great resource while I've been dipping my toes into homeassistant and helped inspire me to take the dive and upgrade to a proxmox isntance that made my (fairly rudimentary) home lab a heck of a lot easier to manage.
    Thanks for making content that newbies and experts can take a page from! Keep on doing what you're doing.

    • @ResinChemTech
      @ResinChemTech  10 місяців тому +1

      Wow... thank you so much for the kind words. I'm glad you find my videos helpful and that they inspire you to give DIY a shot. For me, there is a lot of satisfaction in making something work and figuring out how to do it (even though I often make some mistakes along the way).
      I think you will be very happy with Home Assistant on Proxmox. It was one of the best moves I've made for my smart home... even if no one else sees it.
      Thanks again for the comments. It's comments like yours that inspire me to continue to make videos! Keep me advised of your progress on other projects.

  • @jensf.7882
    @jensf.7882 Рік тому +1

    super project … good work !!!

    • @ResinChemTech
      @ResinChemTech  Рік тому +3

      Thanks... I appreciate it! While I'm using this for an air conditioner, I hope others can see how both parts of this project have a lot of other potential uses for automating other devices as well.
      Thanks for watching!

  • @jgbreezer
    @jgbreezer 3 місяці тому

    If more nervous about applying too much heat to the FSR pins, you could consider conductive glue instead! (or a crimped connector). You don't have to solder so much (nasty fumes and burn risks and extra equipment to keep around when you aren't using it too).

    • @ResinChemTech
      @ResinChemTech  3 місяці тому +1

      Good tip! I'm pretty comfortable with my soldering skills, but this is a great suggestion for others that might not have the equipment or experience with soldering. Thanks for sharing it.

  • @collindewitt1989
    @collindewitt1989 Рік тому +1

    Absolutely brilliant. Great project and video. Thanks for sharing

    • @ResinChemTech
      @ResinChemTech  Рік тому +1

      Thanks... and you are welcome. Hopefully it gave you some ideas for your own projects.
      Thanks for watching!

    • @collindewitt1989
      @collindewitt1989 Рік тому

      @@ResinChemTech I have been wanting to build a bed sensor using load cells but was not keen on the wires running under the bed all over the floor. Your idea is much neater. I will use the load cells now for my water cooler to notify when to replace the bottle. Sadly electricity is becoming scarce in south Africa so a smart home is not as effecient as it used to be

    • @ResinChemTech
      @ResinChemTech  Рік тому

      I was exactly the same. I wanted a bed sensor and even bought load cells. But it was so much wiring under the bed, and my particular bed wasn't conducive to the design, so I gave up on the idea a long time ago. It was just recently when I ran across that forum post and discovered the method of using the force sensitive resistor that renewed my hope. This method is nice as there are no wires under the bed and everything goes under the mattress/box springs, so it also doesn't interfere with making the bed, changing the sheets, etc.

  • @WndSks
    @WndSks Рік тому

    This bed sensor is so cool, wish I had a use for it.

    • @ResinChemTech
      @ResinChemTech  Рік тому +3

      Well, while I'm using it for my AC unit, there are a lot of possibilities if you have an automation system like Home Assistant. For example, I have a nightly routine that runs that turns off any lights that are on, check and locks any doors that are unlocked, assures the overhead garage door is down, etc. Right now, that's based on time... but I could easily update that to use the bed sensor so that the 'goodnight routine' runs whenever I get into the bed at night. Or you could flip that around and have it run a series of actions when you get out of bed in the morning. Or have it light up some low level under bed LEDs if you get out of bed in the middle of the night so you don't stub a toe on something! There are a lot of potential uses, but it does require an automation system like Home Assistant, NodeRed, etc.
      But I do appreciate you watching and taking time to leave a comment.

    • @yarbsfpv
      @yarbsfpv 2 місяці тому

      well, if the sensor's resistance fluctuates often, and HA is aware that you're not home, you've got yourself an infidelity alarm!

  • @martinzipfel7843
    @martinzipfel7843 Рік тому +1

    Lucky you that ESPhome climate supports your Aircon. I have an old Mitsubishi unit and am trying for ages to get it to work. But ESP Climate doesn't support the model and I can't figure out how to teach it the right codes from the remote. Any chance you could make an instruction on that? :)

    • @ResinChemTech
      @ResinChemTech  Рік тому

      I was fortunate that I didn't have to capture and learn the codes for my Midea. However, I have captured codes from other remotes and used those capture codes to transmit to a different device. The best advice I can give is to connect an IR receiver to an ESP running ESPHome and use the ESPHome log to display the code each time it receives one. Get the various codes from the different remote buttons. Then use those same codes that you captured to send out via the IR transmitter platform in ESPHome. Without an actual remote to test, it's hard for me to provide any additional assistance, but my YAML does include an option for capturing and logging codes received (even though I'm not actually using a receiver in my case).
      You might also check out the ESPHome Discord server as well (if you haven't already). You may run into someone there that has either figured out your model of AC... or can give you better tips/advice than I can!
      Good luck. I wish I could provide exact details.. but that's about the best I can offer.

    • @martinzipfel7843
      @martinzipfel7843 Рік тому

      @@ResinChemTech Awesome, thank you for the quick reply. I'll have a look at your code. I have a receiver attached and can see the codes coming from the Aircon remote. I just didn't know how to integrate them into ESPhome to make it work, hopefully your yaml code will help.

  • @geejayem59
    @geejayem59 Рік тому

    Very good. You could also define the threshold setting as a template number in the esphome code rather than using a helper from home assistant so that it would all be self contained.

    • @ResinChemTech
      @ResinChemTech  Рік тому

      Thanks for the idea. Of course there are always multiple ways to tackle any project. Your method does put all of the related entities into the ESPHome node, which depending on your personal installation and organizational method may or may not be the desired choice. For me, I use packages, so I have everything related to the AC automation in one YAML package. This includes my automations, switches, input_booleans, etc. So, I could either put the input_number in my package or the ESPHome file (via a template number). Either method results in the same outcome... a slider in the front end to be able to adjust the trigger level.
      But I appreciate the alternate approach. For some, it may be a better organizational option than importing an input_number from Home Assistant. For others that are not as comfortable with using YAML, creating the helper using the UI and doing the simple import into ESPHome might be more easily understood than creating a template number via YAML in ESPHome.
      But again, thanks for the alternate approach idea. I always appreciate viewers' feedback and other ways to tackle a project.

  • @DennisSchmitz
    @DennisSchmitz 2 місяці тому

    I'd rather use the Midea_AC or Midea Smart AC integrations. Run flawlessly and local as well and support even more settings like ECO mode.

  • @Xillwill24
    @Xillwill24 9 місяців тому

    😊

  • @user-so5uo1xx5t
    @user-so5uo1xx5t Рік тому +1

    Thank you very much. I have a GREE air conditioner. How can modify the code for GREE air conditioner which supports heatpumpir ?
    Can you help me write the modified code for my GREE air conditioner?

    • @ResinChemTech
      @ResinChemTech  Рік тому +2

      ESPHome natively supports and has the code for the GREE Heatpump. In fact, there's a special section in the documentation that describes the GREE libary. You should find all you need, including the necessary code, here: esphome.io/components/climate/climate_ir.html Look under the section that talks about Arduino-HeatpumpIR.

  • @kylegurney8610
    @kylegurney8610 5 місяців тому

    I was reading that forum on home assistant and there were alot of issues with false positives with these during configuration. How accurate has this been for you?

    • @ResinChemTech
      @ResinChemTech  5 місяців тому

      I'm assuming you are talking about the force sensitive resistor (and not the IR transmitter). Mine has been in use for about 7 months now and the only real issue I've had is some slight drift in the upper voltage (unoccupied) range, but that is mostly due to my Sleep Number bed that loses pressure over time. When the "Sleep Number" is reset, the voltage also falls back into line. But it is important to select the proper resistor to give you the broadest voltage range between occupied and unoccupied. The narrower this range, the more likely you are to get false positives (or negatives) based on small changes in pressure. In my case, I generally get around 3V when unoccupied and 1V when occupied. Naturally doing things like lifting up the mattress to change sheets can cause false readings, but I do try to account for those in my automations. I also have any 'occupancy' automations limited to certain times of the day. With all this taken together, I've not had any false occupancy/non-occupancy issues regarding the triggering of the window AC unit.
      Since the voltage can bounce a bit, especially as you move around in bed, if you are wanting to use this for some sort of "instant" action (such as turning on under bed lighting), it may not be the ideal system as simply rolling over in the middle of the night could result in a trigger. In my case, I look for a state change that lasts for at least 5 minutes before an automation fires, so this will account for things like shifting while in bed. But at least for the first 7 months, it has worked out just fine for controlling the AC unit. This could change in a year, two years, etc... but for now, it has been working as expected.

  • @user-vx9pq7no6i
    @user-vx9pq7no6i 7 місяців тому

    Can you help me please
    Am trying to control my tcl inverterpro air conditioiner with arduino uno.
    First i got the raw data from tv and tv box and the array size was 70
    Then i got the raw data from my air conditioner and it was over 500.
    It worked on tv and the tv box but it didnt work with the air conditioner😢
    Can you tell me where the problem is?
    Sorry for my bad english.