16using device_feature::EXTENDED_POSITION_FRAME;
17using device_feature::FAVORITE;
18using device_feature::INVERTED;
19using device_feature::LEVELS;
20using device_feature::PARTIAL;
21using device_feature::PEDESTRIAN;
22using device_feature::TILT;
23using device_feature::VENT;
24using device_feature::WINDOW_COMPANIONS;
25using device_type_flags::EXPERIMENTAL;
26using device_type_flags::HAS_PLATFORM;
27using device_type_flags::STANDALONE_NAME;
28using device_type_flags::YAML_SELECTABLE;
39constexpr uint8_t SELECTABLE_PLATFORM =
40 YAML_SELECTABLE | HAS_PLATFORM;
41constexpr uint8_t SUBTYPE_PLATFORM = HAS_PLATFORM;
42constexpr uint8_t EXPERIMENTAL_SUBTYPE_PLATFORM =
43 HAS_PLATFORM | EXPERIMENTAL;
85constexpr DeviceFeatures DIMMABLE_LIGHT = LEVELS | EXTENDED_POSITION_FRAME;
87constexpr DeviceFeatures HEAT_LEVEL_DEVICE = device_feature::MAIN_PARAMETER_ONLY | LEVELS;
92constexpr size_t TYPE_HEX_BUFFER_SIZE = 24;
134 {
DeviceType::LIGHT, 0, NO_MODEL,
"light", CAP_LIGHT, SELECTABLE_PLATFORM, BINARY_COMMAND},
135 {
DeviceType::LIGHT, 1, NO_MODEL,
"dimmable RGB", CAP_LIGHT, EXPERIMENTAL_SUBTYPE_PLATFORM, DIMMABLE_LIGHT},
136 {
DeviceType::LIGHT, 2, NO_MODEL,
"tunable white", CAP_LIGHT, EXPERIMENTAL_SUBTYPE_PLATFORM, DIMMABLE_LIGHT},
149 {
DeviceType::LOCK, 0, NO_MODEL,
"lock", CAP_LOCK, SELECTABLE_PLATFORM, BINARY_COMMAND},
150 {
DeviceType::LOCK, 1, NO_MODEL,
"window lock", CAP_LOCK, EXPERIMENTAL_SUBTYPE_PLATFORM | STANDALONE_NAME,
152 {
DeviceType::LOCK, 2, NO_MODEL,
"car controller", CAP_NONE, EXPERIMENTAL | STANDALONE_NAME, 0},
164 SELECTABLE_PLATFORM, 0},
195 {
DeviceType::HEAT_PUMP, 1, NO_MODEL,
"heat pump (Atlantic)", CAP_NONE, EXPERIMENTAL | STANDALONE_NAME, 0},
196 {
DeviceType::HEAT_PUMP, 2, NO_MODEL,
"boiler (Atlantic)", CAP_NONE, EXPERIMENTAL | STANDALONE_NAME, 0},
223 SELECTABLE_PLATFORM | EXPERIMENTAL, device_feature::WATER_HEATER},
238 SUBTYPE_PLATFORM, WINDOW_COMPANIONS | device_feature::NIGHT_LIGHT},
257 if (row.type == type && row.subtype == subtype && row.model ==
DeviceModel::NONE)
267 if (row.type == type && row.subtype == subtype && row.model == model)
274 return std::any_of(std::begin(DEVICE_TYPE_TABLE), std::end(DEVICE_TYPE_TABLE),
292 return row !=
nullptr && (row->
flags & HAS_PLATFORM) != 0;
312 return "water_heater";
324 return row !=
nullptr && (row->
flags & device_type_flags::EXPERIMENTAL) != 0;
334 return model_row->features;
336 if (exact !=
nullptr)
339 if (subtype == SUBTYPE_MAIN_PARAMETER_ONLY)
345 switch (entity_class) {
351 return BINARY_COMMAND;
353 return LEVELS | EXTENDED_POSITION_FRAME;
368 if (type_row ==
nullptr) {
369 char buf[TYPE_HEX_BUFFER_SIZE];
370 snprintf(buf,
sizeof(buf),
"unknown type 0x%02X",
static_cast<unsigned>(type));
371 return subtype == 0 ? std::string(buf) : std::string(buf) +
", subtype " + std::to_string(subtype);
375 if (subtype_row !=
nullptr && (subtype_row->
flags & STANDALONE_NAME) != 0)
376 return subtype_row->
name;
379 std::string kind = type_row->
name;
380 for (
char &c : kind) {
386 return kind +
", " + (subtype_row !=
nullptr ? std::string(subtype_row->
name) :
"subtype " + std::to_string(subtype));
390 char buf[TYPE_HEX_BUFFER_SIZE];
391 snprintf(buf,
sizeof(buf),
"0x%02X/%u",
static_cast<unsigned>(type),
static_cast<unsigned>(subtype));
@ FAVORITE
CoverCommand::FAVORITE.
@ VENT
CoverCommand::VENT.
DeviceFeatures device_features(DeviceType type, uint8_t subtype, DeviceModel model)
Capability bits of a (type, subtype, model).
DeviceFeatures undeclared_kind_features(DeviceCapabilityClass entity_class)
Features of a device kind that has no table row, or that is not declared at all.
std::string format_device_ids(DeviceType type, uint8_t subtype)
Wire values of a (type, subtype), for logs that must stay readable without the table.
DeviceCapabilityClass device_capability_class(DeviceType type)
Map a raw IO‑Homecontrol type to the closest ESPHome/Home Assistant entity family.
@ PEDESTRIAN
Move to the pedestrian position (gate openers); experimental.
@ PARTIAL
Move to the stored partial position (garage openers; issue #163).
const DeviceTypeInfo * find_device_type_info(DeviceType type, uint8_t subtype, DeviceModel model)
Look up the table row for a (type, subtype, model).
DeviceModel
A product model below a (node type, subtype): for products that report the same wire type but need di...
@ HEATER_WITH_LIGHT
Heater with a night light under the electrical heater with an adjustable setpoint (52/1).
@ NONE
No model: the (type, subtype) row.
@ TOWEL_DRYER
Towel dryer under the electrical heater with an adjustable setpoint (52/1).
const DeviceTypeInfo * find_device_model_info(DeviceType type, uint8_t subtype, DeviceModel model)
Look up the model row with exactly this (type, subtype, model), without falling back.
DeviceType
IO-Homecontrol node types.
@ LOUVRE_BLIND
Louvre blind.
@ SLIDING_WINDOW
Sliding window.
@ EXTERIOR_VENETIAN_BLIND
Exterior venetian blind.
@ VERTICAL_INTERIOR_BLIND
Vertical interior blind.
@ CENTRAL_HOUSE_CONTROL
Central house control.
@ GATE_OPENER
Gate opener.
@ ELECTRICAL_HEATER
Electrical heater.
@ VERTICAL_EXTERIOR_AWNING
Vertical exterior awning.
@ HEATING_TEMPERATURE_INTERFACE
Heating temperature interface.
@ BEACON
Beacon (unpaired/announcement).
@ SECURE_CONFIGURATION_DEVICE
Secure configuration device (a commissioning tool, not an actuator).
@ INTERIOR_VENETIAN_BLIND
Interior venetian blind.
@ UNKNOWN
Unknown/unspecified device.
@ DOMESTIC_HOT_WATER
Domestic hot water.
@ ZONE_CONTROL
Zone control.
@ INTRUSION_ALARM
Intrusion alarm.
@ WINDOW_OPENER
Window opening actuator.
@ SWINGING_SHUTTER
Swinging shutter.
@ HEAT_RECOVERY_VENTILATION
Heat recovery ventilation.
@ HORIZONTAL_AWNING
Horizontal awning (open/close inverted).
@ ROLLING_DOOR_OPENER
Rolling door opener.
@ ON_OFF_SWITCH
Generic on/off switch.
@ EXTERIOR_HEATING
Exterior heating.
@ TEST_AND_EVALUATION
Test and evaluation equipment.
@ DUAL_ROLLER_SHUTTER
Dual-section roller shutter.
@ VENTILATION_POINT
Ventilation point.
@ ROLLER_SHUTTER
Roller shutter.
@ REMOTE_CONTROLLER
Remote controller (all ten type bits set, packed bytes FF C0).
@ CURTAIN_TRACK
Curtain track.
@ BIOCLIMATIC_PERGOLA
Bioclimatic pergola (louvre opening as the position).
@ GARAGE_OPENER
Garage door opener.
const DeviceTypeInfo * find_exact_device_type_info(DeviceType type, uint8_t subtype)
Look up the table row with exactly this (type, subtype), without falling back.
bool device_offers_models(DeviceType type, uint8_t subtype)
Does this exact (type, subtype) have model rows below it?
constexpr DeviceFeatures main_parameter_only_variant(DeviceFeatures type_features)
The features of a subtype-58 variant of a kind.
const char * device_platform_name(DeviceType type, uint8_t subtype)
Name of the ESPHome platform that drives this (type, subtype).
bool device_has_platform(DeviceType type, uint8_t subtype)
Can an ESPHome platform drive this (type, subtype) today?
bool device_is_experimental(DeviceType type, uint8_t subtype)
Is this (type, subtype) a kind no capture or report has confirmed on a real device?
uint16_t DeviceFeatures
Capability bits of a device kind; see device_feature.
DeviceCapabilityClass
High‑level capability class derived from DeviceType.
@ CLIMATE
Climate device (heating/cooling).
@ SWITCH
Binary on/off switch.
@ UNKNOWN
Unknown capability.
@ HEATER_LEVEL
Heater with a heat level in the position field (exterior heating).
@ COVER
Position‑controlled cover (shutter/blind/awning).
@ WATER_HEATER
Domestic hot water heater (device_feature::WATER_HEATER).
@ LIGHT
Binary on/off light.
std::string format_device_kind(DeviceType type, uint8_t subtype)
Human-readable description of a (type, subtype) for logs and reports.
int SUBTYPE_MAIN_PARAMETER_ONLY
The IO node-type and subtype table: names, entity class, platform and behaviour flags.
One row of the node-type / subtype table.
uint8_t flags
device_type_flags bits.
uint8_t subtype
Subtype; 0 is the type's own row.
DeviceFeatures features
device_feature bits: the whole word, never merged with the type row's.
const char * name
Type row: lowercase identifier ("roller_shutter").
DeviceModel model
NONE for a type or subtype row; the model of a model row.
DeviceCapabilityClass capability
Entity family the device maps to.
DeviceType type
Node type.