diff --git a/components/panasonic_heatpump/__init__.py b/components/panasonic_heatpump/__init__.py index 0eedacc..72dc8be 100644 --- a/components/panasonic_heatpump/__init__.py +++ b/components/panasonic_heatpump/__init__.py @@ -8,11 +8,13 @@ MULTICONF = True DEPENDENCIES = ['uart'] CONF_PANASONIC_HEATPUMP_ID = "panasonic_heatpump" -CONF_UART_HP = "uart_hp" -CONF_UART_WM = "uart_wm" +CONF_UART_HP = "uart_hp" # uart_id +CONF_UART_WM = "uart_wm" # uart_id_2 +CONF_LOG_UART_MSG = "log_uart_msg" +CONF_POLLING_TIME_SEC = "polling_time_in_sec" panasonic_heatpump_ns = cg.esphome_ns.namespace('panasonic_heatpump') -PanasonicHeatpumpComponent = panasonic_heatpump_ns.class_('PanasonicHeatpumpComponent', cg.Component) +PanasonicHeatpumpComponent = panasonic_heatpump_ns.class_('PanasonicHeatpumpComponent', cg.Component) #, uart.UARTDevice) CONFIG_SCHEMA = ( cv.Schema( @@ -21,16 +23,22 @@ CONFIG_SCHEMA = ( cv.Required(CONF_UART_HP): cv.use_id(uart.UARTComponent), cv.Required(CONF_UART_WM): cv.use_id(uart.UARTComponent), + cv.Optional(CONF_LOG_UART_MSG, default=False): cv.boolean, + cv.Optional(CONF_POLLING_TIME_SEC, default=1): cv.int_range(min=1), } - ).extend(cv.COMPONENT_SCHEMA) + ) + .extend(cv.COMPONENT_SCHEMA) + # .extend(uart.UART_DEVICE_SCHEMA) ) async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) + # await uart.register_uart_device(var, config) uart_hp = await cg.get_variable(config[CONF_UART_HP]) cg.add(var.set_uart_hp(uart_hp)) - uart_wm = await cg.get_variable(config[CONF_UART_WM]) cg.add(var.set_uart_wm(uart_wm)) + cg.add(var.set_log_uart_msg(config[CONF_LOG_UART_MSG])) + cg.add(var.set_polling_time(config[CONF_POLLING_TIME_SEC])) diff --git a/components/panasonic_heatpump/binary_sensor.py b/components/panasonic_heatpump/binary_sensor.py index 837ecfe..d9961bf 100644 --- a/components/panasonic_heatpump/binary_sensor.py +++ b/components/panasonic_heatpump/binary_sensor.py @@ -6,36 +6,54 @@ from esphome.const import ( ) from . import PanasonicHeatpumpComponent, CONF_PANASONIC_HEATPUMP_ID -CONF_BIN_SENS_TOP0 = "top0" -CONF_BIN_SENS_TOP2 = "top2" -CONF_BIN_SENS_TOP3 = "top3" -CONF_BIN_SENS_TOP13 = "top13" -CONF_BIN_SENS_TOP26 = "top26" -CONF_BIN_SENS_TOP60 = "top60" -CONF_BIN_SENS_TOP61 = "top61" -CONF_BIN_SENS_TOP68 = "top68" -CONF_BIN_SENS_TOP69 = "top69" -CONF_BIN_SENS_TOP99 = "top99" -CONF_BIN_SENS_TOP100 = "top100" -CONF_BIN_SENS_TOP108 = "top108" -CONF_BIN_SENS_TOP109 = "top109" -CONF_BIN_SENS_TOP110 = "top110" +CONF_TOP0 = "top0" +CONF_TOP2 = "top2" +CONF_TOP3 = "top3" +CONF_TOP13 = "top13" +CONF_TOP26 = "top26" +CONF_TOP60 = "top60" +CONF_TOP61 = "top61" +CONF_TOP68 = "top68" +CONF_TOP69 = "top69" +CONF_TOP99 = "top99" +CONF_TOP100 = "top100" +CONF_TOP108 = "top108" +CONF_TOP109 = "top109" +CONF_TOP110 = "top110" +CONF_TOP119 = "top119" +CONF_TOP120 = "top120" +CONF_TOP121 = "top121" +CONF_TOP122 = "top122" +CONF_TOP123 = "top123" +CONF_TOP124 = "top124" +CONF_TOP129 = "top129" +CONF_TOP132 = "top132" +CONF_TOP133 = "top133" TYPES = [ - CONF_BIN_SENS_TOP0, - CONF_BIN_SENS_TOP2, - CONF_BIN_SENS_TOP3, - CONF_BIN_SENS_TOP13, - CONF_BIN_SENS_TOP26, - CONF_BIN_SENS_TOP60, - CONF_BIN_SENS_TOP61, - CONF_BIN_SENS_TOP68, - CONF_BIN_SENS_TOP69, - CONF_BIN_SENS_TOP99, - CONF_BIN_SENS_TOP100, - CONF_BIN_SENS_TOP108, - CONF_BIN_SENS_TOP109, - CONF_BIN_SENS_TOP110, + CONF_TOP0, + CONF_TOP2, + CONF_TOP3, + CONF_TOP13, + CONF_TOP26, + CONF_TOP60, + CONF_TOP61, + CONF_TOP68, + CONF_TOP69, + CONF_TOP99, + CONF_TOP100, + CONF_TOP108, + CONF_TOP109, + CONF_TOP110, + CONF_TOP119, + CONF_TOP120, + CONF_TOP121, + CONF_TOP122, + CONF_TOP123, + CONF_TOP124, + CONF_TOP129, + CONF_TOP132, + CONF_TOP133, ] CONFIG_SCHEMA = cv.All( @@ -43,44 +61,53 @@ CONFIG_SCHEMA = cv.All( { cv.GenerateID(CONF_PANASONIC_HEATPUMP_ID): cv.use_id(PanasonicHeatpumpComponent), - cv.Optional(CONF_BIN_SENS_TOP0): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP0): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP2): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP2): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP3): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP3): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP13): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP13): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP26): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP26): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP60): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP60): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP61): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP61): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP68): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP68): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP69): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP69): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP99): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP99): binary_sensor.binary_sensor_schema( ), - cv.Optional(CONF_BIN_SENS_TOP100): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP100): binary_sensor.binary_sensor_schema( ), - cv.Optional(CONF_BIN_SENS_TOP108): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP108): binary_sensor.binary_sensor_schema( ), - cv.Optional(CONF_BIN_SENS_TOP109): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP109): binary_sensor.binary_sensor_schema( device_class = DEVICE_CLASS_RUNNING, ), - cv.Optional(CONF_BIN_SENS_TOP110): binary_sensor.binary_sensor_schema( + cv.Optional(CONF_TOP110): binary_sensor.binary_sensor_schema( ), + cv.Optional(CONF_TOP119): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP120): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP121): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP122): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP123): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP124): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP129): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP132): binary_sensor.binary_sensor_schema(), + cv.Optional(CONF_TOP133): binary_sensor.binary_sensor_schema(), } ).extend(cv.COMPONENT_SCHEMA) ) diff --git a/components/panasonic_heatpump/decode.cpp b/components/panasonic_heatpump/decode.cpp index 7eec6a1..90abd57 100644 --- a/components/panasonic_heatpump/decode.cpp +++ b/components/panasonic_heatpump/decode.cpp @@ -15,6 +15,7 @@ namespace esphome constexpr const char* const PanasonicDecode::Powerfulmode[]; constexpr const char* const PanasonicDecode::Quietmode[]; constexpr const char* const PanasonicDecode::Valve[]; + constexpr const char* const PanasonicDecode::Valve2[]; constexpr const char* const PanasonicDecode::MixingValve[]; constexpr const char* const PanasonicDecode::ZonesState[]; constexpr const char* const PanasonicDecode::HeatCoolModeDesc[]; @@ -28,57 +29,58 @@ namespace esphome // stores the bytes #129 to #138 of known models in the same order as the ModelNames above static const uint8_t KnownModels[NUMBER_OF_MODELS][10] = { - 0xE2, 0xCF, 0x0B, 0x13, 0x33, 0x32, 0xD1, 0x0C, 0x16, 0x33, //0 - 0xE2, 0xCF, 0x0B, 0x14, 0x33, 0x42, 0xD1, 0x0B, 0x17, 0x33, //1 - 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0B, 0x05, 0x11, //2 - 0xE2, 0xCF, 0x0C, 0x88, 0x05, 0x12, 0xD0, 0x0B, 0x97, 0x05, //3 - 0xE2, 0xCF, 0x0D, 0x85, 0x05, 0x12, 0xD0, 0x0C, 0x94, 0x05, //4 - 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0C, 0x95, 0x05, //5 - 0xE2, 0xCF, 0x0D, 0x87, 0x05, 0x12, 0xD0, 0x0C, 0x96, 0x05, //6 - 0xE2, 0xCE, 0x0D, 0x71, 0x81, 0x72, 0xCE, 0x0C, 0x92, 0x81, //7 - 0x62, 0xD2, 0x0B, 0x43, 0x54, 0x42, 0xD2, 0x0B, 0x72, 0x66, //8 - 0xC2, 0xD3, 0x0B, 0x33, 0x65, 0xB2, 0xD3, 0x0B, 0x94, 0x65, //9 - 0xE2, 0xCF, 0x0B, 0x15, 0x33, 0x42, 0xD1, 0x0B, 0x18, 0x33, //10 - 0xE2, 0xCF, 0x0B, 0x41, 0x34, 0x82, 0xD1, 0x0B, 0x31, 0x35, //11 - 0x62, 0xD2, 0x0B, 0x45, 0x54, 0x42, 0xD2, 0x0B, 0x47, 0x55, //12 - 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0D, 0x95, 0x05, //13 - 0xE2, 0xCF, 0x0B, 0x82, 0x05, 0x12, 0xD0, 0x0C, 0x91, 0x05, //14 - 0xE2, 0xCF, 0x0C, 0x55, 0x14, 0x12, 0xD0, 0x0B, 0x15, 0x08, //15 - 0xE2, 0xCF, 0x0C, 0x43, 0x00, 0x12, 0xD0, 0x0B, 0x15, 0x08, //16 - 0x62, 0xD2, 0x0B, 0x45, 0x54, 0x32, 0xD2, 0x0C, 0x45, 0x55, //17 - 0x62, 0xD2, 0x0B, 0x43, 0x54, 0x42, 0xD2, 0x0C, 0x46, 0x55, //18 - 0xE2, 0xCF, 0x0C, 0x54, 0x14, 0x12, 0xD0, 0x0B, 0x14, 0x08, //19 - 0xC2, 0xD3, 0x0B, 0x34, 0x65, 0xB2, 0xD3, 0x0B, 0x95, 0x65, //20 - 0xC2, 0xD3, 0x0B, 0x35, 0x65, 0xB2, 0xD3, 0x0B, 0x96, 0x65, //21 - 0x62, 0xD2, 0x0B, 0x41, 0x54, 0x32, 0xD2, 0x0C, 0x45, 0x55, //22 - 0x32, 0xD4, 0x0B, 0x87, 0x84, 0x73, 0x90, 0x0C, 0x84, 0x84, //23 - 0x32, 0xD4, 0x0B, 0x88, 0x84, 0x73, 0x90, 0x0C, 0x85, 0x84, //24 - 0xE2, 0xCF, 0x0B, 0x75, 0x09, 0x12, 0xD0, 0x0C, 0x06, 0x11, //25 - 0x42, 0xD4, 0x0B, 0x83, 0x71, 0x42, 0xD2, 0x0C, 0x46, 0x55, //26 - 0xC2, 0xD3, 0x0C, 0x34, 0x65, 0xB2, 0xD3, 0x0B, 0x95, 0x65, //27 - 0xC2, 0xD3, 0x0C, 0x33, 0x65, 0xB2, 0xD3, 0x0B, 0x94, 0x65, //28 - 0xE2, 0xCF, 0x0B, 0x83, 0x05, 0x12, 0xD0, 0x0D, 0x92, 0x05, //29 - 0xE2, 0xCF, 0x0C, 0x78, 0x09, 0x12, 0xD0, 0x0B, 0x06, 0x11, //30 - 0xC2, 0xD3, 0x0C, 0x35, 0x65, 0xB2, 0xD3, 0x0B, 0x96, 0x65, //31 - 0x32, 0xD4, 0x0B, 0x99, 0x77, 0x62, 0x90, 0x0B, 0x01, 0x78, //32 - 0x42, 0xD4, 0x0B, 0x15, 0x76, 0x12, 0xD0, 0x0B, 0x10, 0x11, //33 - 0xE2, 0xD5, 0x0C, 0x29, 0x99, 0x83, 0x92, 0x0C, 0x28, 0x98, //34 - 0xE2, 0xCF, 0x0D, 0x85, 0x05, 0x12, 0xD0, 0x0E, 0x94, 0x05, //35 - 0xE2, 0xD5, 0x0D, 0x36, 0x99, 0x02, 0xD6, 0x0F, 0x67, 0x95, //36 - 0xE2, 0xD5, 0x0B, 0x08, 0x95, 0x02, 0xD6, 0x0E, 0x66, 0x95, //37 - 0xE2, 0xD5, 0x0B, 0x34, 0x99, 0x83, 0x92, 0x0C, 0x29, 0x98, //38 - 0xE2, 0xCF, 0x0C, 0x89, 0x05, 0x12, 0xD0, 0x0C, 0x98, 0x05, //39 - 0xE2, 0xD5, 0x0B, 0x08, 0x95, 0x02, 0xD6, 0x0E, 0x67, 0x95, //40 - 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0C, 0x96, 0x05, //41 - 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0E, 0x95, 0x05, //42 - 0x32, 0xD4, 0x0B, 0x89, 0x84, 0x73, 0x90, 0x0C, 0x86, 0x84, //43 - 0x32, 0xD4, 0x0B, 0x00, 0x78, 0x62, 0x90, 0x0B, 0x02, 0x78, //44 - 0xE2, 0xCF, 0x0B, 0x82, 0x05, 0x12, 0xD0, 0x0D, 0x91, 0x05, //45 - 0xE2, 0xD5, 0x0D, 0x99, 0x94, 0x02, 0xD6, 0x0D, 0x68, 0x95, //46 - 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0C, 0x95, 0x05, //47 - 0xE2, 0xD5, 0x0B, 0x34, 0x99, 0x83, 0x92, 0x0C, 0x28, 0x98, //48 - 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0C, 0x05, 0x11, //49 - 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0E, 0x95, 0x05, //50 + 0xE2, 0xCF, 0x0B, 0x13, 0x33, 0x32, 0xD1, 0x0C, 0x16, 0x33, // 0 + 0xE2, 0xCF, 0x0B, 0x14, 0x33, 0x42, 0xD1, 0x0B, 0x17, 0x33, // 1 + 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0B, 0x05, 0x11, // 2 + 0xE2, 0xCF, 0x0C, 0x88, 0x05, 0x12, 0xD0, 0x0B, 0x97, 0x05, // 3 + 0xE2, 0xCF, 0x0D, 0x85, 0x05, 0x12, 0xD0, 0x0C, 0x94, 0x05, // 4 + 0xE2, 0xCF, 0x0D, 0x86, 0x05, 0x12, 0xD0, 0x0C, 0x95, 0x05, // 5 + 0xE2, 0xCF, 0x0D, 0x87, 0x05, 0x12, 0xD0, 0x0C, 0x96, 0x05, // 6 + 0xE2, 0xCE, 0x0D, 0x71, 0x81, 0x72, 0xCE, 0x0C, 0x92, 0x81, // 7 + 0x62, 0xD2, 0x0B, 0x43, 0x54, 0x42, 0xD2, 0x0B, 0x72, 0x66, // 8 + 0xC2, 0xD3, 0x0B, 0x33, 0x65, 0xB2, 0xD3, 0x0B, 0x94, 0x65, // 9 + 0xE2, 0xCF, 0x0B, 0x15, 0x33, 0x42, 0xD1, 0x0B, 0x18, 0x33, // 10 + 0xE2, 0xCF, 0x0B, 0x41, 0x34, 0x82, 0xD1, 0x0B, 0x31, 0x35, // 11 + 0x62, 0xD2, 0x0B, 0x45, 0x54, 0x42, 0xD2, 0x0B, 0x47, 0x55, // 12 + 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0D, 0x95, 0x05, // 13 + 0xE2, 0xCF, 0x0B, 0x82, 0x05, 0x12, 0xD0, 0x0C, 0x91, 0x05, // 14 + 0xE2, 0xCF, 0x0C, 0x55, 0x14, 0x12, 0xD0, 0x0B, 0x15, 0x08, // 15 + 0xE2, 0xCF, 0x0C, 0x43, 0x00, 0x12, 0xD0, 0x0B, 0x15, 0x08, // 16 + 0x62, 0xD2, 0x0B, 0x45, 0x54, 0x32, 0xD2, 0x0C, 0x45, 0x55, // 17 + 0x62, 0xD2, 0x0B, 0x43, 0x54, 0x42, 0xD2, 0x0C, 0x46, 0x55, // 18 + 0xE2, 0xCF, 0x0C, 0x54, 0x14, 0x12, 0xD0, 0x0B, 0x14, 0x08, // 19 + 0xC2, 0xD3, 0x0B, 0x34, 0x65, 0xB2, 0xD3, 0x0B, 0x95, 0x65, // 20 + 0xC2, 0xD3, 0x0B, 0x35, 0x65, 0xB2, 0xD3, 0x0B, 0x96, 0x65, // 21 + 0x62, 0xD2, 0x0B, 0x41, 0x54, 0x32, 0xD2, 0x0C, 0x45, 0x55, // 22 + 0x32, 0xD4, 0x0B, 0x87, 0x84, 0x73, 0x90, 0x0C, 0x84, 0x84, // 23 + 0x32, 0xD4, 0x0B, 0x88, 0x84, 0x73, 0x90, 0x0C, 0x85, 0x84, // 24 + 0xE2, 0xCF, 0x0B, 0x75, 0x09, 0x12, 0xD0, 0x0C, 0x06, 0x11, // 25 + 0x42, 0xD4, 0x0B, 0x83, 0x71, 0x42, 0xD2, 0x0C, 0x46, 0x55, // 26 + 0xC2, 0xD3, 0x0C, 0x34, 0x65, 0xB2, 0xD3, 0x0B, 0x95, 0x65, // 27 + 0xC2, 0xD3, 0x0C, 0x33, 0x65, 0xB2, 0xD3, 0x0B, 0x94, 0x65, // 28 + 0xE2, 0xCF, 0x0B, 0x83, 0x05, 0x12, 0xD0, 0x0D, 0x92, 0x05, // 29 + 0xE2, 0xCF, 0x0C, 0x78, 0x09, 0x12, 0xD0, 0x0B, 0x06, 0x11, // 30 + 0xC2, 0xD3, 0x0C, 0x35, 0x65, 0xB2, 0xD3, 0x0B, 0x96, 0x65, // 31 + 0x32, 0xD4, 0x0B, 0x99, 0x77, 0x62, 0x90, 0x0B, 0x01, 0x78, // 32 + 0x42, 0xD4, 0x0B, 0x15, 0x76, 0x12, 0xD0, 0x0B, 0x10, 0x11, // 33 + 0xE2, 0xD5, 0x0C, 0x29, 0x99, 0x83, 0x92, 0x0C, 0x28, 0x98, // 34 + 0xE2, 0xCF, 0x0D, 0x85, 0x05, 0x12, 0xD0, 0x0E, 0x94, 0x05, // 35 + 0xE2, 0xD5, 0x0D, 0x36, 0x99, 0x02, 0xD6, 0x0F, 0x67, 0x95, // 36 + 0xE2, 0xD5, 0x0B, 0x08, 0x95, 0x02, 0xD6, 0x0E, 0x66, 0x95, // 37 + 0xE2, 0xD5, 0x0B, 0x34, 0x99, 0x83, 0x92, 0x0C, 0x29, 0x98, // 38 + 0xE2, 0xCF, 0x0C, 0x89, 0x05, 0x12, 0xD0, 0x0C, 0x98, 0x05, // 39 + 0xE2, 0xD5, 0x0B, 0x08, 0x95, 0x02, 0xD6, 0x0E, 0x67, 0x95, // 40 + 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0C, 0x96, 0x05, // 41 + 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0E, 0x95, 0x05, // 42 + 0x32, 0xD4, 0x0B, 0x89, 0x84, 0x73, 0x90, 0x0C, 0x86, 0x84, // 43 + 0x32, 0xD4, 0x0B, 0x00, 0x78, 0x62, 0x90, 0x0B, 0x02, 0x78, // 44 + 0xE2, 0xCF, 0x0B, 0x82, 0x05, 0x12, 0xD0, 0x0D, 0x91, 0x05, // 45 + 0xE2, 0xD5, 0x0D, 0x99, 0x94, 0x02, 0xD6, 0x0D, 0x68, 0x95, // 46 + 0xE2, 0xCF, 0x0C, 0x74, 0x09, 0x12, 0xD0, 0x0C, 0x95, 0x05, // 47 + 0xE2, 0xD5, 0x0B, 0x34, 0x99, 0x83, 0x92, 0x0C, 0x28, 0x98, // 48 + 0xE2, 0xCF, 0x0D, 0x77, 0x09, 0x12, 0xD0, 0x0C, 0x05, 0x11, // 49 + 0xE2, 0xD5, 0x0C, 0x67, 0x00, 0x83, 0x92, 0x0C, 0x27, 0x98, // 51 + 0xE2, 0xD5, 0x0B, 0x34, 0x99, 0x83, 0x92, 0x0C, 0x27, 0x98, // 52 }; int PanasonicDecode::getBit1(uint8_t input) @@ -175,6 +177,11 @@ namespace esphome uint16_t value = static_cast((input2 << 8) | input1); return (value - 1); } + + float PanasonicDecode::getValvePID(uint8_t input) + { + return (((float)input - 1) / 2); + } // TOP15, TOP16, TOP38, TOP39, TOP40, TOP41 // int PanasonicDecode::getPower(uint8_t input) diff --git a/components/panasonic_heatpump/decode.h b/components/panasonic_heatpump/decode.h index d9d7887..d54053b 100644 --- a/components/panasonic_heatpump/decode.h +++ b/components/panasonic_heatpump/decode.h @@ -3,7 +3,7 @@ #include #include -#define NUMBER_OF_MODELS 51 +#define NUMBER_OF_MODELS 53 namespace esphome @@ -34,6 +34,7 @@ namespace esphome static int getWord(uint8_t hi, uint8_t low); static int getUintt16(uint8_t input1, uint8_t input2); + static float getValvePID(uint8_t input); static int getPower(uint8_t input); static int getOpMode(uint8_t input); static int getModel(std::vector& data, uint8_t index); @@ -55,68 +56,70 @@ namespace esphome static const constexpr char* const Powerfulmode[] = {"4", "Off", "30min", "60min", "90min"}; static const constexpr char* const Quietmode[] = {"4", "Off", "Level 1", "Level 2", "Level 3"}; static const constexpr char* const Valve[] = {"2", "Room", "DHW"}; - static const constexpr char* const MixingValve[] = {"4", "Off", "Increase","Nothing","Decrease"}; + static const constexpr char* const Valve2[] = {"2", "Cool", "Heat"}; + static const constexpr char* const MixingValve[] = {"4", "Off", "Decrease","Increase", "Invalid"}; static const constexpr char* const ZonesState[] = {"3", "Zone1 active", "Zone2 active", "Zone1 and zone2 active"}; static const constexpr char* const HeatCoolModeDesc[] = {"2", "Comp. Curve", "Direct"}; static const constexpr char* const SolarModeDesc[] = {"3", "Disabled", "Buffer", "DHW"}; static const constexpr char* const ZonesSensorType[] = {"4", "Water Temperature", "External Thermostat", "Internal Thermostat", "Thermistor"}; static const constexpr char* const LiquidType[] = {"2", "Water", "Glycol"}; - static const constexpr char* const ExtPadHeaterType[] = {"3", "Disabled", "Type-A","Type-B"}; - static const constexpr char* const Bivalent[] = {"6", "Off", "Alternativ", "A-Off", "Parallel", "P-Off", "Parallel Advanced"}; + static const constexpr char* const ExtPadHeaterType[] = {"3", "Disabled", "Type-A", "Type-B"}; + static const constexpr char* const Bivalent[] = {"3", "Alternative", "Parallel", "Advanced Parallel"}; static const constexpr char* const ModelNames[] = { - "51", //string representation of number of known models (last model number + 1) - "WH-MDC05H3E5", //0 - "WH-MDC07H3E5", //1 - "IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", //2 - "IDU:WH-SDC09H3E8, ODU:WH-UD09HE8", //3 - "IDU:WH-SXC09H3E8, ODU:WH-UX09HE8", //4 - "IDU:WH-SXC12H9E8, ODU:WH-UX12HE8", //5 - "IDU:WH-SXC16H9E8, ODU:WH-UX16HE8", //6 - "IDU:WH-SDC05H3E5, ODU:WH-UD05HE5", //7 - "IDU:WH-SDC0709J3E5, ODU:WH-UD09JE5", //8 - "WH-MDC05J3E5", //9 - "WH-MDC09H3E5", //10 - "WH-MXC09H3E5", //11 - "IDU:WH-ADC0309J3E5, ODU:WH-UD09JE5", //12 - "IDU:WH-ADC0916H9E8, ODU:WH-UX12HE8", //13 - "IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", //14 - "IDU:WH-SDC09H3E5, ODU:WH-UD09HE5", //15 - "IDU:WH-ADC0309H3E5, ODU:WH-UD09HE5", //16 - "IDU:WH-ADC0309J3E5, ODU:WH-UD05JE5", //17 - "IDU:WH-SDC0709J3E5, ODU:WH-UD07JE5", //18 - "IDU:WH-SDC07H3E5-1, ODU:WH-UD07HE5-1", //19 - "WH-MDC07J3E5", //20 - "WH-MDC09J3E5", //21 - "IDU:WH-SDC0305J3E5, ODU:WH-UD05JE5", //22 - "WH-MXC09J3E8", //23 - "WH-MXC12J9E8", //24 - "IDU:WH-ADC1216H6E5, ODU:WH-UD12HE5", //25 - "IDU:WH-ADC0309J3E5C, ODU:WH-UD07JE5", //26 - "WH-MDC07J3E5", //27 - "WH-MDC05J3E5", //28 - "IDU:WH-UQ12HE8, ODU:WH-SQC12H9E8", //29 - "IDU:WH-SXC12H6E5, ODU:WH-UX12HE5", //30 - "WH-MDC09J3E5", //31 - "WH-MXC09J3E5", //32 - "IDU:WH-ADC1216H6E5C ODU:WH-UD12HE5", //33 - "IDU:WH-ADC0509L3E5 ODU:WH-WDG07LE5", //34 - "IDU:WH-SXC09H3E8 ODU:WH-UX09HE8", //35 - "IDU:WH-ADC0309K3E5AN ODU:WH-UDZ07KE5", //36 - "IDU:WH-SDC0309K3E5 ODU:WH-UDZ05KE5", //37 - "IDU:WH-SDC0509L3E5 ODU:WH-WDG09LE5", //38 - "IDU:WH-SDC12H9E8 ODU:WH-UD12HE8", //39 - "IDU:WH-SDC0309K3E5, ODU:WH-UDZ07KE5", //40 - "IDU:WH-ADC0916H9E8, ODU:WH-UX16HE8", //41 - "IDU:WH-ADC0912H9E8, ODU:WH-UX12HE8", //42 - "WH-MXC16J9E8", //43 - "WH-MXC12J6E5", //44 - "IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", //45 - "IDU:WH-ADC0309K3E5 ODU:WH-UDZ09KE5", //46 - "IDU:WH-ADC0916H9E8, ODU:WH-UX12HE8", //47 - "IDU:WH-SDC0509L3E5 ODU:WH-WDG07LE5", //48 - "IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", //49 - "IDU:WH-SXC12H9E8, ODU:WH-UX12HE8", //50 + "53", //string representation of number of known models (last model number + 1) + "WH-MDC05H3E5", // 0 + "WH-MDC07H3E5", // 1 + "IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", // 2 + "IDU:WH-SDC09H3E8, ODU:WH-UD09HE8", // 3 + "IDU:WH-SXC09H3E8, ODU:WH-UX09HE8", // 4 + "IDU:WH-SXC12H9E8, ODU:WH-UX12HE8", // 5 + "IDU:WH-SXC16H9E8, ODU:WH-UX16HE8", // 6 + "IDU:WH-SDC05H3E5, ODU:WH-UD05HE5", // 7 + "IDU:WH-SDC0709J3E5, ODU:WH-UD09JE5", // 8 + "WH-MDC05J3E5", // 9 + "WH-MDC09H3E5", // 10 + "WH-MXC09H3E5", // 11 + "IDU:WH-ADC0309J3E5, ODU:WH-UD09JE5", // 12 + "IDU:WH-ADC0916H9E8, ODU:WH-UX12HE8", // 13 + "IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", // 14 + "IDU:WH-SDC09H3E5, ODU:WH-UD09HE5", // 15 + "IDU:WH-ADC0309H3E5, ODU:WH-UD09HE5", // 16 + "IDU:WH-ADC0309J3E5, ODU:WH-UD05JE5", // 17 + "IDU:WH-SDC0709J3E5, ODU:WH-UD07JE5", // 18 + "IDU:WH-SDC07H3E5-1, ODU:WH-UD07HE5-1", // 19 + "WH-MDC07J3E5", // 20 + "WH-MDC09J3E5", // 21 + "IDU:WH-SDC0305J3E5, ODU:WH-UD05JE5", // 22 + "WH-MXC09J3E8", // 23 + "WH-MXC12J9E8", // 24 + "IDU:WH-ADC1216H6E5, ODU:WH-UD12HE5", // 25 + "IDU:WH-ADC0309J3E5C, ODU:WH-UD07JE5", // 26 + "WH-MDC07J3E5", // 27 + "WH-MDC05J3E5", // 28 + "IDU:WH-SQC12H9E8, ODU:WH-UQ12HE8", // 29 + "IDU:WH-SXC12H6E5, ODU:WH-UX12HE5", // 30 + "WH-MDC09J3E5", // 31 + "WH-MXC09J3E5", // 32 + "IDU:WH-ADC1216H6E5C, ODU:WH-UD12HE5", // 33 + "IDU:WH-ADC0509L3E5, ODU:WH-WDG07LE5", // 34 + "IDU:WH-SXC09H3E8, ODU:WH-UX09HE8", // 35 + "IDU:WH-ADC0309K3E5AN, ODU:WH-UDZ07KE5", // 36 + "IDU:WH-SDC0309K3E5, ODU:WH-UDZ05KE5", // 37 + "IDU:WH-SDC0509L3E5, ODU:WH-WDG09LE5", // 38 + "IDU:WH-SDC12H9E8, ODU:WH-UD12HE8", // 39 + "IDU:WH-SDC0309K3E5, ODU:WH-UDZ07KE5", // 40 + "IDU:WH-ADC0916H9E8, ODU:WH-UX16HE8", // 41 + "IDU:WH-ADC0912H9E8, ODU:WH-UX12HE8", // 42 + "WH-MXC16J9E8", // 43 + "WH-MXC12J6E5", // 44 + "IDU:WH-SQC09H3E8, ODU:WH-UQ09HE8", // 45 + "IDU:WH-ADC0309K3E5, ODU:WH-UDZ09KE5", // 46 + "IDU:WH-ADC0916H9E8, ODU:WH-UX12HE8", // 47 + "IDU:WH-SDC0509L3E5, ODU:WH-WDG07LE5", // 48 + "IDU:WH-SXC09H3E5, ODU:WH-UX09HE5", // 49 + "IDU:WH-ADC0509L3E5AN, ODU:WH-WDG05LE5", // 51 + "IDU:WH-SDC0509L3E5, ODU:WH-WDG05LE5", // 52 }; }; } // namespace panasonic_heatpump diff --git a/components/panasonic_heatpump/panasonic_heatpump.cpp b/components/panasonic_heatpump/panasonic_heatpump.cpp index 08f75a2..62ed92b 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.cpp +++ b/components/panasonic_heatpump/panasonic_heatpump.cpp @@ -101,13 +101,14 @@ namespace esphome LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top116_sensor_); LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top117_sensor_); LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top118_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top119_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top120_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top121_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top122_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top123_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top125_sensor_); - LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top126_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top127_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top128_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top131_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top134_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top135_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top136_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top137_sensor_); + LOG_SENSOR("", "Panasonic Heatpump Sensor", this->top138_sensor_); #endif #ifdef USE_BINARY_SENSOR LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top0_binary_sensor_); @@ -124,6 +125,15 @@ namespace esphome LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top108_binary_sensor_); LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top109_binary_sensor_); LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top110_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top119_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top120_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top121_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top122_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top123_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top124_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top129_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top132_binary_sensor_); + LOG_BINARY_SENSOR("", "Panasonic Heatpump BinarySensor", this->top133_binary_sensor_); #endif #ifdef USE_TEXT_SENSOR LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top4_text_sensor_); @@ -144,7 +154,9 @@ namespace esphome LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top111_text_sensor_); LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top112_text_sensor_); LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top114_text_sensor_); - LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top124_text_sensor_); + LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top125_text_sensor_); + LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top126_text_sensor_); + LOG_TEXT_SENSOR("", "Panasonic Heatpump TextSensor", this->top130_text_sensor_); #endif #ifdef USE_BUTTON LOG_BUTTON("", "Panasonic Heatpump Button", this->reset_button_); @@ -294,6 +306,32 @@ namespace esphome } } + void PanasonicHeatpumpComponent::log_uart_hex(std::string prefix, std::vector bytes, uint8_t separator) + { + if (this->log_uart_msg_ == false) return; + + std::string logStr; + logStr = "[" + std::to_string(bytes.size()) + "]"; + ESP_LOGI(TAG, "%s %s", prefix.c_str(), logStr.c_str()); + delay(10); + + logStr = ""; + char buffer[5]; + for (size_t i = 0; i < bytes.size(); i++) + { + if (i > 0) logStr += separator; + sprintf(buffer, "%02X", bytes[i]); + logStr += buffer; + } + + size_t chunkSize = 90; + for (size_t i = 0; i < logStr.length(); i += chunkSize) + { + ESP_LOGI(TAG, "%s %s", prefix.c_str(), logStr.substr(i, chunkSize).c_str()); + delay(10); + } + } + void PanasonicHeatpumpComponent::decode_response(std::vector bytes) { // Read response message: @@ -409,13 +447,14 @@ namespace esphome if (this->top116_sensor_) this->top116_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[126])); if (this->top117_sensor_) this->top117_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[127])); if (this->top118_sensor_) this->top118_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[128])); - if (this->top119_sensor_) this->top119_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[65])); - if (this->top120_sensor_) this->top120_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[66])); - if (this->top121_sensor_) this->top121_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[68])); - if (this->top122_sensor_) this->top122_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[67])); - if (this->top123_sensor_) this->top123_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[69])); - if (this->top125_sensor_) this->top125_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[177])); - if (this->top126_sensor_) this->top126_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[178])); + if (this->top127_sensor_) this->top127_sensor_->publish_state(PanasonicDecode::getValvePID(bytes[177])); + if (this->top128_sensor_) this->top128_sensor_->publish_state(PanasonicDecode::getValvePID(bytes[178])); + if (this->top131_sensor_) this->top131_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[65])); + if (this->top134_sensor_) this->top134_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[66])); + if (this->top135_sensor_) this->top135_sensor_->publish_state(PanasonicDecode::getIntMinus128(bytes[68])); + if (this->top136_sensor_) this->top136_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[67])); + if (this->top137_sensor_) this->top137_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[69])); + if (this->top138_sensor_) this->top138_sensor_->publish_state(PanasonicDecode::getIntMinus1(bytes[70])); #endif #ifdef USE_BINARY_SENSOR if (this->top0_binary_sensor_) this->top0_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit7and8(bytes[4]))); @@ -432,6 +471,15 @@ namespace esphome if (this->top108_binary_sensor_) this->top108_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit3and4(bytes[20]))); if (this->top109_binary_sensor_) this->top109_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit5and6(bytes[20]))); if (this->top110_binary_sensor_) this->top110_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit7and8(bytes[20]))); + if (this->top119_binary_sensor_) this->top119_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit7and8(bytes[23]))); + if (this->top120_binary_sensor_) this->top120_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit5and6(bytes[23]))); + if (this->top121_binary_sensor_) this->top121_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit3and4(bytes[23]))); + if (this->top122_binary_sensor_) this->top122_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit1and2(bytes[23]))); + if (this->top123_binary_sensor_) this->top123_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit1and2(bytes[116]))); + if (this->top124_binary_sensor_) this->top124_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit3and4(bytes[116]))); + if (this->top129_binary_sensor_) this->top129_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit7and8(bytes[26]))); + if (this->top132_binary_sensor_) this->top132_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit3and4(bytes[26]))); + if (this->top133_binary_sensor_) this->top133_binary_sensor_->publish_state(PanasonicDecode::getBoolState(PanasonicDecode::getBit1and2(bytes[26]))); #endif #ifdef USE_TEXT_SENSOR if (this->top4_text_sensor_) this->top4_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::OpModeDesc, PanasonicDecode::getOpMode(bytes[6]))); @@ -452,7 +500,9 @@ namespace esphome if (this->top111_text_sensor_) this->top111_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::ZonesSensorType, PanasonicDecode::getSecondByte(bytes[22]))); if (this->top112_text_sensor_) this->top112_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::ZonesSensorType, PanasonicDecode::getFirstByte(bytes[22]))); if (this->top114_text_sensor_) this->top114_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::ExtPadHeaterType, PanasonicDecode::getBit3and4(bytes[25]))); - if (this->top124_text_sensor_) this->top124_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::Bivalent, PanasonicDecode::getBivalent(bytes[26]))); + if (this->top125_text_sensor_) this->top125_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::Valve2, PanasonicDecode::getBit5and6(bytes[116]))); + if (this->top126_text_sensor_) this->top126_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::Valve, PanasonicDecode::getBit7and8(bytes[116]))); + if (this->top130_text_sensor_) this->top130_text_sensor_->publish_state(PanasonicDecode::getTextState(PanasonicDecode::Bivalent, PanasonicDecode::getBit5and6(bytes[26]))); #endif } @@ -488,30 +538,6 @@ namespace esphome delay(100); // NOLINT } - void PanasonicHeatpumpComponent::log_uart_hex(std::string prefix, std::vector bytes, uint8_t separator) - { - std::string logStr; - logStr = "[" + std::to_string(bytes.size()) + "]"; - ESP_LOGD(TAG, "%s %s", prefix.c_str(), logStr.c_str()); - delay(10); - - logStr = ""; - char buffer[5]; - for (size_t i = 0; i < bytes.size(); i++) - { - if (i > 0) logStr += separator; - sprintf(buffer, "%02X", bytes[i]); - logStr += buffer; - } - - size_t chunkSize = 90; - for (size_t i = 0; i < logStr.length(); i += chunkSize) - { - ESP_LOGD(TAG, "%s %s", prefix.c_str(), logStr.substr(i, chunkSize).c_str()); - delay(10); - } - } - #ifdef USE_BUTTON void PanasonicHeatpumpComponent::button_press_action(button::Button* object) { diff --git a/components/panasonic_heatpump/panasonic_heatpump.h b/components/panasonic_heatpump/panasonic_heatpump.h index 63e86df..fd4eb6c 100644 --- a/components/panasonic_heatpump/panasonic_heatpump.h +++ b/components/panasonic_heatpump/panasonic_heatpump.h @@ -126,13 +126,14 @@ namespace esphome SUB_SENSOR(top116); SUB_SENSOR(top117); SUB_SENSOR(top118); - SUB_SENSOR(top119); - SUB_SENSOR(top120); - SUB_SENSOR(top121); - SUB_SENSOR(top122); - SUB_SENSOR(top123); - SUB_SENSOR(top125); - SUB_SENSOR(top126); + SUB_SENSOR(top127); + SUB_SENSOR(top128); + SUB_SENSOR(top131); + SUB_SENSOR(top134); + SUB_SENSOR(top135); + SUB_SENSOR(top136); + SUB_SENSOR(top137); + SUB_SENSOR(top138); #endif #ifdef USE_BINARY_SENSOR SUB_BINARY_SENSOR(top0); @@ -149,6 +150,15 @@ namespace esphome SUB_BINARY_SENSOR(top108); SUB_BINARY_SENSOR(top109); SUB_BINARY_SENSOR(top110); + SUB_BINARY_SENSOR(top119); + SUB_BINARY_SENSOR(top120); + SUB_BINARY_SENSOR(top121); + SUB_BINARY_SENSOR(top122); + SUB_BINARY_SENSOR(top123); + SUB_BINARY_SENSOR(top124); + SUB_BINARY_SENSOR(top129); + SUB_BINARY_SENSOR(top132); + SUB_BINARY_SENSOR(top133); #endif #ifdef USE_TEXT_SENSOR SUB_TEXT_SENSOR(top4); @@ -169,10 +179,14 @@ namespace esphome SUB_TEXT_SENSOR(top111); SUB_TEXT_SENSOR(top112); SUB_TEXT_SENSOR(top114); - SUB_TEXT_SENSOR(top124); + SUB_TEXT_SENSOR(top125); + SUB_TEXT_SENSOR(top126); + SUB_TEXT_SENSOR(top130); #endif #ifdef USE_BUTTON SUB_BUTTON(reset); + + void button_press_action(button::Button* object); #endif #ifdef USE_NUMBER SUB_NUMBER(z1_heat_request_temperature); @@ -207,6 +221,8 @@ namespace esphome SUB_NUMBER(heatingoffoutdoortemp); SUB_NUMBER(bivalent_start_temperature); SUB_NUMBER(bivalent_stop_temperature); + + void number_control(number::Number* object, float value); #endif #ifdef USE_SELECT SUB_SELECT(quiet_mode); @@ -216,6 +232,8 @@ namespace esphome SUB_SELECT(external_pad_heater); SUB_SELECT(powerful_mode2); SUB_SELECT(bivalent_mode); + + void select_control(select::Select* object, const std::string &value); #endif #ifdef USE_SWITCH SUB_SWITCH(heatpump_state); @@ -227,6 +245,8 @@ namespace esphome SUB_SWITCH(main_schedule); SUB_SWITCH(alt_external_sensor); SUB_SWITCH(buffer); + + void switch_control(switch::Switch* object, bool state); #endif PanasonicHeatpumpComponent() = default; @@ -236,23 +256,14 @@ namespace esphome void set_uart_hp(uart::UARTComponent *uart) { this->uart_hp_ = uart; } void set_uart_wm(uart::UARTComponent *uart) { this->uart_wm_ = uart; } - -#ifdef USE_BUTTON - void button_press_action(button::Button* object); -#endif -#ifdef USE_NUMBER - void number_control(number::Number* object, float value); -#endif -#ifdef USE_SELECT - void select_control(select::Select* object, const std::string &value); -#endif -#ifdef USE_SWITCH - void switch_control(switch::Switch* object, bool state); -#endif + void set_log_uart_msg(bool enable) { this->log_uart_msg_ = enable; } + void set_polling_time(uint32_t time_sec) { this->polling_time_ = time_sec; } protected: uart::UARTComponent *uart_hp_; uart::UARTComponent *uart_wm_; + bool log_uart_msg_{false}; + uint32_t polling_time_{1}; std::vector response_message_; std::vector request_message_; diff --git a/components/panasonic_heatpump/sensor.py b/components/panasonic_heatpump/sensor.py index 37c16d7..002f680 100644 --- a/components/panasonic_heatpump/sensor.py +++ b/components/panasonic_heatpump/sensor.py @@ -10,6 +10,7 @@ from esphome.const import ( UNIT_MINUTE, UNIT_WATT, UNIT_EMPTY, + UNIT_PERCENT, DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_DURATION, DEVICE_CLASS_FREQUENCY, @@ -30,196 +31,198 @@ UNIT_BAR = "bar" ICON_FAN_SPEED = "mdi:fan" -CONF_SENS_TOP1 = "top1" -CONF_SENS_TOP5 = "top5" -CONF_SENS_TOP6 = "top6" -CONF_SENS_TOP7 = "top7" -CONF_SENS_TOP8 = "top8" -CONF_SENS_TOP9 = "top9" -CONF_SENS_TOP10 = "top10" -CONF_SENS_TOP11 = "top11" -CONF_SENS_TOP12 = "top12" -CONF_SENS_TOP14 = "top14" -CONF_SENS_TOP15 = "top15" -CONF_SENS_TOP16 = "top16" -CONF_SENS_TOP21 = "top21" -CONF_SENS_TOP22 = "top22" -CONF_SENS_TOP23 = "top23" -CONF_SENS_TOP24 = "top24" -CONF_SENS_TOP25 = "top25" -CONF_SENS_TOP27 = "top27" -CONF_SENS_TOP28 = "top28" -CONF_SENS_TOP29 = "top29" -CONF_SENS_TOP30 = "top30" -CONF_SENS_TOP31 = "top31" -CONF_SENS_TOP32 = "top32" -CONF_SENS_TOP33 = "top33" -CONF_SENS_TOP34 = "top34" -CONF_SENS_TOP35 = "top35" -CONF_SENS_TOP36 = "top36" -CONF_SENS_TOP37 = "top37" -CONF_SENS_TOP38 = "top38" -CONF_SENS_TOP39 = "top39" -CONF_SENS_TOP40 = "top40" -CONF_SENS_TOP41 = "top41" -CONF_SENS_TOP42 = "top42" -CONF_SENS_TOP43 = "top43" -CONF_SENS_TOP45 = "top45" -CONF_SENS_TOP46 = "top46" -CONF_SENS_TOP47 = "top47" -CONF_SENS_TOP48 = "top48" -CONF_SENS_TOP49 = "top49" -CONF_SENS_TOP50 = "top50" -CONF_SENS_TOP51 = "top51" -CONF_SENS_TOP52 = "top52" -CONF_SENS_TOP53 = "top53" -CONF_SENS_TOP54 = "top54" -CONF_SENS_TOP55 = "top55" -CONF_SENS_TOP56 = "top56" -CONF_SENS_TOP57 = "top57" -CONF_SENS_TOP62 = "top62" -CONF_SENS_TOP63 = "top63" -CONF_SENS_TOP64 = "top64" -CONF_SENS_TOP65 = "top65" -CONF_SENS_TOP66 = "top66" -CONF_SENS_TOP67 = "top67" -CONF_SENS_TOP70 = "top70" -CONF_SENS_TOP71 = "top71" -CONF_SENS_TOP72 = "top72" -CONF_SENS_TOP73 = "top73" -CONF_SENS_TOP74 = "top74" -CONF_SENS_TOP75 = "top75" -CONF_SENS_TOP77 = "top77" -CONF_SENS_TOP78 = "top78" -CONF_SENS_TOP79 = "top79" -CONF_SENS_TOP80 = "top80" -CONF_SENS_TOP82 = "top82" -CONF_SENS_TOP83 = "top83" -CONF_SENS_TOP84 = "top84" -CONF_SENS_TOP85 = "top85" -CONF_SENS_TOP86 = "top86" -CONF_SENS_TOP87 = "top87" -CONF_SENS_TOP88 = "top88" -CONF_SENS_TOP89 = "top89" -CONF_SENS_TOP90 = "top90" -CONF_SENS_TOP91 = "top91" -CONF_SENS_TOP93 = "top93" -CONF_SENS_TOP95 = "top95" -CONF_SENS_TOP96 = "top96" -CONF_SENS_TOP97 = "top97" -CONF_SENS_TOP98 = "top98" -CONF_SENS_TOP102 = "top102" -CONF_SENS_TOP103 = "top103" -CONF_SENS_TOP104 = "top104" -CONF_SENS_TOP105 = "top105" -CONF_SENS_TOP113 = "top113" -CONF_SENS_TOP115 = "top115" -CONF_SENS_TOP116 = "top116" -CONF_SENS_TOP117 = "top117" -CONF_SENS_TOP118 = "top118" -CONF_SENS_TOP119 = "top119" -CONF_SENS_TOP120 = "top120" -CONF_SENS_TOP121 = "top121" -CONF_SENS_TOP122 = "top122" -CONF_SENS_TOP123 = "top123" -CONF_SENS_TOP125 = "top125" -CONF_SENS_TOP126 = "top126" +CONF_TOP1 = "top1" +CONF_TOP5 = "top5" +CONF_TOP6 = "top6" +CONF_TOP7 = "top7" +CONF_TOP8 = "top8" +CONF_TOP9 = "top9" +CONF_TOP10 = "top10" +CONF_TOP11 = "top11" +CONF_TOP12 = "top12" +CONF_TOP14 = "top14" +CONF_TOP15 = "top15" +CONF_TOP16 = "top16" +CONF_TOP21 = "top21" +CONF_TOP22 = "top22" +CONF_TOP23 = "top23" +CONF_TOP24 = "top24" +CONF_TOP25 = "top25" +CONF_TOP27 = "top27" +CONF_TOP28 = "top28" +CONF_TOP29 = "top29" +CONF_TOP30 = "top30" +CONF_TOP31 = "top31" +CONF_TOP32 = "top32" +CONF_TOP33 = "top33" +CONF_TOP34 = "top34" +CONF_TOP35 = "top35" +CONF_TOP36 = "top36" +CONF_TOP37 = "top37" +CONF_TOP38 = "top38" +CONF_TOP39 = "top39" +CONF_TOP40 = "top40" +CONF_TOP41 = "top41" +CONF_TOP42 = "top42" +CONF_TOP43 = "top43" +CONF_TOP45 = "top45" +CONF_TOP46 = "top46" +CONF_TOP47 = "top47" +CONF_TOP48 = "top48" +CONF_TOP49 = "top49" +CONF_TOP50 = "top50" +CONF_TOP51 = "top51" +CONF_TOP52 = "top52" +CONF_TOP53 = "top53" +CONF_TOP54 = "top54" +CONF_TOP55 = "top55" +CONF_TOP56 = "top56" +CONF_TOP57 = "top57" +CONF_TOP62 = "top62" +CONF_TOP63 = "top63" +CONF_TOP64 = "top64" +CONF_TOP65 = "top65" +CONF_TOP66 = "top66" +CONF_TOP67 = "top67" +CONF_TOP70 = "top70" +CONF_TOP71 = "top71" +CONF_TOP72 = "top72" +CONF_TOP73 = "top73" +CONF_TOP74 = "top74" +CONF_TOP75 = "top75" +CONF_TOP77 = "top77" +CONF_TOP78 = "top78" +CONF_TOP79 = "top79" +CONF_TOP80 = "top80" +CONF_TOP82 = "top82" +CONF_TOP83 = "top83" +CONF_TOP84 = "top84" +CONF_TOP85 = "top85" +CONF_TOP86 = "top86" +CONF_TOP87 = "top87" +CONF_TOP88 = "top88" +CONF_TOP89 = "top89" +CONF_TOP90 = "top90" +CONF_TOP91 = "top91" +CONF_TOP93 = "top93" +CONF_TOP95 = "top95" +CONF_TOP96 = "top96" +CONF_TOP97 = "top97" +CONF_TOP98 = "top98" +CONF_TOP102 = "top102" +CONF_TOP103 = "top103" +CONF_TOP104 = "top104" +CONF_TOP105 = "top105" +CONF_TOP113 = "top113" +CONF_TOP115 = "top115" +CONF_TOP116 = "top116" +CONF_TOP117 = "top117" +CONF_TOP118 = "top118" +CONF_TOP127 = "top127" +CONF_TOP128 = "top128" +CONF_TOP131 = "top131" +CONF_TOP134 = "top134" +CONF_TOP135 = "top135" +CONF_TOP136 = "top136" +CONF_TOP137 = "top137" +CONF_TOP138 = "top138" TYPES = [ - CONF_SENS_TOP1, - CONF_SENS_TOP5, - CONF_SENS_TOP6, - CONF_SENS_TOP7, - CONF_SENS_TOP8, - CONF_SENS_TOP9, - CONF_SENS_TOP10, - CONF_SENS_TOP11, - CONF_SENS_TOP12, - CONF_SENS_TOP14, - CONF_SENS_TOP15, - CONF_SENS_TOP16, - CONF_SENS_TOP21, - CONF_SENS_TOP22, - CONF_SENS_TOP23, - CONF_SENS_TOP24, - CONF_SENS_TOP25, - CONF_SENS_TOP27, - CONF_SENS_TOP28, - CONF_SENS_TOP29, - CONF_SENS_TOP30, - CONF_SENS_TOP31, - CONF_SENS_TOP32, - CONF_SENS_TOP33, - CONF_SENS_TOP34, - CONF_SENS_TOP35, - CONF_SENS_TOP36, - CONF_SENS_TOP37, - CONF_SENS_TOP38, - CONF_SENS_TOP39, - CONF_SENS_TOP40, - CONF_SENS_TOP41, - CONF_SENS_TOP42, - CONF_SENS_TOP43, - CONF_SENS_TOP45, - CONF_SENS_TOP46, - CONF_SENS_TOP47, - CONF_SENS_TOP48, - CONF_SENS_TOP49, - CONF_SENS_TOP50, - CONF_SENS_TOP51, - CONF_SENS_TOP52, - CONF_SENS_TOP53, - CONF_SENS_TOP54, - CONF_SENS_TOP55, - CONF_SENS_TOP56, - CONF_SENS_TOP57, - CONF_SENS_TOP62, - CONF_SENS_TOP63, - CONF_SENS_TOP64, - CONF_SENS_TOP65, - CONF_SENS_TOP66, - CONF_SENS_TOP67, - CONF_SENS_TOP70, - CONF_SENS_TOP71, - CONF_SENS_TOP72, - CONF_SENS_TOP73, - CONF_SENS_TOP74, - CONF_SENS_TOP75, - CONF_SENS_TOP77, - CONF_SENS_TOP78, - CONF_SENS_TOP79, - CONF_SENS_TOP80, - CONF_SENS_TOP82, - CONF_SENS_TOP83, - CONF_SENS_TOP84, - CONF_SENS_TOP85, - CONF_SENS_TOP86, - CONF_SENS_TOP87, - CONF_SENS_TOP88, - CONF_SENS_TOP89, - CONF_SENS_TOP90, - CONF_SENS_TOP91, - CONF_SENS_TOP93, - CONF_SENS_TOP95, - CONF_SENS_TOP96, - CONF_SENS_TOP97, - CONF_SENS_TOP98, - CONF_SENS_TOP102, - CONF_SENS_TOP103, - CONF_SENS_TOP104, - CONF_SENS_TOP105, - CONF_SENS_TOP113, - CONF_SENS_TOP115, - CONF_SENS_TOP116, - CONF_SENS_TOP117, - CONF_SENS_TOP118, - CONF_SENS_TOP119, - CONF_SENS_TOP120, - CONF_SENS_TOP121, - CONF_SENS_TOP122, - CONF_SENS_TOP123, - CONF_SENS_TOP125, - CONF_SENS_TOP126, + CONF_TOP1, + CONF_TOP5, + CONF_TOP6, + CONF_TOP7, + CONF_TOP8, + CONF_TOP9, + CONF_TOP10, + CONF_TOP11, + CONF_TOP12, + CONF_TOP14, + CONF_TOP15, + CONF_TOP16, + CONF_TOP21, + CONF_TOP22, + CONF_TOP23, + CONF_TOP24, + CONF_TOP25, + CONF_TOP27, + CONF_TOP28, + CONF_TOP29, + CONF_TOP30, + CONF_TOP31, + CONF_TOP32, + CONF_TOP33, + CONF_TOP34, + CONF_TOP35, + CONF_TOP36, + CONF_TOP37, + CONF_TOP38, + CONF_TOP39, + CONF_TOP40, + CONF_TOP41, + CONF_TOP42, + CONF_TOP43, + CONF_TOP45, + CONF_TOP46, + CONF_TOP47, + CONF_TOP48, + CONF_TOP49, + CONF_TOP50, + CONF_TOP51, + CONF_TOP52, + CONF_TOP53, + CONF_TOP54, + CONF_TOP55, + CONF_TOP56, + CONF_TOP57, + CONF_TOP62, + CONF_TOP63, + CONF_TOP64, + CONF_TOP65, + CONF_TOP66, + CONF_TOP67, + CONF_TOP70, + CONF_TOP71, + CONF_TOP72, + CONF_TOP73, + CONF_TOP74, + CONF_TOP75, + CONF_TOP77, + CONF_TOP78, + CONF_TOP79, + CONF_TOP80, + CONF_TOP82, + CONF_TOP83, + CONF_TOP84, + CONF_TOP85, + CONF_TOP86, + CONF_TOP87, + CONF_TOP88, + CONF_TOP89, + CONF_TOP90, + CONF_TOP91, + CONF_TOP93, + CONF_TOP95, + CONF_TOP96, + CONF_TOP97, + CONF_TOP98, + CONF_TOP102, + CONF_TOP103, + CONF_TOP104, + CONF_TOP105, + CONF_TOP113, + CONF_TOP115, + CONF_TOP116, + CONF_TOP117, + CONF_TOP118, + CONF_TOP127, + CONF_TOP128, + CONF_TOP131, + CONF_TOP134, + CONF_TOP135, + CONF_TOP136, + CONF_TOP137, + CONF_TOP138, ] CONFIG_SCHEMA = cv.All( @@ -227,461 +230,467 @@ CONFIG_SCHEMA = cv.All( { cv.GenerateID(CONF_PANASONIC_HEATPUMP_ID): cv.use_id(PanasonicHeatpumpComponent), - cv.Optional(CONF_SENS_TOP1): sensor.sensor_schema( + cv.Optional(CONF_TOP1): sensor.sensor_schema( device_class=DEVICE_CLASS_VOLUME_FLOW_RATE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_LITRE_PER_MINUTE, ), - cv.Optional(CONF_SENS_TOP5): sensor.sensor_schema( + cv.Optional(CONF_TOP5): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP6): sensor.sensor_schema( + cv.Optional(CONF_TOP6): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP7): sensor.sensor_schema( + cv.Optional(CONF_TOP7): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP8): sensor.sensor_schema( + cv.Optional(CONF_TOP8): sensor.sensor_schema( device_class=DEVICE_CLASS_FREQUENCY, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_HERTZ, ), - cv.Optional(CONF_SENS_TOP9): sensor.sensor_schema( + cv.Optional(CONF_TOP9): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP10): sensor.sensor_schema( + cv.Optional(CONF_TOP10): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP11): sensor.sensor_schema( + cv.Optional(CONF_TOP11): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_TOTAL_INCREASING, unit_of_measurement = UNIT_HOUR, ), - cv.Optional(CONF_SENS_TOP12): sensor.sensor_schema( + cv.Optional(CONF_TOP12): sensor.sensor_schema( unit_of_measurement=UNIT_EMPTY, icon=ICON_COUNTER, ), - cv.Optional(CONF_SENS_TOP14): sensor.sensor_schema( + cv.Optional(CONF_TOP14): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP15): sensor.sensor_schema( + cv.Optional(CONF_TOP15): sensor.sensor_schema( device_class=DEVICE_CLASS_POWER, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_WATT, ), - cv.Optional(CONF_SENS_TOP16): sensor.sensor_schema( + cv.Optional(CONF_TOP16): sensor.sensor_schema( device_class=DEVICE_CLASS_POWER, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_WATT, ), - cv.Optional(CONF_SENS_TOP21): sensor.sensor_schema( + cv.Optional(CONF_TOP21): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP22): sensor.sensor_schema( + cv.Optional(CONF_TOP22): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP23): sensor.sensor_schema( + cv.Optional(CONF_TOP23): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP24): sensor.sensor_schema( + cv.Optional(CONF_TOP24): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP25): sensor.sensor_schema( + cv.Optional(CONF_TOP25): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP27): sensor.sensor_schema( + cv.Optional(CONF_TOP27): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP28): sensor.sensor_schema( + cv.Optional(CONF_TOP28): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP29): sensor.sensor_schema( + cv.Optional(CONF_TOP29): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP30): sensor.sensor_schema( + cv.Optional(CONF_TOP30): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP31): sensor.sensor_schema( + cv.Optional(CONF_TOP31): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP32): sensor.sensor_schema( + cv.Optional(CONF_TOP32): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP33): sensor.sensor_schema( + cv.Optional(CONF_TOP33): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP34): sensor.sensor_schema( + cv.Optional(CONF_TOP34): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP35): sensor.sensor_schema( + cv.Optional(CONF_TOP35): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP36): sensor.sensor_schema( + cv.Optional(CONF_TOP36): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP37): sensor.sensor_schema( + cv.Optional(CONF_TOP37): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP38): sensor.sensor_schema( + cv.Optional(CONF_TOP38): sensor.sensor_schema( device_class=DEVICE_CLASS_POWER, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_WATT, ), - cv.Optional(CONF_SENS_TOP39): sensor.sensor_schema( + cv.Optional(CONF_TOP39): sensor.sensor_schema( device_class=DEVICE_CLASS_POWER, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_WATT, ), - cv.Optional(CONF_SENS_TOP40): sensor.sensor_schema( + cv.Optional(CONF_TOP40): sensor.sensor_schema( device_class=DEVICE_CLASS_POWER, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_WATT, ), - cv.Optional(CONF_SENS_TOP41): sensor.sensor_schema( + cv.Optional(CONF_TOP41): sensor.sensor_schema( device_class=DEVICE_CLASS_POWER, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_WATT, ), - cv.Optional(CONF_SENS_TOP42): sensor.sensor_schema( + cv.Optional(CONF_TOP42): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP43): sensor.sensor_schema( + cv.Optional(CONF_TOP43): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP45): sensor.sensor_schema( + cv.Optional(CONF_TOP45): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP46): sensor.sensor_schema( + cv.Optional(CONF_TOP46): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP47): sensor.sensor_schema( + cv.Optional(CONF_TOP47): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP48): sensor.sensor_schema( + cv.Optional(CONF_TOP48): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP49): sensor.sensor_schema( + cv.Optional(CONF_TOP49): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP50): sensor.sensor_schema( + cv.Optional(CONF_TOP50): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP51): sensor.sensor_schema( + cv.Optional(CONF_TOP51): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP52): sensor.sensor_schema( + cv.Optional(CONF_TOP52): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP53): sensor.sensor_schema( + cv.Optional(CONF_TOP53): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP54): sensor.sensor_schema( + cv.Optional(CONF_TOP54): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP55): sensor.sensor_schema( + cv.Optional(CONF_TOP55): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP56): sensor.sensor_schema( + cv.Optional(CONF_TOP56): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP57): sensor.sensor_schema( + cv.Optional(CONF_TOP57): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP62): sensor.sensor_schema( + cv.Optional(CONF_TOP62): sensor.sensor_schema( icon=ICON_FAN_SPEED, unit_of_measurement = UNIT_ROTATIONS_PER_MINUTE, ), - cv.Optional(CONF_SENS_TOP63): sensor.sensor_schema( + cv.Optional(CONF_TOP63): sensor.sensor_schema( icon=ICON_FAN_SPEED, unit_of_measurement = UNIT_ROTATIONS_PER_MINUTE, ), - cv.Optional(CONF_SENS_TOP64): sensor.sensor_schema( + cv.Optional(CONF_TOP64): sensor.sensor_schema( device_class=DEVICE_CLASS_PRESSURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_PRESSURE_KGFCM2, ), - cv.Optional(CONF_SENS_TOP65): sensor.sensor_schema( + cv.Optional(CONF_TOP65): sensor.sensor_schema( unit_of_measurement = UNIT_ROTATIONS_PER_MINUTE, ), - cv.Optional(CONF_SENS_TOP66): sensor.sensor_schema( + cv.Optional(CONF_TOP66): sensor.sensor_schema( device_class=DEVICE_CLASS_PRESSURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_PRESSURE_KGFCM2, ), - cv.Optional(CONF_SENS_TOP67): sensor.sensor_schema( + cv.Optional(CONF_TOP67): sensor.sensor_schema( device_class=DEVICE_CLASS_CURRENT, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_AMPERE, ), - cv.Optional(CONF_SENS_TOP70): sensor.sensor_schema( + cv.Optional(CONF_TOP70): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP71): sensor.sensor_schema( + cv.Optional(CONF_TOP71): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_MINUTE, ), - cv.Optional(CONF_SENS_TOP72): sensor.sensor_schema( + cv.Optional(CONF_TOP72): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP73): sensor.sensor_schema( + cv.Optional(CONF_TOP73): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP74): sensor.sensor_schema( + cv.Optional(CONF_TOP74): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP75): sensor.sensor_schema( + cv.Optional(CONF_TOP75): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP77): sensor.sensor_schema( + cv.Optional(CONF_TOP77): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP78): sensor.sensor_schema( + cv.Optional(CONF_TOP78): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP79): sensor.sensor_schema( + cv.Optional(CONF_TOP79): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP80): sensor.sensor_schema( + cv.Optional(CONF_TOP80): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP82): sensor.sensor_schema( + cv.Optional(CONF_TOP82): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP83): sensor.sensor_schema( + cv.Optional(CONF_TOP83): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP84): sensor.sensor_schema( + cv.Optional(CONF_TOP84): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP85): sensor.sensor_schema( + cv.Optional(CONF_TOP85): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP86): sensor.sensor_schema( + cv.Optional(CONF_TOP86): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP87): sensor.sensor_schema( + cv.Optional(CONF_TOP87): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP88): sensor.sensor_schema( + cv.Optional(CONF_TOP88): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP89): sensor.sensor_schema( + cv.Optional(CONF_TOP89): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP90): sensor.sensor_schema( + cv.Optional(CONF_TOP90): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_TOTAL_INCREASING, unit_of_measurement = UNIT_HOUR, ), - cv.Optional(CONF_SENS_TOP91): sensor.sensor_schema( + cv.Optional(CONF_TOP91): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_TOTAL_INCREASING, unit_of_measurement = UNIT_HOUR, ), - cv.Optional(CONF_SENS_TOP93): sensor.sensor_schema(), - cv.Optional(CONF_SENS_TOP95): sensor.sensor_schema(), - cv.Optional(CONF_SENS_TOP96): sensor.sensor_schema( + cv.Optional(CONF_TOP93): sensor.sensor_schema(), + cv.Optional(CONF_TOP95): sensor.sensor_schema(), + cv.Optional(CONF_TOP96): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_MINUTE, ), - cv.Optional(CONF_SENS_TOP97): sensor.sensor_schema( + cv.Optional(CONF_TOP97): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP98): sensor.sensor_schema( + cv.Optional(CONF_TOP98): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP102): sensor.sensor_schema( + cv.Optional(CONF_TOP102): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP103): sensor.sensor_schema( + cv.Optional(CONF_TOP103): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP104): sensor.sensor_schema( + cv.Optional(CONF_TOP104): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP105): sensor.sensor_schema( + cv.Optional(CONF_TOP105): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP113): sensor.sensor_schema( + cv.Optional(CONF_TOP113): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_KELVIN, ), - cv.Optional(CONF_SENS_TOP115): sensor.sensor_schema( + cv.Optional(CONF_TOP115): sensor.sensor_schema( device_class=DEVICE_CLASS_PRESSURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_BAR, ), - cv.Optional(CONF_SENS_TOP116): sensor.sensor_schema( + cv.Optional(CONF_TOP116): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP117): sensor.sensor_schema( + cv.Optional(CONF_TOP117): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP118): sensor.sensor_schema( + cv.Optional(CONF_TOP118): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP119): sensor.sensor_schema( + cv.Optional(CONF_TOP127): sensor.sensor_schema( + state_class=STATE_CLASS_MEASUREMENT, + unit_of_measurement = UNIT_PERCENT, + ), + cv.Optional(CONF_TOP128): sensor.sensor_schema( + state_class=STATE_CLASS_MEASUREMENT, + unit_of_measurement = UNIT_PERCENT, + ), + cv.Optional(CONF_TOP131): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP120): sensor.sensor_schema( + cv.Optional(CONF_TOP134): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP121): sensor.sensor_schema( + cv.Optional(CONF_TOP135): sensor.sensor_schema( device_class=DEVICE_CLASS_TEMPERATURE, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_CELSIUS, ), - cv.Optional(CONF_SENS_TOP122): sensor.sensor_schema( + cv.Optional(CONF_TOP136): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_MINUTE, ), - cv.Optional(CONF_SENS_TOP123): sensor.sensor_schema( + cv.Optional(CONF_TOP137): sensor.sensor_schema( device_class=DEVICE_CLASS_DURATION, state_class=STATE_CLASS_MEASUREMENT, unit_of_measurement = UNIT_MINUTE, ), - cv.Optional(CONF_SENS_TOP125): sensor.sensor_schema( - unit_of_measurement=UNIT_EMPTY, - icon=ICON_COUNTER, - ), - cv.Optional(CONF_SENS_TOP126): sensor.sensor_schema( - unit_of_measurement=UNIT_EMPTY, - icon=ICON_COUNTER, + cv.Optional(CONF_TOP138): sensor.sensor_schema( + device_class=DEVICE_CLASS_DURATION, + state_class=STATE_CLASS_MEASUREMENT, + unit_of_measurement = UNIT_MINUTE, ), + } ).extend(cv.COMPONENT_SCHEMA) ) diff --git a/components/panasonic_heatpump/text_sensor.py b/components/panasonic_heatpump/text_sensor.py index f40d93a..495adf9 100644 --- a/components/panasonic_heatpump/text_sensor.py +++ b/components/panasonic_heatpump/text_sensor.py @@ -22,46 +22,51 @@ ICON_VALVE = "mdi:pipe-valve" ICON_PUMP = "mdi:pump" ICON_EXTERNAL_PAD_HEATER = "mdi:radiator" -CONF_TEXT_SENS_TOP4 = "top4" -CONF_TEXT_SENS_TOP17 = "top17" -CONF_TEXT_SENS_TOP18 = "top18" -CONF_TEXT_SENS_TOP19 = "top19" -CONF_TEXT_SENS_TOP20 = "top20" -CONF_TEXT_SENS_TOP44 = "top44" -CONF_TEXT_SENS_TOP58 = "top58" -CONF_TEXT_SENS_TOP59 = "top59" -CONF_TEXT_SENS_TOP76 = "top76" -CONF_TEXT_SENS_TOP81 = "top81" -CONF_TEXT_SENS_TOP92 = "top92" -CONF_TEXT_SENS_TOP94 = "top94" -CONF_TEXT_SENS_TOP101 = "top101" -CONF_TEXT_SENS_TOP106 = "top106" -CONF_TEXT_SENS_TOP107 = "top107" -CONF_TEXT_SENS_TOP111 = "top111" -CONF_TEXT_SENS_TOP112 = "top112" -CONF_TEXT_SENS_TOP114 = "top114" -CONF_TEXT_SENS_TOP124 = "top124" +CONF_TOP4 = "top4" +CONF_TOP17 = "top17" +CONF_TOP18 = "top18" +CONF_TOP19 = "top19" +CONF_TOP20 = "top20" +CONF_TOP44 = "top44" +CONF_TOP58 = "top58" +CONF_TOP59 = "top59" +CONF_TOP76 = "top76" +CONF_TOP81 = "top81" +CONF_TOP92 = "top92" +CONF_TOP94 = "top94" +CONF_TOP101 = "top101" +CONF_TOP106 = "top106" +CONF_TOP107 = "top107" +CONF_TOP111 = "top111" +CONF_TOP112 = "top112" +CONF_TOP114 = "top114" +CONF_TOP125 = "top125" +CONF_TOP126 = "top126" +CONF_TOP130 = "top130" + TYPES = [ - CONF_TEXT_SENS_TOP4, - CONF_TEXT_SENS_TOP17, - CONF_TEXT_SENS_TOP18, - CONF_TEXT_SENS_TOP19, - CONF_TEXT_SENS_TOP20, - CONF_TEXT_SENS_TOP44, - CONF_TEXT_SENS_TOP58, - CONF_TEXT_SENS_TOP59, - CONF_TEXT_SENS_TOP76, - CONF_TEXT_SENS_TOP81, - CONF_TEXT_SENS_TOP92, - CONF_TEXT_SENS_TOP94, - CONF_TEXT_SENS_TOP101, - CONF_TEXT_SENS_TOP106, - CONF_TEXT_SENS_TOP107, - CONF_TEXT_SENS_TOP111, - CONF_TEXT_SENS_TOP112, - CONF_TEXT_SENS_TOP114, - CONF_TEXT_SENS_TOP124, + CONF_TOP4, + CONF_TOP17, + CONF_TOP18, + CONF_TOP19, + CONF_TOP20, + CONF_TOP44, + CONF_TOP58, + CONF_TOP59, + CONF_TOP76, + CONF_TOP81, + CONF_TOP92, + CONF_TOP94, + CONF_TOP101, + CONF_TOP106, + CONF_TOP107, + CONF_TOP111, + CONF_TOP112, + CONF_TOP114, + CONF_TOP125, + CONF_TOP126, + CONF_TOP130, ] CONFIG_SCHEMA = cv.All( @@ -69,57 +74,59 @@ CONFIG_SCHEMA = cv.All( { cv.GenerateID(CONF_PANASONIC_HEATPUMP_ID): cv.use_id(PanasonicHeatpumpComponent), - cv.Optional(CONF_TEXT_SENS_TOP4): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP4): text_sensor.text_sensor_schema( icon=ICON_OPERATING_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP17): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP17): text_sensor.text_sensor_schema( icon=ICON_POWERFUL_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP18): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP18): text_sensor.text_sensor_schema( icon=ICON_QUIET_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP19): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP19): text_sensor.text_sensor_schema( icon=ICON_HOLIDAY_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP20): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP20): text_sensor.text_sensor_schema( icon=ICON_VALVE, ), - cv.Optional(CONF_TEXT_SENS_TOP44): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP44): text_sensor.text_sensor_schema( icon=ICON_ERROR, ), - cv.Optional(CONF_TEXT_SENS_TOP58): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP58): text_sensor.text_sensor_schema( icon=ICON_BLOCKED, ), - cv.Optional(CONF_TEXT_SENS_TOP59): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP59): text_sensor.text_sensor_schema( icon=ICON_BLOCKED, ), - cv.Optional(CONF_TEXT_SENS_TOP76): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP76): text_sensor.text_sensor_schema( icon=ICON_HEATING_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP81): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP81): text_sensor.text_sensor_schema( icon=ICON_COOLING_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP92): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP92): text_sensor.text_sensor_schema( icon=ICON_MODEL, ), - cv.Optional(CONF_TEXT_SENS_TOP94): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP94): text_sensor.text_sensor_schema( icon=ICON_ZONE, ), - cv.Optional(CONF_TEXT_SENS_TOP101): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP101): text_sensor.text_sensor_schema( icon=ICON_SOLAR_MODE, ), - cv.Optional(CONF_TEXT_SENS_TOP106): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP106): text_sensor.text_sensor_schema( icon=ICON_PUMP, ), - cv.Optional(CONF_TEXT_SENS_TOP107): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP107): text_sensor.text_sensor_schema( icon=ICON_LIQUID, ), - cv.Optional(CONF_TEXT_SENS_TOP111): text_sensor.text_sensor_schema(), - cv.Optional(CONF_TEXT_SENS_TOP112): text_sensor.text_sensor_schema(), - cv.Optional(CONF_TEXT_SENS_TOP114): text_sensor.text_sensor_schema( + cv.Optional(CONF_TOP111): text_sensor.text_sensor_schema(), + cv.Optional(CONF_TOP112): text_sensor.text_sensor_schema(), + cv.Optional(CONF_TOP114): text_sensor.text_sensor_schema( icon=ICON_EXTERNAL_PAD_HEATER, ), - cv.Optional(CONF_TEXT_SENS_TOP124): text_sensor.text_sensor_schema(), + cv.Optional(CONF_TOP125): text_sensor.text_sensor_schema(), + cv.Optional(CONF_TOP126): text_sensor.text_sensor_schema(), + cv.Optional(CONF_TOP130): text_sensor.text_sensor_schema(), } ).extend(cv.COMPONENT_SCHEMA) )