-
Wiring diagram? Ok :)
01/02/2022 at 04:50 • 0 commentsSome people commented asking if I could share a final schematic or wiring diagram so here is a rather simple wiring diagram of my final board.
Hope it will help some of you.
-
All done!
06/05/2021 at 06:05 • 0 commentsThat cheap plastic box I ordered on Amazon took quite some time to be delivered... until I realized it was shipped from China.
The size is just perfect. I cut a few holes, one for plugging in an USB C cable (to allow direct reprogramming without having to take everything out of the box), one to pass the cable from the air conditioner and I added a small light pipe so the microcontroller LEDs could be seen. All was fixed using my best friend number 2, hot glue.
The final result looks like this (case hold with blu tack):
I may redo the cable that connects to the air conditioner motherboard but for the time being, I'm happy with how it looks.
-
That looks far better
05/29/2021 at 00:37 • 0 commentsDo you remember how my circuit looked like? Basically it was just components put in a breadboard, connections made with jumper wires and a tiny powerbank to supply power.
Now it looks like this:
I switched from an Arduino Pro Micro to a Seeeduino XIAO, just because I have some on hands and wanted to make the final board as tiny as I could (it's just 40 x 60mm). The 7805 package size is definitely an overkill for this circuit but that's the only through hole 5V regulator I had laying around.
I also ordered a tiny plastic case on Amazon that should be delivered next week. I will end this project with a log of the complete product.
-
And that's how it's done
05/25/2021 at 12:51 • 3 commentsI did it... I achieved my goal... I can now contol my air conditioner from Home Assistant!
I'm so happy and proud of myself!All went so fast in just a week I still can't believe it. Here is a brief summary of what I did and how:
1. Using this GUI tool, I created a firmware with the following settings:
- Board type = CC2530
- Device type = End device without routing
- Status LED = P22, Sending reports
- Output 1 = P03, UART, Baud rate = 9600, Packet end = 0x0D
- Model ID = RAS-LJ22Y_ADPT (setting of an unique name)
- Set default reporting interval(s) = 60
- Update firmware's timestamp
2. Before closing the GUI tool, I used "Save custom converter for Z2M" to create the corresponding external converter for Zigbee2MQTT (see file A-C_Hitachi_converter.js).
3. I flashed my Zigbee module, powered it up and then moved to Zigbee2MQTT dashboard in HA in order to add it. It appeared as an unsupported device with the name "RAS-LJ22Y_ADPT" so I followed the indication on this page and added it without any problem.
4. Then I moved the external converter I previously created to /config/zigbee2mqtt/.
5. Back to Zigbee2MQTT dashboard, I went to Settings > External converters, entered the name of the converter, clicked "Submit" and restarted Zigbee2MQTT. The result is as follow.
6. I added a climate platform to my configuration.yaml following this documentation (see file climate_platform.yaml for more details.) and restarted HA.
7. In the meantime, I wrote a simple program that retrieves the air conditioner status every 2 seconds, compares it to a previous known status and if different, sends it to HA in a JSON format. Also, this program send setting commands to the air conditioner according to what have been received from HA (see file my_puny_program.ino for details).
8. Finally I added a "Thermostat card" in Lovelace and set the "Entity" to the climate entity I created.
I played a lot with this "Thermostat card", also played a lot with the infrared remote control and so far everything works perfectly, everything is in perfect sync. Only problem is how the material solution looks like for the moment...
-
It's... it's working... for real!
05/16/2021 at 08:28 • 0 commentsI spent my Golden Week holidays looking in depth in this GUI tool and after a week of trial and error I managed to send but also receive data from Home Assistant.
How do you ask?
- first, in Home Assistant I switched from deCONZ to Zigbee2MQTT plus Mosquitto broker.
- using the GUI tool, I created a custom firware with OUTPUT1 set to P0.2 and to UART with a baudrate of 9600 and 0x0D as an end packet.
- I then flashed my ZIgbee module with that custom firware.
- in Home Assistant, from Zigbee2MQTT dashboard I allowed devices detection by clicking "Permit join (all)".
- I then connected my Zigbee module to my FTDI USB to TTL Serial Adapter, powered it up and opened Termite on my computer.
- After about 20 seconds, a new device appeared in Zigbee2MQTT dashboard. I renamed it "Proto" and added it to Home Assistant.
- Then, I went to Configuration > Integrations > Mosquitto broker > Configure and in "Publish a packet" I wrote the payload "test" to the topic zigbee2mqtt/Proto/set/action.
- Like magic, the text "test" appeared in my Termite window.
- I returned to Home Assistant and this time, in "Listen to a topic" I entered zigbee2mqtt/Proto/action and clicked "START LISTENING".
- Back to my Termite window I typed "test again" and... again like magic, the same text appeared in Home Assistant.
Following this small success, I read here and there about how air conditioners are normaly controled via Home Assistant and it's all about a "climate entity" and the "thermostat" card in Lovelace.
Hopefully, there is a way to create such a climate entity when using MQTT: MQTT HVAC
Perfect! This week I'm gonna look for more examples on how to create such an entity and try to make on.Now that I managed to transmit data to Home Assistant, the overall connection diagram should look something like that:
-
Could that be the solution?!
05/03/2021 at 02:38 • 0 commentsToday I had a closer look to these sites that introduce DIY Zigbee devices and noticed something right away: the author uses the same Zigbee module as I am (E18-MS1-PCB from Ebyte).
In the past I've tried to look for projects or information with this CC2530 based module but didn't find much but I thought it could worth another try since someone is actively building Zigbee devices with it.As usual I used my best friend Google. With the keyword "E18-MS1-PCB" I went right away to "Images" and just after a few scroll down this caught my attention:
I mean... the image title speaks for itself, right? With really high hope I clicked that image and jumped to Z1 Mini Development Board lets you build custom ZigBee end devices. After reading the article, there was unfortunately nothing new on the horizon. To be sure, I had a look to the linked Wiki page and there I saw this:
Great firwares? For the CC2530 chip... For a second I thought these firmwares could be the ones of those DIY Zigbee devices I mentionned earlier. Or maybe ready to flash firmwares to use a CC2530 as a ZNP device?
Well it turned out to be far BETTER than that: A GUI tool for creating your own alternative Zigbee device with a flexible configuration of inputs and outputs.
This sounds so promising and it might be the solution I was looking for to easily make a Zigbee device to enable connectivity of my air conditioner with Home Automation. Gonna spend this Golden Week holidays digging into that.
-
Long time no see ... (/ω\)
05/01/2021 at 02:22 • 0 commentsA bit more than a year since my last project log entry... shame on me. COVID-19 pandemic got me stuck in an unpleasant and depressfull work - eat - sleep repeat cycle. My procrastination reached it's highest of all time level and even completing or starting a new DIY project didn't seem to motivate me enough.
But I decided to put things in order and deal with my procrastination: completing this project while taking care of myself (personal training gym? skin care? improve my wardrobe?). Once this project is done, I will move to automate the other air conditioner I have and finally the small heater I bought last winter for my bathroom. From then I'm thinking to hack and improve the video intercom (bigger screen, adding a recording function, adding an auto-response function in case nobody is home, ultimately link it to HA?) but that's a story for another time.
Okey now let's talk about what's new since ... well since last year: last time I successfully flashed a cheap CC2530 based module with Z-Stack 3.0.2 but not knowing a thing about Zigbee I didn't know what to do next. So I went on a frenetic search of information, hoping I would be able to gather enough material from articles/forum messages/videos or whatever to understand how to properly communicate with a Zigbee router and implement that in a structure I could program.
Unfortunately the result was frugal:
- TI application report: Developing a ZigBee System Using a CC2530-ZNP
- Arduino program: water heater control using Xbee module
- NXP document: ZigBee Home Automation User Guide
- Github page of DIY Zigbee devices: DIY zigbee devices
- The same from the original author (Russian?): https://modkam.ru/
With that arduino program along with TI and NXP documents, I thought I could understand what should be done, in which order and manner but it turned to be far more difficult that I imagined and I gave up (at least for me it was too time consuming and fruitless).
So I turned my attention to public available litterature and bought the following book:
which turned out to be a waste of time and money as it isn't a practical development handbook as stated in the front cover but rather a book that explains in depth Zigbee standard, its functionality and its radio signal implementation.
-
Successful flashing of Z-Stack 3.0.2
08/02/2020 at 06:34 • 0 commentsI received my CC debugger (a cheap knockoff bought on AliExpress) and tried right away to flash my CC2530 module: success!
Just for reference, I used this documentation on how to flash using TI SmartRFR software and for the firmware itself, I built one based on Z-Stack 3.0.2 following this tutorial I mentionned before (you can download the hex file from the Files section: CC2530ZNP-with-SBL (Z-Stack 3.0.2).hex).
To check if my flashing was successful or not, I used TI Z-Tool software (don't forget to check "Scan all Enabled com ports (startup and manual scan)" in Tools > Settings > Serial Devices > Auto Scan).
Also, while I was waiting for my CC Debugger to be delivered, I looked around on the Internet for possible reasons why my previous attempts at flashing the CC2530 module failed. I didn't find anything relevant so I decided to check carefully my components and found out the solder joint of D5 on my Wemos D1 mini was cracked... A quick rework and I successfully flashed my firmware using CC loader library (for those interested, I also uploaded the bin file in the Files section).
-
Zigbee, my future nemesis?
07/19/2020 at 06:09 • 0 commentsNow that I have demystified the communication protocol of this Hitachi air conditioner, it's time to work on what is gonna be the most difficult and time consuming part of this project for me: building a Zigbee interface to enable remote control from Home Assistant.
For the past month I've been gathering information, learning basics about Zigbee, looking for hardware solutions and trying to have a Zigbee module working. Here is a kind of summary of what I've got so far.
1) I learnt there is 3 different types of devices in a Zigbee network: router, coordinator and end device. Because I want to go for a simple solution I will make an "end device".
2) Searching for DIY Zigbee on Google got me to look at XBee module and CC2530 based module.
3) Because I judged XBee modules to be quite big, I digged in this SoC made my Texas Instrument and found that CC2530 based modules can either be directly programmed (Intel 8051) and used stand-alone or flashed with a specific firmware to be used as a so-called "ZigBee Network Processor (ZNP)" with an external MCU (like controlling an ESP8266 with an Arduino via AT commands). My 8051 programming skills being really rusty and not being interested in learning the SDK and the tooling from TI, I decided to go for the ZNP solution.
4) I searched for a CC2530 based module on AliExpress and found a cheap and tiny transmitter/receiver module. Link to the actual product: https://www.aliexpress.com/item/32803052003.html?spm=a2g0s.9042311.0.0.40bc4c4dzhaeel
5) I received the modules in about 2 weeks. I made a simple breakout board for one and tried to flash Z-Stack 3.0.2 following this excellent tutorial. Because I don't have a CC debugger, I used an alternative flashing method using an Wemos D1 and CClib (source: Zigbee CCLib Flashing). After a bit more than 2 hours, the flashing was successful but the module UART didn't seem to work. I checked that P2_0 (CFG1) was tied to GND and I carefully followed the CC2530-ZNP power-up procedure described in Z-Stack ZNP Interface Specification but I never got the SYS_RESET_IND from the module.
6) I tried to reflash the module using another programming method which used CCLoader (tutorial: flashing CCLoader) but despite a successful flashing it didn't work either.
7) After trying to flash multiple firmwares (router, coordinator, stock) I found on forums and GitHub using both programming methods I also tried to flash the other module I bought but never managed to have the UART working.
8) I bought a CC debugger from China hoping it's just a problem with the flashing method... Until I receive it, I will search for more information about end device firmware, Zigbee communication work-flow and Home Assistant integration.
-
Well... that was fairly easy
06/14/2020 at 03:10 • 1 commentYesterday I hooked up the "central station" and recorded a bunch of data. I tried as many settings as I could and worked on identifying how commands are sent to the air conditioner and how status are retrivied from the air conditioner.
And after just 2 hours of opening PulseView files, extracting data and compiling everything in Excel here is the result.
- status inquiry
- RAC adapter message: MT P="address" C="checksum"[CR]
- air conditioner response: OK P="value" C="checksum"[CR]
- value setting
- RAC adapter message: ST P="address","value" C="checksum"[CR]
- air conditioner response: OK[CR]
And that's all it is! The checksum calculation is quite straight forward so I won't explain it.
For a list of available addresses and possible values, you can check the file "Analysis result (2020_06_14).xlsx".As a confirmation, I connected my FTDI USB to TTL serial adapter directly to the air conditioner, grounded the H-LINK pin and sent a few commands to the air conditioner: everything worked fine.
So the next step will be to learn about Zigbee communication system and see how I can implement a wireless remote functionnality in Home Assistant.