Giter VIP home page Giter VIP logo

samsung-hvac-buscontrol's Introduction

Samsung-HVAC-buscontrol

Purpose

Samsung airconditioners can be controlled by a wired remote controller (MWR-WE10). I was wondering if I could replace the wired remote controller with my own home automation system. Thats why I started to investigate how the communication works between the controller and the airconditioner. So far I reverse engineered the communication protocol and with the information I found I can already do some basic control of the airconditioning. The purpose of this repository is to complete the protocol details as much as possible to allow anybody else connect Samsung airconditioners to their own home automation systems.

Note that this does not describe the communication protocol of a wireless IR controller !!

Physical layer

The physical layer is a 2 wire RS-485 communications bus. Each unit has 2 such busses. The wires are labelled F1, F2, F3 and F4. F1 and F2 are used for communications with the outdoor unit, the F3 and F4 wires are used for the wired remote control.

Protocol

Serial communication settings used on the bus are 2400 baud, 8E1. The wired remote control is the master, the indoor units are the slaves. The wired remote control send commands as a message of 14 bytes. The units respond with a similar message with the same length. The protocol can be described as follows:

<start> <src> <dst> <cmd> <data: 8 bytes> <chksum> <end>

With:
Byte   Identifier   Comments
----------------------------
1      Start  : start of message (0x32)
2      Src    : Source address
3      Dst    : Destination address
4      Cmd    : Command byte
5-12   Data   : Data is always 8 bytes in length, unused bytes will be zero
13     Chksum : Checksum of message which is the XOR of bytes 2-12
14     End    : end of message (0x34)

In my case the address of the wired remote control is 0x84, the address of my 2 indoor units are 0x20 and 0x21. The master sends a command to a slave, the slave responds to the master. An example communication can look like this (all values are hex and xx represent any value):

Command:
32 84 20 53 xx xx xx xx xx xx xx xx xx 34
Reply:
32 20 84 53 xx xx xx xx xx xx xx xx xx 34

That was the easy part of the communication sniffing. The difficult part is to find out the meaning of all commands and the meaning of al bytes for each command/response.

Command tables

All values of the commands and bit group values in the following tables are in hexadecimal notation. The bits that are not described in the following tables are zero and the function of those bits are unknown.

Command A0

Change settings command, by exception the unit replies with command 50, all other commands are replied with the same command identifier. This is the command to be used when the settings of the HVAC unit needs to be changed.

Data byte Settings
1

bit 4-0 : 0x1a = blade swing up/down
0x1f = blade swing off

bit 5 : sleep
2 0
3 bit 4-0 : temperature setting

bit 7-5 : fan speed
0 = auto
2 = low
4 = medium
5 = high

4

bit 2-0 : mode
0 = auto
1 = cool
2 = dry
3 = fan
4 = heat

bit 5 : reset "clean filter" message
5

bit 7-0 : on/off
c4 = switch off
f4 = switch on

6 0
7

bit 3-0 : set blade position
0 = closed
1 = open smallest
2 = mid positions
7 = open max

bit 4 : set blade position
bit 5 : quiet mode
8 0

Command 52

This command is an information request. The bytes in the command are all zeroes, the reply to this command is described below:

Data byte Settings
1 bit 6-0 : set temperature + 55
2 bit 6-0 : room temperature + 55
3 bit 6-0 : output air temperature + 55
4

bit 2-0 : fan speed
0 = auto
2 = low
4 = medium
5 = high

bit 7-3 : blade swing
1A = swing up/down
1F = blade swing off

5

bit 3-0 : 1 = wired control
2 = remote control

bit 4 : 1 = defrost on

bit 7 : 0 = power is off
1 = power in on

6 bit 4 : 1 = filter needs cleaning
7 0
8 bit 6-0 : another temperature + 55

Command 53

This command is an information request. The bytes in the command are all zeroes, the reply to this command is described below:

Data byte Settings
1 0
2 0
3 0
4 0
5

bit 7-0 : 0 = blade swing off
1A = blade swing up/down

6 0
7 0
8

bit 2-0 : mode
0 = auto
1 = cool
2 = dry
3 = fan
4 = heat

Command 54

This command is an information request. The bytes in the command are all zeroes, the reply to this command is described below:

Data byte Settings
1 contains value 21, meaning unknown
2

bit 3-0 : blade position when swing is off
0 = closed
1 = open smallest
2 = mid positions
7 = open max

