Sooo...
Another thing that you should consider looking at in your KCS firmware is that the temp and humidity sensor values do not update unless you trigger an input or output of the relay. An MQTT message should be sent on value change of the sensor data according to the threshold set.
I solved it with an automation in Home Assistant that periodically publishes a command to the SET topic with the following payload to update all values available through MQTT:
If anyone is wondering how to get the sensor values in HA, here's the code to add in your configuration.yaml file. Note that it's "humity", not "humidity" as one would expect.
Another thing that you should consider looking at in your KCS firmware is that the temp and humidity sensor values do not update unless you trigger an input or output of the relay. An MQTT message should be sent on value change of the sensor data according to the threshold set.
I solved it with an automation in Home Assistant that periodically publishes a command to the SET topic with the following payload to update all values available through MQTT:
Code:
'{"get_datas":{"value":true}}'
If anyone is wondering how to get the sensor values in HA, here's the code to add in your configuration.yaml file. Note that it's "humity", not "humidity" as one would expect.
Code:
sensor:
- name: "sensor1-temperature"
unique_id: sensor1-temperature
state_topic: "KC868_A8/24XXC3AFXXXX/STATE"
device_class: temperature
unit_of_measurement: " °C"
value_template: '{{ value_json.sensor1.temperature }}'
- name: "sensor1-humidity"
unique_id: sensor1-humidity
state_topic: "KC868_A8/24XXC3AFXXXX/STATE"
device_class: humidity
unit_of_measurement: " %"
value_template: '{{ value_json.sensor1.humity }}'