70 .bit_mark = 420, .one_space = 1200, .zero_space = 420};
83 ESP_LOGV(TAG,
"Transmit state");
101 uint8_t temperature_clamped =
112 switch (this->
mode) {
179 ESP_LOGV(TAG,
"Transmit off");
197 ESP_LOGV(TAG,
"Transmit message length %d",
length);
200 auto *data = transmit.get_data();
209 data->item_bytes<FUJITSU_GENERAL_BIT_TIMINGS>(
message,
length);
239 ESP_LOGW(TAG,
"Received unassigned mode %X, keeping the current mode",
mode);
243optional<climate::ClimateFanMode>
decode_fan_mode(uint8_t fan_field, optional<climate::ClimateFanMode> current_mode) {
255 ESP_LOGW(TAG,
"Received unassigned fan speed %X, keeping the current fan mode", fan);
271 ESP_LOGV(TAG,
"Received IR message");
275 ESP_LOGV(TAG,
"Header fail");
283 ESP_LOGV(TAG,
"Header bytes fail");
288 uint8_t recv_message_length;
290 switch (recv_message_type) {
292 ESP_LOGV(TAG,
"Received state message");
298 ESP_LOGV(TAG,
"Received util message");
302 ESP_LOGV(TAG,
"Unknown message type %X", recv_message_type);
309 ESP_LOGV(TAG,
"Body bytes fail");
313 for (uint8_t
byte = 0;
byte < recv_message_length; ++byte) {
314 ESP_LOGVV(TAG,
"%02X", recv_message[
byte]);
317 const uint8_t recv_checksum = recv_message[recv_message_length - 1];
318 uint8_t calculated_checksum;
325 if (recv_checksum != calculated_checksum) {
326 ESP_LOGV(TAG,
"Checksum fail - expected %X - got %X", calculated_checksum, recv_checksum);
334 ESP_LOGV(TAG,
"Received temperature %d", offset_temperature);
337 ESP_LOGV(TAG,
"Received mode %X", recv_mode);
339 ESP_LOGW(TAG,
"Received a frame with the clean / 10 degree heat bit set, which is not supported");
344 ESP_LOGV(TAG,
"Received fan mode %X", recv_fan_mode);
348 ESP_LOGV(TAG,
"Received swing mode %X", recv_swing_mode);
355 ESP_LOGV(TAG,
"Received off message");
361 ESP_LOGV(TAG,
"Received unsupprted message type %X", recv_message_type);
BedjetMode mode
BedJet operating mode.
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
float target_temperature
The target temperature of the climate device.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
void publish_state()
Publish the state of the climate device, to be called from integrations.
uint8_t checksum_state_(uint8_t const *message)
Calculate checksum for a state message.
void transmit_state() override
Transmit via IR the state of this climate controller.
uint8_t checksum_util_(uint8_t const *message)
Calculate cecksum for a util message.
bool on_receive(remote_base::RemoteReceiveData data) override
Parse incoming message.
void transmit_off_()
Transmit via IR power off command.
void transmit_(uint8_t const *message, uint8_t length)
Transmit message as IR pulses.
RemoteTransmitterBase * transmitter_
const LogString * message
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_HORIZONTAL
The fan mode is set to Horizontal.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_SWING_BOTH
The fan mode is set to Both.
ClimateMode
Enum for all modes a climate device can be in.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_ON
The fan mode is set to On.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_QUIET
The fan mode is set to Quiet.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
optional< climate::ClimateFanMode > decode_fan_mode(uint8_t fan_field, optional< climate::ClimateFanMode > current_mode)
Unassigned values keep the current fan mode.
constexpr uint16_t FUJITSU_GENERAL_TRL_MARK
constexpr uint8_t FUJITSU_GENERAL_MESSAGE_TYPE_ECONOMY
constexpr uint8_t FUJITSU_GENERAL_FAN_LOW
constexpr uint8_t FUJITSU_GENERAL_POWER_ON_NIBBLE
constexpr uint8_t FUJITSU_GENERAL_FAN_MASK
constexpr uint8_t FUJITSU_GENERAL_COMMON_BYTE1
constexpr uint16_t FUJITSU_GENERAL_HEADER_SPACE
constexpr uint8_t FUJITSU_GENERAL_FAN_SILENT
constexpr uint8_t FUJITSU_GENERAL_FAN_AUTO
constexpr uint8_t get_nibble(const uint8_t *message, uint8_t nibble)
constexpr uint8_t FUJITSU_GENERAL_CLEAN_BIT
constexpr uint8_t FUJITSU_GENERAL_STATE_MESSAGE_LENGTH
constexpr uint8_t FUJITSU_GENERAL_COMMON_BYTE4
constexpr uint16_t FUJITSU_GENERAL_HEADER_MARK
constexpr uint8_t FUJITSU_GENERAL_STATE_FOOTER_BYTE0
ESPHOME_LOG_TAG(TAG, "fujitsu_general.climate")
constexpr uint8_t FUJITSU_GENERAL_TEMPERATURE_NIBBLE
constexpr uint8_t FUJITSU_GENERAL_MODE_DRY
constexpr uint8_t FUJITSU_GENERAL_MESSAGE_TYPE_NUDGE
constexpr uint8_t FUJITSU_GENERAL_COMMON_BYTE0
constexpr uint8_t FUJITSU_GENERAL_STATE_HEADER_BYTE1
climate::ClimateSwingMode decode_swing_mode(uint8_t swing_field)
constexpr uint8_t FUJITSU_GENERAL_TEMP_MIN
constexpr uint8_t FUJITSU_GENERAL_SWING_NIBBLE
constexpr uint8_t FUJITSU_GENERAL_UTIL_MESSAGE_LENGTH
constexpr uint8_t FUJITSU_GENERAL_FAN_HIGH
constexpr uint8_t FUJITSU_GENERAL_MODE_FAN
constexpr uint8_t FUJITSU_GENERAL_MESSAGE_TYPE_BYTE
constexpr uint8_t FUJITSU_GENERAL_MODE_NIBBLE
constexpr uint8_t FUJITSU_GENERAL_FAN_MEDIUM
constexpr uint8_t FUJITSU_GENERAL_SWING_BOTH
constexpr uint8_t FUJITSU_GENERAL_COMMON_BYTE2
climate::ClimateMode decode_mode(uint8_t mode_field, climate::ClimateMode current_mode)
Unassigned values keep the current mode, except that OFF becomes HEAT_COOL.
constexpr uint8_t FUJITSU_GENERAL_MODE_MASK
constexpr uint8_t FUJITSU_GENERAL_POWER_OFF
constexpr uint8_t FUJITSU_GENERAL_SWING_HORIZONTAL
constexpr uint8_t FUJITSU_GENERAL_POWER_ON
constexpr uint16_t FUJITSU_GENERAL_TRL_SPACE
constexpr uint8_t FUJITSU_GENERAL_SWING_MASK
constexpr uint8_t FUJITSU_GENERAL_MODE_HEAT
constexpr uint8_t FUJITSU_GENERAL_MESSAGE_TYPE_STATE
constexpr uint8_t FUJITSU_GENERAL_STATE_HEADER_BYTE0
constexpr uint8_t FUJITSU_GENERAL_MESSAGE_TYPE_OFF
constexpr uint32_t FUJITSU_GENERAL_CARRIER_FREQUENCY
constexpr uint8_t FUJITSU_GENERAL_FAN_NIBBLE
constexpr void set_nibble(uint8_t *message, uint8_t nibble, uint8_t value)
Write a nibble into a zero-initialised frame.
constexpr uint8_t FUJITSU_GENERAL_SWING_VERTICAL
constexpr uint8_t FUJITSU_GENERAL_TEMP_MAX
constexpr uint8_t FUJITSU_GENERAL_MODE_AUTO
constexpr uint8_t FUJITSU_GENERAL_SWING_NONE
constexpr uint8_t FUJITSU_GENERAL_COMMON_BYTE3
constexpr uint8_t FUJITSU_GENERAL_MODE_COOL
constexpr uint8_t FUJITSU_GENERAL_COMMON_LENGTH
constexpr uint8_t sum_bytes(const uint8_t *data, size_t len, uint8_t sum=0)
Add up the bytes of data with size len, truncated to 8 bits: the checksum many serial and IR protocol...
A bit is a mark (one_mark or zero_mark, both bit_mark unless set) and a space (one_space or zero_spac...