Skip to content

Commit

Permalink
Merge pull request arthurrump#4 from FreeBear-nc/main
Browse files Browse the repository at this point in the history
Add a few more sensors to schema.py
  • Loading branch information
olegtarasov authored Aug 7, 2024
2 parents 6ddabef + b72e099 commit 0dec685
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ The following inputs are available:
- `t_room`: Current sensed room temperature (informational) (°C)
Default `min_value`: -40
Default `max_value`: 127
- `max_rel_mod_level`: Maximum relative modulation level (%)
Default `min_value`: 0
Default `max_value`: 127
Supports `auto_min_value`
<!-- END schema_docs:input -->

### Switch
Expand Down Expand Up @@ -229,4 +233,12 @@ The boiler can also report several numerical values, which are available through
- `max_t_set_lb`: Lower bound for adjustment of max CH setpoint (°C)
- `t_dhw_set`: Domestic hot water temperature setpoint (°C)
- `max_t_set`: Maximum allowable CH water setpoint (°C)
- `oem_fault_code`: OEM fault code ()
- `oem_diagnostic_code`: OEM diagnostic code ()
- `max_capacity`: Maximum boiler capacity (KW) (kW)
- `min_mod_level`: Minimum modulation level (%)
- `opentherm_version_slave`: Version of OpenTherm implemented by slave ()
- `slave_type`: Slave product type ()
- `slave_version`: Slave product version ()
- `slave_id`: Slave ID code ()
<!-- END schema_docs:sensor -->
2 changes: 1 addition & 1 deletion components/opentherm/opentherm.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ enum MessageId {
FHB_SIZE = 12,
FHB_COMMAND = 13,
MAX_MODULATION_LEVEL = 14,
MAX_BOILER_CAPACITY = 15,
MAX_BOILER_CAPACITY = 15, // u8_hb - u8_lb gives min modulation level
ROOM_SETPOINT = 16,
MODULATION_LEVEL = 17,
CH_WATER_PRESSURE = 18,
Expand Down
114 changes: 114 additions & 0 deletions components/opentherm/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from esphome.const import (
UNIT_CELSIUS,
UNIT_EMPTY,
UNIT_KILOWATT,
UNIT_MICROAMP,
UNIT_PERCENT,
UNIT_REVOLUTIONS_PER_MINUTE,
Expand All @@ -16,6 +18,7 @@
DEVICE_CLASS_PROBLEM,
DEVICE_CLASS_TEMPERATURE,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_NONE,
STATE_CLASS_TOTAL_INCREASING,
)

Expand Down Expand Up @@ -392,6 +395,103 @@ class SensorSchema(EntitySchema):
"message_data": "f88",
}
),

"oem_fault_code": SensorSchema(
{
"description": "OEM fault code",
"unit_of_measurement": UNIT_EMPTY,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_NONE,
"message": "FAULT_FLAGS",
"keep_updated": True,
"message_data": "u8_lb",
}
),
"oem_diagnostic_code": SensorSchema(
{
"description": "OEM diagnostic code",
"unit_of_measurement": UNIT_EMPTY,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_NONE,
"message": "OEM_DIAGNOSTIC",
"keep_updated": True,
"message_data": "u16",
}
),
"max_capacity": SensorSchema(
{
"description": "Maximum boiler capacity (KW)",
"unit_of_measurement": UNIT_KILOWATT,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_MEASUREMENT,
"disabled_by_default": True,
"message": "MAX_BOILER_CAPACITY",
"keep_updated": False,
"message_data": "u8_hb",
}
),
"min_mod_level": SensorSchema(
{
"description": "Minimum modulation level",
"unit_of_measurement": UNIT_PERCENT,
"accuracy_decimals": 0,
"icon": "mdi:percent",
"disabled_by_default": True,
"state_class": STATE_CLASS_MEASUREMENT,
"message": "MAX_BOILER_CAPACITY",
"keep_updated": False,
"message_data": "u8_lb",
}
),
"opentherm_version_device": SensorSchema(
{
"description": "Version of OpenTherm implemented by device",
"unit_of_measurement": UNIT_EMPTY,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_NONE,
"disabled_by_default": True,
"message": "OT_VERSION_DEVICE",
"keep_updated": False,
"message_data": "f88",
}
),
"device_type": SensorSchema(
{
"description": "Device product type",
"unit_of_measurement": UNIT_EMPTY,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_NONE,
"disabled_by_default": True,
"message": "VERSION_DEVICE",
"keep_updated": False,
"message_data": "u8_hb",
}
),
"device_version": SensorSchema(
{
"description": "Device product version",
"unit_of_measurement": UNIT_EMPTY,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_NONE,
"disabled_by_default": True,
"message": "VERSION_DEVICE",
"keep_updated": False,
"message_data": "u8_lb",
}
),
"device_id": SensorSchema(
{
"description": "Device ID code",
"unit_of_measurement": UNIT_EMPTY,
"accuracy_decimals": 0,
"state_class": STATE_CLASS_NONE,
"disabled_by_default": True,
"message": "DEVICE_CONFIG",
"keep_updated": False,
"message_data": "u8_lb",
}
),

}
)

Expand Down Expand Up @@ -730,5 +830,19 @@ class InputSchema(EntitySchema):
"range": (-40, 127),
}
),
"max_rel_mod_level": InputSchema(
{
"description": "Maximum relative modulation level",
"unit_of_measurement": UNIT_PERCENT,
"step": 0.1,
"icon": "mdi:percent",
"message": "MAX_MODULATION_LEVEL",
"keep_updated": True,
"message_data": "f88",
"range": (0, 127),
"auto_min_value": { "message": "MaxCapacityMinModLevel", "message_data": "u8_lb" },
}
),

}
)

0 comments on commit 0dec685

Please sign in to comment.