Code Monkey home page Code Monkey logo

esphome_samsung_ac's People

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

Watchers

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

esphome_samsung_ac's Issues

Does not compile with ESP-IDF framework

Hi,

Just to let you know that this component does not compile with the ESP-IDF framework on ESP32.
Here are all errors in logs:

Compiling .pioenvs/bureau-hvac/src/esphome/components/samsung_ac/non_nasa.o
In file included from src/esphome/components/samsung_ac/nasa.cpp:3:
src/esphome/components/samsung_ac/nasa.cpp: In function 'void esphome::samsung_ac::process_nasa_message(std::vector<unsigned char>, esphome::samsung_ac::MessageTarget*)':
src/esphome/components/samsung_ac/nasa.cpp:499:35: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                     ESP_LOGW(TAG, "s:%s d:%s ENUM_in_state_humidity_percent %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:499:21: note: in expansion of macro 'ESP_LOGW'
                     ESP_LOGW(TAG, "s:%s d:%s ENUM_in_state_humidity_percent %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                     ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:511:35: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                     ESP_LOGW(TAG, "s:%s d:%s ENUM_in_operation_mode %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:511:21: note: in expansion of macro 'ESP_LOGW'
                     ESP_LOGW(TAG, "s:%s d:%s ENUM_in_operation_mode %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                     ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:517:35: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                     ESP_LOGW(TAG, "s:%s d:%s ENUM_in_fan_mode_real %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:517:21: note: in expansion of macro 'ESP_LOGW'
                     ESP_LOGW(TAG, "s:%s d:%s ENUM_in_fan_mode_real %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                     ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:531:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_VENT_POWER %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:531:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_VENT_POWER %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:536:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_VENT_MODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:536:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_VENT_MODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:541:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_LOUVER_HL_SWING %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:541:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_LOUVER_HL_SWING %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:546:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_in_louver_hl_part_swing %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:546:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_in_louver_hl_part_swing %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:551:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_ALTERNATIVE_MODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:551:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_ALTERNATIVE_MODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:556:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_QUIET_MODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:556:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_QUIET_MODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:561:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_POWER_ZONE1 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:561:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_POWER_ZONE1 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:566:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_POWER_ZONE2 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:566:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_OPERATION_POWER_ZONE2 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:577:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_in_operation_mode_real %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:577:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_in_operation_mode_real %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:583:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_in_fan_vent_mode %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:583:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_in_fan_vent_mode %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:599:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_LOUVER_HL_SWING %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:599:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_LOUVER_HL_SWING %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:607:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_LOUVER_HL_SWING %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:607:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_IN_LOUVER_HL_SWING %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:635:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_out_operation_odu_mode %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:635:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_out_operation_odu_mode %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:643:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_out_operation_heatcool %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:643:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_out_operation_heatcool %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:649:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_out_load_4way %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:649:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s ENUM_out_load_4way %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:655:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s VAR_out_error_code %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:655:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s VAR_out_error_code %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:717:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s VAR_out_control_order_cfreq_comp2 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:717:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s VAR_out_control_order_cfreq_comp2 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:722:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s VAR_out_control_target_cfreq_comp2 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:722:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s VAR_out_control_target_cfreq_comp2 %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:728:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s VAR_OUT_PROJECT_CODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:728:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s VAR_OUT_PROJECT_CODE %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:734:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s VAR_OUT_PRODUCT_OPTION_CAPA %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:734:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s VAR_OUT_PRODUCT_OPTION_CAPA %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:747:39: error: format '%d' expects argument of type 'int', but argument 7 has type 'long int' [-Werror=format=]
                         ESP_LOGW(TAG, "s:%s d:%s VAR_OUT_PHASE_CURRENT %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
 #define ESPHOME_LOG_FORMAT(format) format
                                    ^~~~~~
src/esphome/core/log.h:150:28: note: in expansion of macro 'esph_log_w'
 #define ESP_LOGW(tag, ...) esph_log_w(tag, __VA_ARGS__)
                            ^~~~~~~~~~
src/esphome/components/samsung_ac/nasa.cpp:747:25: note: in expansion of macro 'ESP_LOGW'
                         ESP_LOGW(TAG, "s:%s d:%s VAR_OUT_PHASE_CURRENT %d", packet_.sa.to_string().c_str(), packet_.da.to_string().c_str(), message.value);
                         ^~~~~~~~
Compiling .pioenvs/bureau-hvac/src/esphome/components/samsung_ac/protocol.o
cc1plus: some warnings being treated as errors
*** [.pioenvs/bureau-hvac/src/esphome/components/samsung_ac/nasa.o] Error 1
========================= [FAILED] Took 37.82 seconds =========================

RecieveEnable\DriverEnable output for MAX485 compatibility

First up, great work! I appreciate the time you've spent putting this together.

I've been working to get this operational on a Wemos D1 Mini and an MAX485 TTL to RS485 breakout board. The hurdle I've encountered is that the MAX485 chip requires a logic signal to it's DE and RE inputs to enable receiving or sending. Luckily, the inputs are inverted, so you can tie them together electrically and just use simple 'Low to receive, High on send'. If you leave the inputs floating the MAX485 just gets hot and doesn't do anything.

I have spent some time going through the code but I honestly can't get my head around how Samsung_AC::send_bus_message works or how we would get some settings from the YAML to nominate an output pin...

It would be amazing if we could set a MAX485 duplex control GPIO in the YAML that gets pulled low on start and is toggled high when sending. Feel free to tell me to git gud and do it myself. xD

Example Arduino code that I've tested with the MAX485:
//DE,RE Controling pin of RS-485
pinMode(7, OUTPUT);
// DE,RE = HIGH, RS485 Transmit Enabled
digitalWrite(7,HIGH);
//DE,RE = 0, RS485 Receive Enabled
digitalWrite(7,LOW);

[Non-NASA] Blade Movement (AJ050NCJ2EG)

open an Issue for the blade modes (...) and describe what blade modes do you have. It would also help I you could attach the messages set (0-2s) directly after you changed the blade mode. At its best for each mode.

Here's my split remote for reference. It only has a blade button (middle one) that will make them go up and down continuously or stop at any given point.

image

Each time I turn OFF and ON the split the blade position gets reset.

Attached you may find the log for "Fan Only" for split 01. At first the blades were 50% open (seems to be the default whenever I turn ON the unit) logs wind_direction:31. After pressing the remote button blades started moving up and down, logs wind_direction:26. Finished the test by pressing again the button and then proceeded to turn OFF the split.

FAN_MODE-BLADE-ON-OFF.txt

Tried the same in "Heat Mode" and the log shows the exact same wind_direction:31 and wind_direction:26.

HEAT_MODE-BLADE-ON-OFF.txt

Thank you.

[NASA] Fan Speed

Hi, I am opening this issue to track the progress on controlling the fan speed of NASA devices. Currently It seems it is not supported.

How to: Use esphome as RS485 to Wifi bridge

It is possible to bridge the serial connection over Wifi to a virtual COM-Port and to use the Samsung S-Net software for remote controlling your HVAC Unit:

  1. Add https://github.com/oxan/esphome-stream-server to your esphome yaml:
    external_components:
    • source: github://oxan/esphome-stream-server
      stream_server:
  2. Compile and upload
  3. Install a virtual COM-port driver (e.g.: https://www.hw-group.com/software/hw-vsp3-virtual-serial-port)
  4. Start the virtual COM-Port and make sure that "NVT enabled" is unchecked under settings and make sure to set the port to 6638 (which is default of oxan/esphome-stream-server)
  5. Connect with the Samsung S-Net Software using the option F1/F2 (to change COM-Port you have to click on the "hearbeat" icon in the upper left)
    S-Net NASA (new protocol) systems: https://www.samsunghvac.com/Software-Downloads/SNET-Pro2
    S-Net non NASA systems: https://www.samsunghvac.com/Software-Downloads/SNET-Pro

Edit: Sometimes it takes time until the connection is established - disconnect and re-connect helps.
Don't try anything until you see a window like this:
grafik

Enjoy

nasa/temperature sensor

Hello, can we tell the air conditioning to regulate the temperature in relation to another temperature sensor than the one in the air conditioning?

hello, I can't do anything

hello, here is my code for esphome

esphome:
  name: clim-samsung
  friendly_name: clim samsung 
  
esp32:
  board: m5stack-atom
  framework:
    type: esp-idf


# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "C7eUhABV32R9GpyS5osEiUr/XXGKlzGfzYq+rvd0rrM="

ota:
  password: "79eabcbd632cc456e17f12ea195055a6"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Clim-Samsung Fallback Hotspot"
    password: "vIFWNhqHOBU7"

captive_portal:

web_server:

uart:
  tx_pin: GPIO19
  rx_pin: GPIO22
  baud_rate: 9600
  parity: EVEN

and here is what I get from the air conditioning

[08:00:32][C][wifi:405]:   Local MAC: 64:B7:08:B7:A2:20
[08:00:32][C][wifi:410]:   SSID: [redacted]
[08:00:32][C][wifi:411]:   IP Address: 192.168.1.110
[08:00:32][C][wifi:413]:   BSSID: [redacted]
[08:00:32][C][wifi:414]:   Hostname: 'clim-samsung'
[08:00:32][C][wifi:416]:   Signal strength: -38 dB ▂▄▆█
[08:00:32][C][wifi:420]:   Channel: 6
[08:00:32][C][wifi:421]:   Subnet: 255.255.255.0
[08:00:32][C][wifi:422]:   Gateway: 192.168.1.1
[08:00:32][C][wifi:423]:   DNS1: 192.168.1.14
[08:00:32][C][wifi:424]:   DNS2: 192.168.1.1
[08:00:32][C][logger:439]: Logger:
[08:00:32][C][logger:440]:   Level: DEBUG
[08:00:32][C][logger:441]:   Log Baud Rate: 115200
[08:00:32][C][logger:443]:   Hardware UART: UART0
[08:00:32][C][uart.idf:139]: UART Bus 1:
[08:00:32][C][uart.idf:140]:   TX Pin: GPIO19
[08:00:32][C][uart.idf:141]:   RX Pin: GPIO22
[08:00:32][C][uart.idf:143]:   RX Buffer Size: 256
[08:00:32][C][uart.idf:145]:   Baud Rate: 9600 baud
[08:00:32][C][uart.idf:146]:   Data Bits: 8
[08:00:32][C][uart.idf:147]:   Parity: EVEN
[08:00:32][C][uart.idf:148]:   Stop bits: 1
[08:00:32][C][captive_portal:088]: Captive Portal:
[08:00:32][C][web_server:168]: Web Server:
[08:00:32][C][web_server:169]:   Address: clim-samsung.local:80
[08:00:32][C][mdns:115]: mDNS:
[08:00:32][C][mdns:116]:   Hostname: clim-samsung
[08:00:32][C][ota:097]: Over-The-Air Updates:
[08:00:32][C][ota:098]:   Address: clim-samsung.local:3232
[08:00:32][C][ota:101]:   Using Password.
[08:00:32][C][api:139]: API Server:
[08:00:32][C][api:140]:   Address: clim-samsung.local:6053
[08:00:32][C][api:142]:   Using noise encryption: YES
[08:00:33][D][api:102]: Accepted 192.168.1.106
[08:00:33][W][component:214]: Component api took a long time for an operation (0.06 s).
[08:00:33][W][component:215]: Components should block for at most 20-30ms.
[08:00:33][D][api.connection:1121]: Home Assistant 2024.1.4 (192.168.1.106): Connected successfully

[NASA] Blades Direction

Hi, I am opening this to add support for setting the blades direction on indoor units. This would probably also cover special modes for blades such as "Long Wind" etc.

[COMMON] M5STACK Example as Default

Hi @lanwin,

I'm reaching out to suggest making the M5STACK board the default example setup. Given the popularity of this board among the community, it seems like a logical choice, especially since it's labeled as Plug & Play. This adjustment could enhance the experience for beginners, aligning with the board's user-friendly nature. We could then include guidance on modifying the example for various boards in the DIY section.

Thanks for considering this enhancement

Failed to compile since last change

I've just received my M5stack device and tried to compile the ESPHome firmware but got this error:

Compiling .pioenvs/salon-hvac/src/esphome/components/samsung_ac/nasa.cpp.o
Compiling .pioenvs/salon-hvac/src/esphome/components/samsung_ac/protocol.cpp.o
Compiling .pioenvs/salon-hvac/src/esphome/components/samsung_ac/samsung_ac.cpp.o
Compiling .pioenvs/salon-hvac/src/esphome/components/samsung_ac/samsung_ac_device.cpp.o
src/esphome/components/samsung_ac/nasa.cpp:7:10: fatal error: esphome/components/mqtt/mqtt_client.h: No such file or directory
 #include "esphome/components/mqtt/mqtt_client.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/salon-hvac/src/esphome/components/samsung_ac/nasa.cpp.o] Error 1
========================== [FAILED] Took 5.03 seconds ==========================

It seems that it is due to the latest change from yesterday.

[NASA] Logging Devices on Bus

Currently the log for connected devices looks like this:

[13:50:47][C][samsung_ac:107]: registered devices: 20.00.00, 20.00.01
[13:50:47][C][samsung_ac:122]: known indoor devices: 20.00.00, 20.00.01, 62.00.8f
[13:50:47][C][samsung_ac:123]: known outdoor devices: 10.00.00

I would rename the "known devices" to "Discovered devices" also it would be nice to start the log with capital letter at beginning to keep it consistent with other log messages. Also please check that my WiFi controller was put to indoor devices category, it would be nice to put it separately in "Other devices" or you can even put it to correct category based on the AddressClass here.

P.S. is there some way how to set priority on the issue? This is very, very, very low priority 😄

[NASA] Commands not being executed

Hey @lanwin, just checking if you've seen this before I start to investigate any further.
Sometimes I have to give the command twice so it gets executed.
Like: if AC is off and I want to turn it ti cool mode. I select cool mode, AC beeps but nothing happens, I have to open drawer again and select cool, then magic happens.
It's primarily for mode changes, like turning it on and off.
It's not annoying at all if I am in the room, but it's not good because we have to give the commands twice sometimes, to make sure haha

Either way, it's a great work you did, thanks a lot for that!

[COMMON] Group Data for Indoor Units

It would be nice to be able to group the data based on the indoor unit such as temperature, power consumption etc. This would be very useful especially when you have multiple indoor units. Currently all the data we read are placed under common sensor section in Home Assistant.

There are two possible solution which needs more investigation. One is to create separate device per indoor unit, this doesn't look to be possible right now, I have opened this issue in ESPHome repository so maybe this feature would be implemented. Another option would be to group the data under custom climate component (or another component if necessary), I was inspired by custom implementation of Haier AC where it seems to be possible to add additional information under climate component.

[Non-NASA] Unable to control AC since 7 Feb update

I am running an M5StackMini unit on my non-NASA indoor AC (showing as 00 and outdoor as c8) and have been controlling it perfectly for a couple of weeks. Since the code update yesterday (Feb 7th) I seem to have lost control of the AC. I can see the command to turn on/off in the logs like this:
[08:41:09][D][switch:016]: 'Aircon_power' Turning OFF.
[08:41:09][D][switch:055]: 'Aircon_power': Sending state OFF

...but it isn't reflected in the state of the device. I see no errors in the debug log. Where should I look next please?

Power Switch only works sometimes

So I managed to get this working but at first I thought I hadn't because I wasn't able to switch the unit on. But everything else works flawlessly, reading house temp, setting target temp, changing the mode. Sometimes the power switch works but other times it sends the signal but it seems like it gets reset a second later. Here's a log:

[17:41:04][W][samsung_ac:018]: update
[17:41:04][C][samsung_ac:039]: Configured devices: 00
[17:41:04][C][samsung_ac:059]: Discovered devices:
[17:41:04][C][samsung_ac:060]:   Outdoor: -
[17:41:04][C][samsung_ac:061]:   Indoor:  00
[17:41:06][D][switch:012]: 'Power' Turning ON.
[17:41:06][D][switch:055]: 'Power': Sending state ON
[17:41:06][W][samsung_ac:098]: write 32d000b01f041401f4210000bb34
[17:41:08][D][number:012]: 'Target temperature': Sending state 20.000000
[17:41:08][D][sensor:094]: 'House temperature': Sending state 22.00000 °C with 1 decimals of accuracy
[17:41:08][D][switch:055]: 'Power': Sending state OFF
[17:41:08][D][select:015]: 'Mode': Sending state Cool (index 1)
[17:41:15][D][number:012]: 'Target temperature': Sending state 20.000000
[17:41:15][D][sensor:094]: 'House temperature': Sending state 22.00000 °C with 1 decimals of accuracy
[17:41:15][D][select:015]: 'Mode': Sending state Cool (index 1)
[17:41:20][D][switch:012]: 'Power' Turning ON.
[17:41:20][D][switch:055]: 'Power': Sending state ON
[17:41:20][W][samsung_ac:098]: write 32d000b01f041401f4210000bb34
[17:41:21][D][number:012]: 'Target temperature': Sending state 20.000000
[17:41:21][D][sensor:094]: 'House temperature': Sending state 22.00000 °C with 1 decimals of accuracy
[17:41:21][D][select:015]: 'Mode': Sending state Cool (index 1)
[17:41:28][D][number:012]: 'Target temperature': Sending state 20.000000
[17:41:28][D][sensor:094]: 'House temperature': Sending state 22.00000 °C with 1 decimals of accuracy
[17:41:28][D][select:015]: 'Mode': Sending state Cool (index 1)

[17:41:06][D][switch:055]: 'Power': Sending state ON <--- This was me turning it on with Home Assistant.
[17:41:06][W][samsung_ac:098]: write 32d000b01f041401f4210000bb34
[17:41:08][D][number:012]: 'Target temperature': Sending state 20.000000
[17:41:08][D][sensor:094]: 'House temperature': Sending state 22.00000 °C with 1 decimals of accuracy
[17:41:08][D][switch:055]: 'Power': Sending state OFF <--- This wasn't me

But then later you see I try again and this time it stays on. What's going on here?

nasa.h const values and naming issue

Hi,

in esphome_samsung_ac/components/samsung_ac/nasa.h
the const values and also some of the strings
are somewhat confusing starting from line 33:

        **BoradcastCS** = 0xB3,
        BroadcastControlAndSetLayer = **0xB3**,
        BroadcastModuleLayer = 0xB4,
        **BoradcastCSM** = 0xB7,
        BroadcastLocalLayer = 0xB8,
        BroadcastCSML = 0xBF,
        **Undefiend** = 0xFF,

I am not familiar with github on how to edit this. I don't want to mess up anything.
Are You able to "repair" the values and strings ?

Cheers, Peter

[Non-NASA] Most UART messages aren't decoded

I'm trying to get a Non-NASA system up and running, as I'm replacing a (now abandoned!) MIM-H02 Wifi interface.

It looks like it can't parse the incoming messages, except for one brief moment, immediately after power cycling the AC.

I've attached the logs & config. I am on commit c505fdd

I did try at 2400 baud, but no messages at all were decoded, even after power cycling.

I've also tried disabling the Wifi Kit option via the control panel settings, but the behaviour is the same.

logs_ac_rear_logs.txt
ac_rear.yaml.txt

Nasa protocol notes

Hi Lanwin, love your project and have started playing around with the data.

You've written down the bottom of the page "Hopefully I can provide a description of the NASA protocol here soon.". If possible I would love your unrefined notes on it. I'm trying to pick it up and c isn't my first programming language so it's a bit tricky for me to fully grasp what the code is doing.

Another question is where did you get all the message numbers from in nasa.cpp out of interest? It seems like you grabbed them from some xml file? Keen to hear the story here.

Thanks heaps

Mode Select generates unique IDs error

Discussed in #30

Originally posted by khughes5 November 19, 2023
Hi Guys,

Again, sorry if this is another newb question/problem but i have been trying to resolve issues with my installation, and can't for the life of me figure it out.

Control of my AC works through the website instantly
image
however control via HA was really hit and miss for me.. for example if i use the climate control panel item with the system in an off state, change mode to "Cool", it thinks about it for a couple of seconds and then resets back to off. During the last 2 weeks i have probably had it work for a total of 1 day.. but that was fleeting..

I started checking logs and found this repetitive error message:

Platform esphome does not generate unique IDs. ID D4:D4:DA:9D:0D:8C-select-homeac_mode is already used by select.esp_samsung_ac_homeac_mode - ignoring select.esp-samsung_ac_homeac_mode

My ESP at the time was called esp_samsung_ac and my climate name was "My Home" with the sensors named HomeAc_temp, HomeAC_target, HomeAC_mode etc.

In the past, i HAVE renamed the ESP device (usually by creating a new device in ESPhome, editing the config then re-uploading via OTA), and these error messages seemed to indicate it remembered the old configuration.. I even tried removing all the old records from .storage\core.entity_registry.. as well as trying to rename the device and sensor names again..

To make things more insulting.. i gave up today and created a whole new HomeAssistant installation from scratch, installed ESP-Home, then created a new device, copied my old yaml contents in (using the newly generated encryption key), created a manual firmware.. then uploaded it through the OTA on the web interface... I also then had to adopt the device into ESP-Home in discovered devices.. Somehow, this still results in the error message:
image

now my ESP is called "ESP-samsungac", my climate called "SamsungAC" and sensors as "AC_temp", "AC_target" etc.. My Climate controls still do not function reliably.. i really don't know what else to do.. short of throwing away the M5 stack i have it installed on and trying everything from scratch again.. but this seems stupid :(

here is my config yaml:

esphome:
  name: esp-samsungac
  friendly_name: ESP-SamsungAC

substitutions:
  name: esp-samsungac

esp32:
  board: m5stack-atom
  framework:
    type: arduino

web_server:
  port: 80

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxx"

ota:
  password: "73571d78e2b33fbbee49a53066f0436b"
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5
  on_error:
    then:
      - logger.log:
          format: "OTA update errorr %d"
          args: ["x"]

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp-Samsungac Fallback Hotspot"
    password: "xxxxxxxxxxxxxxxxxxx"

captive_portal:

uart:
  tx_pin: GPIO19
  rx_pin: GPIO22
  baud_rate: 9600
  parity: EVEN
  #debug:
  #  direction: BOTH
  #  dummy_receiver: true
  #  after:
  #      timeout: 200ms
  #  sequence:
  #    - lambda: UARTDebug::log_hex(direction, bytes, ' ');

external_components:
  - source: github://lanwin/esphome_samsung_ac@main
    components: [ samsung_ac ]

samsung_ac:
  devices:
    - address: "20.00.00" # for non NASA it sould be like "c4"
      # Each property below are optional - choose what you want to use.

      # You could use the ESPHome/Homeassist climate control
      climate:
        name: "SamsungAC"

      # And/or use seperate controls/sensors
      room_temperature:
        name: AC_temp
      target_temperature:
        name: AC_target
      power:
        name: AC_power
      mode:
        name: AC_mode
        
      # Only supported on NASA devices
      room_humidity:
        name: AC_humidity    

# DEVICE INFO
text_sensor:
  - platform: wifi_info
    ip_address:
      name: "${name} IP address"
      icon: mdi:ip-network

sensor:
  - platform: wifi_signal
    name: "${name} signal"
    update_interval: 360s
  
  - platform: uptime
    name: "${name} uptime"
    update_interval: 360s

button:
  # Restart the ESP
  - platform: restart
    name: "Restart ${name}"
</div>

[Non-NASA] Help with Ducted system

Hi,

Great project! very keen to get this working with my AC

I have a non-Nasa ducted system that previously had the wireless controller on the f1/f2 terminals, but it has stopped working of late and Samsung don't sell replacements
image

I got some esp32s and the rs485 ttls, I'm a bit of a noob but wondering how i could get started with your code on my non-nasa setup?

Only functions ill need are

  • AC ON/OFF
  • MODE (Auto, Heat, Cool, Fan, Dry)
  • Fan Speed
  • Target Temperature
  • Current Temperature

@lanwin

[NASA] Add quiet mode

Hi!

Is it possible to add "Quiet" mode?

Debug log attached:

  • At 16:55:36 (fan_mode_real 13) = quiet mode activated (from auto)
  • At 16:55:47/48 (fan_mode_real 11) = back to auto

Thank you

quiet mode.txt

[NASA] Heat pump sensor for warm water

Discussed in #63

Originally posted by Mocky158 January 28, 2024
Good day
Earlier I asked about the connection with the heat pump. Previously, it was a problem to recognize what entity would be for a given value.
I would like to ask if anything has changed since then, if it is possible to recognize the given values?
thank you very much

Support for **09/12AVH** Model

Hey folks! Unfortunately upon installation I encountered a problem where the version of my AC doesn't have a F1/F2 port. Only a C port! I don't quite know if It is possible to start working on a integration for this model since It doesn't look to follow the standards of this project. Let me know if I can help in anything! Tks :D

Error with idf framework

Hi!

I do not have time to check what’s going on but the current code does not compile with the IDF framework:

Compiling .pioenvs/hvac-test/src/esphome/components/samsung_ac/protocol_nasa.o
In file included from src/esphome/components/samsung_ac/protocol.cpp:3:
src/esphome/components/samsung_ac/util.h:25:26: error: 'experimental' in namespace 'std' does not name a type
         using opt = std::experimental::optional<T>;
                          ^~~~~~~~~~~~
src/esphome/components/samsung_ac/util.h:26:33: error: 'experimental' in namespace 'std' does not name a type
         using opt_null_t = std::experimental::nullopt_t;
                                 ^~~~~~~~~~~~
src/esphome/components/samsung_ac/util.h:27:39: error: 'std::experimental' has not been declared
         constexpr auto nullopt = std::experimental::nullopt;
                                       ^~~~~~~~~~~~
Compiling .pioenvs/hvac-test/src/esphome/components/samsung_ac/protocol_non_nasa.o
*** [.pioenvs/hvac-test/src/esphome/components/samsung_ac/protocol.o] Error 1
In file included from src/esphome/components/samsung_ac/protocol_nasa.cpp:6:
src/esphome/components/samsung_ac/util.h:25:26: error: 'experimental' in namespace 'std' does not name a type
         using opt = std::experimental::optional<T>;
                          ^~~~~~~~~~~~
src/esphome/components/samsung_ac/util.h:26:33: error: 'experimental' in namespace 'std' does not name a type
         using opt_null_t = std::experimental::nullopt_t;
                                 ^~~~~~~~~~~~
src/esphome/components/samsung_ac/util.h:27:39: error: 'std::experimental' has not been declared
         constexpr auto nullopt = std::experimental::nullopt;
                                       ^~~~~~~~~~~~
In file included from src/esphome/components/samsung_ac/protocol_non_nasa.cpp:7:
src/esphome/components/samsung_ac/util.h:25:26: error: 'experimental' in namespace 'std' does not name a type
         using opt = std::experimental::optional<T>;
                          ^~~~~~~~~~~~
src/esphome/components/samsung_ac/util.h:26:33: error: 'experimental' in namespace 'std' does not name a type
         using opt_null_t = std::experimental::nullopt_t;
                                 ^~~~~~~~~~~~
src/esphome/components/samsung_ac/util.h:27:39: error: 'std::experimental' has not been declared
         constexpr auto nullopt = std::experimental::nullopt;
                                       ^~~~~~~~~~~~
*** [.pioenvs/hvac-test/src/esphome/components/samsung_ac/protocol_nasa.o] Error 1
*** [.pioenvs/hvac-test/src/esphome/components/samsung_ac/protocol_non_nasa.o] Error 1
========================= [FAILED] Took 65.03 seconds =========================

[Non-NASA] Test Beep - Not Important (AJ050NCJ2EG)

I've noticed that my remote has the ability to "beep" the unit for testing:

image

This isn't an important feature but could be an interesting way to have a test button on ESPHome to quickly identify indoor units. Attaches you may find the log produced by unit 01 while making the beep.

BEEP.txt

[COMMON] PR to ESPHome Code Base

Hi, is there plan to merge this component to ESPHome code base? I think it would be nice touch. I fully understand that we need to test it properly first but I think that with this functionality we have right now it would be nice 1.0 version.

[NASA] Power Consumption

Will it be possible to add power consumption for NASA devices? Also is there some way how to support you? You are doing great job!

[Common] Wrong description

Him

I'm trying to connect my device. I've received M5Stack devices. It looks like there is no comunnication detected.
My device is AR12NXCXAWKNEU - I believe it is Non NASA version. Should it work?

Ps. There is an error in Plug and Play Hardware instalation section:

Connect the components as follows:

Connect F1 on the AC unit to B on the M5STACK controller.
Connect F2 on the AC unit to A on the M5STACK controller.
Connect V1 on the AC unit to DC on the M5STACK controller.
Connect V2 on the AC unit to G on the M5STACK controller.

On the picture there is F1 <-> A and F2 <-> B connection.

[Non-NASA] AJ050NCJ2EG + ESP32-S2-Mini + RS485 module - behavior and issues

Hello,

Many thanks for putting this component together. With the provided instructions I was almost able to fully control my Samsung AJ050NCJ2EG.

My circuit is an ESP32-S2-Mini board connected to a TTL to RS485 module [details] like this:

ESP-AC_Samsung_bb-vert

I then wired the RS485 A+ and B- to F1 and F2 respectively in the outdoor unit (red and black wires):

unit-boards-outside

I'm powering this using the 12V blue plug on the unit PCB and a step down to get it to 5v. So the GND is shared between the AC unit, ESP and the RS485 module.

Here's my configuration:

esphome:
  name: ac-samsung
  platformio_options:
    board_build.extra_flags:
      - "-DARDUINO_USB_CDC_ON_BOOT=0"

esp32:
  board: lolin_s2_mini
  variant: ESP32S2
  framework:
    type: arduino

logger:

api:
  encryption:
    key: ""

ota:
  safe_mode: false
  password: ""

web_server:
  port: 80
  version: 2
  ota: true
  auth:
    username: "username"
    password: "password"

wifi:
  ssid: "ssid"
  password: "password"

captive_portal:

uart:
  tx_pin: 3
  rx_pin: 2
  baud_rate: 9600
  parity: EVEN

external_components:
  - source: github://lanwin/esphome_samsung_ac@main
    components: 
      - samsung_ac

samsung_ac:
  devices:
    - address: "00"
      climate:
        name: "Bedroom climate"
      room_temperature:
        name: "Bedroom temperature"
      target_temperature:
        name: "Bedroom target temperature"
      power:
        name: "Bedroom power"
      mode:
        name: "Bedroom mode"
    - address: "01"
      climate:
        name: "Living Room climate"
      room_temperature:
        name: "Living Room temperature"
      target_temperature:
        name: "Living Room target temperature"
      power:
        name: "Living Room power"
      mode:
        name: "Living Room mode"

switch:
  - platform: restart
    name: "Restart ESP"

It was able to discover my units:

[14:35:23][W][component:214]: Component samsung_ac took a long time for an operation (0.25 s).
[14:35:23][W][component:215]: Components should block for at most 20-30ms.
[14:35:23][W][samsung_ac:018]: update
[14:35:23][C][samsung_ac:039]: Configured devices: 00, 01
[14:35:23][C][samsung_ac:059]: Discovered devices:
[14:35:23][C][samsung_ac:060]:   Outdoor: c8
[14:35:23][C][samsung_ac:061]:   Indoor:  00, 01

It seems to be communicating, however I can't control them and the UI shows this behavior of things randomly jumping around:

GIF 25-01-2024 17-56-29

I can see the indoor split temperatures just fine. If I turn on one split using the AC remote the "power" toggle also change state, however if I try to power it on using the web interface it usually fails or turns on the wrong indoor unit.

The log gets written very, very fast and with a LOT of data, nevertheless I believe the only errors that show up are:

[14:35:23][W][samsung_ac:099]: unknown command 40
[14:35:25][W][component:214]: Component samsung_ac took a long time for an operation (0.22 s).
[14:35:25][W][component:215]: Components should block for at most 20-30ms.

Any ideias on what might be causing this?

Thank you.

[NASA] Display Error Codes

I am opening this issue to track progress on option to monitor error codes for indoor and outdoor units. I think it should be easy to add because if I am not mistaken they are already logged, see below

image

This has low priority, but it would be nice feature. It would be possible to send alerts from Home Assistant if there si some issue with the AC.

connection alternative

Hi
good job. One air conditioner is already connected, but I have a problem with the other one. Do I need to connect to the indoor air conditioning unit? Can I connect the cable between the outdoor and indoor units? because I have difficult access to the F1 and F2 connectors. Kris

Lag when sending commands to AC

When any values is changed, it takes a few seconds until the AC executes it. In this time it can happen that the AC sends messages with the old values to the UI witch causes it to switch back to the old states before the AC executes it and the new values get visible.

We should change that so the UI skips messages for changed values until the new values appears (or a timeout happens).

[Non-NASA] F3 F4 serial bus

Hello @lanwin

First of all thanks for putting this together and sharing it on GitHub. It is exactly what I have been looking for.

I am wondering if you have considered adding in support for the non-nasa F3 F4 (wall controller <-> indoor unit) serial bus? I ask as it is much easier for me (I assume others too) to connect to the cabling behind the wall controller than to connect to the outdoor unit or the indoor unit in the roof space.

I realise that this wouldn't be a minor change to your codebase. To this end I have been experimenting with adapting your existing code to function based off of the specifications shared by DannyDeGaspari. I have reached a point now where I am able to reliably send commands and have them accepted.

Temperature and On/Off works. I have a ducted system with a 3rd party ventilation system so am unable to test for fan speed/blade positions.

Mode does not appear to be working but I note that other non-nasa users are reporting the same on the F1F2 serial bus. So this is a work in progress.

I would submit a PR myself but this is my first time using c++ and I only understand how all the code fits together at a basic level. I fear that I would not be able to produce something of good enough quality myself so instead I wish to point out my repo here where you can see the changes that I have made to reach this point.

I am more than happy to keep working on this on my own repo for myself but in the event that you are happy to explore the F3 F4 serial bus further I would be happy to help where I can.

Thanks!

Raw message reading terminated prematurely when 0x34 (end byte) is part of data

Hi @lanwin,

thanks again for your work, it has helped me a lot to connect my Samsung EHS heat pump to Home Assistant.

I did accidentally stumble upon this issue: in void Samsung_AC::loop() in samsung_ac.cpp, the raw input data is read until the end byte 0x34 is found. That works fine most of the time, but fails if 0x34 is part of the data and not yet the end byte! Example:

[10:30:48][W][samsung_ac:018]: RAW: 32002f200000b300ffc014bb06440f0000000044230003ae4044240000796044260000000044270034

In this example:

  • value for code 4423 = 0003ae40
  • value for code 4424 = 00007960
  • value for code 4426 is 00000000
  • value for code 4427 is 0034.... but the algorithm thinks it found the end byte and terminates further processing

Can we think of a clever trick to solve this?

esphome doesn't compile anymore

@lanwin: Yesterday's changes result in the following error message:
(maybe you should fork the development in dev and stable)

INFO ESPHome 2023.12.9
INFO Reading configuration /config/esphome/esphome-klimaanlage.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esphome-klimaanlage (board: m5stack-atom; framework: espidf; platform: platformio/[email protected])

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

  • framework-espidf @ 3.40405.230623 (4.4.5)
  • tool-cmake @ 3.16.4
  • tool-ninja @ 1.7.1
  • toolchain-esp32ulp @ 2.35.0-20220830
  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    Reading CMake configuration...
    Dependency Graph
    |-- noise-c @ 0.1.4
    Compiling .pioenvs/esphome-klimaanlage/src/esphome/components/samsung_ac/protocol.o
    Compiling .pioenvs/esphome-klimaanlage/src/esphome/components/samsung_ac/protocol_non_nasa.o
    src/esphome/components/samsung_ac/protocol.cpp: In function 'esphome::samsung_ac::DataResult esphome::samsung_ac::process_data(std::vector&, esphome::samsung_ac::MessageTarget*)':
    src/esphome/components/samsung_ac/protocol.cpp:42:24: error: enumeration value 'Ok' not handled in switch [-Werror=switch]
    switch (result)
    ^
    src/esphome/components/samsung_ac/protocol.cpp:42:24: error: enumeration value 'SizeDidNotMatch' not handled in switch [-Werror=switch]
    src/esphome/components/samsung_ac/protocol.cpp:42:24: error: enumeration value 'UnexpectedSize' not handled in switch [-Werror=switch]
    cc1plus: some warnings being treated as errors
    *** [.pioenvs/esphome-klimaanlage/src/esphome/components/samsung_ac/protocol.o] Error 1

Error since latest commits

Hi,

Just to let you know that since latest commit (yesterday) I have these errors in ESPHome logs:

[11:47:02][D][esp-idf:000]: E (173547) esp-tls: couldn't get hostname for :: getaddrinfo() returns 202, addrinfo=0x0

[11:47:02][D][esp-idf:000]: E (173553) TRANSPORT_BASE: Failed to open a new connection: 32769

[11:47:02][D][esp-idf:000]: E (173569) MQTT_CLIENT: Error transport connect

I use an ESP32 (m5stack atom lite) with the Arduino framework. I do not use MQTT, only API.

How to get the data heat pump (AE160JNYDGH)

Hello
I apologize in advance, I'm using Github for the first time for a question, so I don't know if this is the right way to write for advice.

I created esp according to see attachment. I also attached the settings I have to the file.

The problem is that I don't know how to know that something has been read or how to change it to read other data.

This is a heat pump (AE160JNYDGH)

I'm sorry if I wrote it incomprehensible, I'm using Google translator, I'm from the Czech Republic
Tepelné čerpadlo.txt

Sestrojeni

ESP web

[NASA] Help understand packet sending

Hello @lanwin and thank you very much for all the hard work you have put into the project so far.

I own a Samsung EHS Mono HT Quiet heat pump and as the compressor frequency control among other things is totally messed up I would like to implement such a control by myself. BTW I have plenty of software development and technical background to generally know what I'm doing there ;-)

I have already found out that it is possible to control the compressor frequency via Modbus.
Also, I have written a NASA-Parser, that helps analyse what is going on on the bus as it displays the packets in a more human readable format. See attachment (zipped HTML) NASA Example.zip.

Using this parser I have learned that the indoor unit and outdoor unit are communicating only via broadcast messages. So it seems with NASA there is no "master" or "slave".

I'm asking myself when sending messages via the NASA bus, how can I know when to send a message in order to not interfere with messages from other participants on the bus.

@lanwin did you find any information on that topic in the S-NET implementation? Or is it just sending and hoping optimistically not to collide with other sends?

Help to show humidity value from NASA DVM

Hi,
Thanks for your time.
I've tried as you guide, and it worked.
I can get below functions:

  • On/off
  • Monitor temperature
  • Set target
  • Select mode
    And as the log shows that I can get humidity value, I tried to add humidity sensor but not success.
    Could you give me some guideline to show both humidity and temperature in ESPhome.
    Thanks!
    @lanwin
    image

[NASA] Temperature differs from the reported indoor temperature

Hi!

I have a Samsung Windfree AR12TXCAAWKNEU with is working fine with your code but I have an issue with the temperature which differs from the one reported by my HVAC: 22.5°C using this code, 20°C using Samsung APP or the smartthings integration in HA.

From ESPHome log:

[23:04:57][W][samsung_nasa:479]: s:20.00.00 d:b0.00.ff VAR_in_temp_room_f 22.500000
[23:04:57][D][sensor:094]: 'Temperature': Sending state 22.50000 °C with 1 decimals of accuracy
[23:04:57][D][climate:380]: 'Salon' - Sending state:
[23:04:57][D][climate:383]: Mode: HEAT
[23:04:57][D][climate:388]: Fan Mode: AUTO
[23:04:57][D][climate:403]: Current Temperature: 22.50°C
[23:04:57][D][climate:409]: Target Temperature: 19.00°C
[23:05:07][W][samsung_nasa:500]: s:20.00.00 d:b3.00.ff ENUM_in_operation_power on
[23:05:07][D][climate:380]: 'Salon' - Sending state:
[23:05:07][D][climate:383]: Mode: HEAT
[23:05:07][D][climate:388]: Fan Mode: AUTO
[23:05:07][D][climate:403]: Current Temperature: 22.50°C
[23:05:07][D][climate:409]: Target Temperature: 19.00°C
[23:05:07][W][samsung_nasa:506]: s:20.00.00 d:b3.00.ff ENUM_in_operation_mode 4
[23:05:07][D][select:015]: 'Mode': Sending state Heat (index 4)
[23:05:07][D][climate:380]: 'Salon' - Sending state:
[23:05:07][D][climate:383]: Mode: HEAT
[23:05:07][D][climate:388]: Fan Mode: AUTO
[23:05:07][D][climate:403]: Current Temperature: 22.50°C
[23:05:08][D][climate:409]: Target Temperature: 19.00°C
[23:05:08][W][samsung_nasa:494]: s:20.00.00 d:b3.00.ff ENUM_in_state_humidity_percent 44
[23:05:08][D][sensor:094]: 'Humidity': Sending state 44.00000 % with 0 decimals of accuracy

Samsung heat pump

Good day
Earlier I asked about the connection with the heat pump. Previously, it was a problem to recognize what entity would be for a given value.
I would like to ask if anything has changed since then, if it is possible to recognize the given values?
thank you very much

[NASA] AC Configuration

Hi, it should be possible to configure indoor/outdoor unit over the communication bus. This would allow to read/modify some AC settings such as disable sound, disable/enable pump for condensate etc. Do you think it would be possible? This would really help because the configuration of AC using IR controller is terrible. Just reading the set values would be great, allowing modifications would be awesome.

P.S. I can provide the documentation from SAMSUNG.

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.