bit 4 : 0 = blade swing off
1 = blade swing up/down

3 1E : meaning unknown
4 0
5 0
6 unknown
7 0
8 0

Command 64

This command is the temperature information command to the unit, the reply to this command is described below:

Data byte Settings
1 contains value 20 for command and reply, meaning unknown
2

command and reply: bit 0: used temperature for regulation
0 = use internal temperature
1= use wired remote temperature

3 command: wired remote temperature value high byte
reply: used temperature value high byte
4 command: wired remote temperature value low byte
reply: used temperature value low byte
5 reply: unit temperature value high byte
6 reply: unit temperature value low byte
7 0
8 0

The temperature in degrees is calculated as follows:

(<high byte> * 256 + <low byte> - 553) / 10

Other commands

Other commands seen on the link are: 63, 70, 71, 83, D1. The meaning of these commands and replies are unknown. Be careful with trying other commands because it is possible that there exist commands that have impact on the flash memory contents of the unit and may brick the memory contents of the unit.

Tools

To snif the communication protocol I used a Raspberry Pi and a RS485 -> TTL convertor which you can easily find on e-bay (search for: TTL RS485 Adapter 485 UART Seriell 3.3V 5 Volt Level Konverter Modul Arduino). Although I had the impression that the RS-485 driver was not working well on 3.3V, I replaced it with following driver : SN65HVD11D from Texas Instruments. I connected the 2 RS-485 wires from the indoor unit to the convertor, the convertor is connected to the Pi's rx and tx pins of the IO header. Be aware the the TTL levels must be 3.3V compatible, if they are 5V, the Pi's IO's will be damaged.

I made some Python scripts to display all the information coming from the serial comms in a meaningful manner. Pyserial is a required package.

Call the scripts with the -h option to obtain info on how to use it. serial_dump.py dumps all serial communication on screen, there is no transmission of commands. lib_serial.py is used by ac_control.py

In my setup, I use the wired remote control in combination with the Raspberry Pi which acts also as a master. This makes the communication a bit tricky. The wired remote control sends commands to all units in sequence and ends the communication with a command to destination address 0xAD, no reply is coming from any of the units on this one. I suspect the 0xAD address to be a broadcast address. Then there is a 300 ms gap in the communication and then it all starts over with other commands. During this gap the tools make use of the bus to send their own commands. The wired remote will not notice the presence of the other master but it will take over the changed settings of the untis when it polls their status.

samsung-hvac-buscontrol's People

Contributors

dannydegaspari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samsung-hvac-buscontrol's Issues

How to determine the indoor units address?

In your code you use 0x20 and 0x21 for the indoor units address.

0x84 appears to be the wired remote's address too

Will this be the same for mine?

How could I perform a search on the bus for my unit? - I only have one.

Anyone tried to control the indoor units over the F1/F1 datalink?

In the last days I watches the data-messages on my databus between the outdoor and indoor-units in my multisplit-system. It looks very similar to the wired control bus.
start with 0x32, source, dest, cmd, 8bytes data, same crc-calculation and end with 0x34.
I tried to send some commands but i got no response und nothing happend with the units.

Thatswhy the question: Anyone tried before to controll several indoor-units over F1/F1 Databus?

Matthias

lib_hvac "invalid syntax"

def print_serline(serline, noprotocol=True):

Love your work Danny, I would have never gotten this far without you.

I have serial_dump working, and the output looks reasonable.

When I try to call ac_status.py I get the following error:


pi@raspberrypi:~ $ python ac_status.py 
Traceback (most recent call last):
  File "ac_status.py", line 5, in <module>
    import lib_hvac
  File "/home/pi/lib_hvac.py", line 52
    print('%2.2X' % i, end = '  ' )
                           ^
SyntaxError: invalid syntax

I have tried uncommenting lines 51 & 55, but I must confess, I have no idea what is happening here. Can you point me in the right direction?

Thanks,

Matt

Any success integrating with Home Assistant

It would be nice to create custom component for ESPHome so this could be integrated with Home Assistant. The convertor from SAMSUNG NASA to ModBus is pretty expensive so this would safe the day.

amazing

Hi Danny, that exactly what I was searching for. I can help you on reverse-engineering it. it’s pity no wireless control can be applied on old samsung models.

Command52 improvements

