As mentioned, in CM9001-EMS, the Sensor registers has additional functions;
A Counter can be assigned to the setpoint.
A flag can be assigned to enable the monitoring i trigger alarm when temperature exceeds the setpoint.
A Virtual Input can be assigned which is activated when the temperature exceeds the setpoint.
To display the temperature based on Sensor 1 in degrees C, the following lines should be inserted in configuration.yaml; mqtt: sensor:
- name: Temperature
unique_id: \"comfort2_sensor1\"
state_topic: \"comfort2mqtt/sensor1\"
value_template: \"{{ value_json.Value }}\"
availability_topic: \"comfort2mqtt/alarm/online\"
json_attributes_template: \"{{ value_json | tojson }}\"
json_attributes_topic: \"comfort2mqtt/sensor1\"
device_class: temperature
state_class: measurement
unit_of_measurement: °C
payload_available: \"1\"
payload_not_available: \"0\"

To display the temperature setpoint based on counter 1, the following code is used using the mqtt number platform which can be read and write unlike sensor which is read only
mqtt: number:
- name: Temperature Setpoint
unique_id: \"comfort2_counter1_setpoint\"
state_topic: \"comfort2mqtt/counter1\"
value_template: \'{{ value_json.Value | int }}\'
command_topic: \"comfort2mqtt/counter1/set\"
command_template: \"{{ value | int }}\"
availability_topic: \"comfort2mqtt/alarm/online\"
payload_available: \"1\"
payload_not_available: \"0\"
json_attributes_topic: \"comfort2mqtt/counter1\"
json_attributes_template: \'{{ value_json | tojson }}\'
min: 20 # Define the minimum allowed value
max: 40 # Define the maximum allowed value
step: 1 # Define the increment step
unit_of_measurement: \"C\"
optimistic: false
The slider can be moved to adjust the setpoint.
In order to display the ssetpoint as a slider, the Mushroom card can be used. This is downloaded by HACS.
to use the mushrrom card, go to the dashboard, Add Card by pressng + on botom right, search for mushroom card
for Number card select the Temperature setpoint entity under Entities dropdown lidt
to display the Temperature enable button based on Flag 1, the mqtt light plaform can be used as it is read and write
mqtt:
light:
- name: temperature Enable
unique_id: \"temperature_enable\"
state_topic: \"comfort2mqtt/flag1\"
state_value_template: \'{{ value_json.State }}\'
command_topic: \"comfort2mqtt/flag1/set\"
availability_topic: \"comfort2mqtt/alarm/online\"
#json_attributes_topic: \"comfort2mqtt/flag1\"
#json_attributes_template: \'{{ value_json | tojson }}\'
payload_on: \"1\"
payload_off: \"0\"
payload_available: \"1\"
payload_not_available: \"0\"
qos: 0
retain: false
the above temperature enable was done using the Mushroom Light Card which allows better control of the display
to display the temperature alarm based on input 11 Virtual input use mqtt Binary sensor platform:
mqtt: binary sensor:
- name: Temperature Alarm
unique_id: \"comfort2_input11\"
state_topic: \"comfort2mqtt/input11\"
availability_topic: \"comfort2mqtt/alarm/online\"
value_template: \'{{ value_json.State }}\'
json_attributes_topic: \"comfort2mqtt/input11\"
json_attributes_template: \'{{ value_json | tojson }}\'
payload_on: \"1\"
payload_off: \"0\"
payload_available: \"1\"
payload_not_available: \"0\"
device_class: heat