arthurrump / esphome-opentherm

Create your own smart modulating thermostat using the OpenTherm component for ESPHome
BSD 2-Clause "Simplified" License
79 stars 45 forks source link

Add gas_fault, air_fault, water_overtemp, lockout_reset, low_water_pressure. #8

Open ananyevgv opened 2 years ago

ananyevgv commented 2 years ago
OpenThermMessageID::ASFflags:
    flags = (response & 0xFFFF) >> 8;
    vars.service_required.value = flags & 0x01;
    vars.lockout_reset.value = flags & 0x02;
    vars.low_water_pressure.value = flags & 0x04;
    vars.gas_fault.value = flags & 0x08;
    vars.air_fault.value = flags & 0x10;
    vars.water_overtemp.value = flags & 0x20;
    vars.fault_code.value = response & 0xFF;

https://github.com/DRazumovskiy/Baxi-Luna3-Comfort-IN-HT-Solar-MQTT/blob/master/baxi-luna3-mqtt/OpenThermTask.ino

ananyevgv commented 2 years ago

It turns out to add either a sensor or a binary sensor, the duplicate key error is not compiled in place. sensor "fault_code": SensorSchema({ "description": "Fault code", "accuracy_decimals": 0, "icon": "mdi:water-boiler-alert", "state_class": STATE_CLASS_MEASUREMENT, "message": "ASFflags", "keep_updated": True, "message_data": "u8_lb", }),

binary sensor "service_required": BinarySensorSchema({ "device_class": DEVICE_CLASS_PROBLEM, "icon": "mdi:account-wrench-outline", "description": "Remote boiler parameters: service required read", "message": "ASFflags", "keep_updated": False, "message_data": "flag8_hb_0", }),

"lockout_reset": BinarySensorSchema({
    "device_class": DEVICE_CLASS_PROBLEM,
    "icon": "mdi:lock-reset",
    "description": "Remote boiler parameters: lockout reset read",
    "message": "ASFflags",
    "keep_updated": False,
    "message_data": "flag8_hb_1",
}),   
"low_water_pressure": BinarySensorSchema({
    "device_class": DEVICE_CLASS_PROBLEM,
    "description": "Remote boiler parameters: low water pressure read",
    "message": "ASFflags",
    "icon": "mdi:water-alert",
    "keep_updated": False,
    "message_data": "flag8_hb_2",
}),   

"gas_fault": BinarySensorSchema({
    "device_class": DEVICE_CLASS_PROBLEM,
    "description": "Remote boiler parameters: gas fault read",
    "message": "ASFflags",
    "icon": "mdi:fire-alert",
    "keep_updated": False,
    "message_data": "flag8_hb_3",
}),   
"air_fault": BinarySensorSchema({
    "device_class": DEVICE_CLASS_PROBLEM,
    "icon": "mdi:weather-cloudy-alert",
    "description": "Remote boiler parameters: air fault read",
    "message": "ASFflags",
    "keep_updated": False,
    "message_data": "flag8_hb_4",
}),  
"water_overtemp": BinarySensorSchema({
    "device_class": DEVICE_CLASS_PROBLEM,
    "icon": "mdi:water-thermometer",
    "description": "Remote boiler parameters: water overtemp read",
    "message": "ASFflags",
    "keep_updated": False,
    "message_data": "flag8_hb_5",
}), 
arthurrump commented 1 year ago

Huh, I must have overlooked that one. For reference, this is message id 5 described in section 5.3.1 of the OpenTherm specification. In the OpenTherm library it is indeed message id ASFflags. The code you listed looks reasonable at first glance, though I think the binary sensors are the hb and the fault code is the lb (at least, that's what it says in the spec).

What do you mean with

It turns out to add either a sensor or a binary sensor, the duplicate key error is not compiled in place.

?