Nice work! I did almost the same reverse engineering in 2017 and wrote own controller library in java. I found your project recently and it motivated me to publish my lib too. I took few flags from your understanding of Command52 packet. Thanks for it! Especially for the documentation :-)

And I found one minor mistake here:

  • Temperature bytes (1, 2, 3 and 8) of Command 52 are 6 bits wide (0-5) instead of 5 (0-4) as you describe. My Samsung heat pump (NS071SDXEA) reports output air temperatures up to 53 degrees and such value is too big for 5 bits.

And one improvement:

  • Command 52, data byte 3 is output air temperature. And byte 8 is (reserved for) probably another internal thermometer. Both values are always equal in my case.

Both updated and verified in my lib: Output air temperature continuously grows from 18-53 degrees after device start. Manually measured air temperature on heat pump output corresponds to this value.

samsung communication question

Sound like samsung buscontrol is not like modbus protocol .
I try samsung MWR-TH00 wired remote controller, and catch the code through pressing fan mode:
32 84 20 A0 1F 00 58 01 F4 00 00 00 D9 34 auto->low
32 84 20 A0 1F 00 98 01 F4 00 00 00 76 34 low->middle
32 84 20 A0 1F 00 B8 05 A3 00 00 00 59 A2 FE middle->higth
32 84 20 A0 1F 00 18 01 F4 00 00 00 F6 69 FF higth->auto
The last two codes is not ending by 0x34.
I set the baud rate 2400, 8E1. Do I set anything wrong?

How to determine F3, F4 RS-485 polarity (A,B)

Hi,

I'm trying to figure out which way the RS-485 module's A, B poles should be hooked up to F3, and F4 from the unit.

So far i've tried both ways but don't see any traffic from the serial_dump.py

Just trying to rule out the basics.

Which GPIO pins to use?

This is more a hardware question.

Most tutorials regarding the MAX485 get you to init the GPIO pins on DE/RE as HIGH

however in the code you don't init them ?

Thx

Constructive feedback

Why not monitor the data that S-NET pro 2 sends to air conditioners, it will allow you to send commands directly from your computer

Love It.

Hi Danny,

I've been searching for a solution to this since 2018. I have a Samsung MWR-WE10 wired control panel that I've been trying to setup remote access to (ideally into Hass.io). Until someone showed me your project my idea was just to have a servo push the power button on and off. I really want to implement what you've done here but this is way over my head. Is it at all possible to create a tutorial? I've already got a few RS485 on the way.

Thank you.
-Marcus

Communication on F1/F2 COM

Hi Danny,

Is it possible to you to grab the communication between external and internal unit on F1/F2 pair? I have some Samsung internal A/C units and want to use it to my own A/C heat pump system. Like you know - the internal unit is a slave and w/o external one there's no way to grab the communication. What I wont to achieve is to keep this internal unit "a live" cause w/o outdoor one after around 2minutes timeout it's going to E101 error and simply stop working. You don't need to analyze this (if you don't have a spare time : ) ) just grub the communication during startup/cooling and heating phase. it will be a vital for me - really.
Thx in advance for any help.

[email protected]

Br, Tomek

Support for MWR-ZS00

Hi

Great project!!!

I have a Samsung Ducted AC unit with the MWR-ZS00 8 Zone controller. I have it running in HAS via the Samsung cloud but get no zone control and the cloud side of it lags from time to time

Looking for local control that can also give me zone control, currently the MWR-ZS00 has a touch screen panel on the wall that i can touch on which zone i want, this looks to use RS485 signal between the controller and touch panel to send that signal back to the MWR-ZS00 in the ceiling space and in turn open or close the zone (driven from the MWR-ZS00 via 240v outputs on each zone)

Will this project work with the above? Is it possible to determine the zone control commands so that i can bring this into HAS

More info here, talks about the controller and the use of RS485.
https://climamarket.bg/wp-content/uploads/TDB-SINGLE-Duct-S-Zone-control-system-for-Australia_Europe.pdf

Some Photos
image
image
image

here is some rs485 boards i got from ali
image

Communication protocol specification

It is really cool that you managed to reverse engineer the communication protocol of your Samsung aircon. I'm also interested in replacing my wall-mounted wired remote controller with my custom microcontroller that I can connect to my home automation system. According to the service manual for my remote controller it uses rs485 bus to communicate with the AC unit.
Can you please share any information you found?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.