-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBHT-002GBLW Thermostat
97 lines (84 loc) · 3.65 KB
/
BHT-002GBLW Thermostat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
I used tuya-convert to convert this device to tasmota and then use mqtt to communicate with it.
This was done starting with the following:
https://github.com/klausahrenberg/WThermostatBeca
I was then led to a forked version here:
https://github.com/fashberg/WThermostatBeca
The actual conversion to tasmota was done using this:
https://github.com/ct-Open-Source/tuya-convert
All went smoothly, requiring no hardware.
It now provides a sensor of the floor temperature as well as the room temperature. Since my thermostat is not in the room
it was crucial to drive the control of the devie based upon the floor temperature sensor.
To get the device doing what I wanted I have the following bits of yaml
A climate device, I have created this because my objective is to control the heating based upon the temperature of
the floor sensor not the room temperature.
climate:
- platform: mqtt
name: OZ_Ensuite_Thermostat
availability_topic: "oz_ensuite/tele/LWT"
payload_available: "Online"
payload_not_available: "Offline"
action_topic: "oz_ensuite/stat/things/thermostat/properties"
# action_template: "{{value_json.action}}"
# extra code added here to get the display to show Idle when up to target temp. The current tasmota software always reports 'heat' when not off.
# even though the relay has switched off and the device itself is not indicating heating.
action_template: >
{% if (value_json.targetTemperature|float <= value_json.floorTemperature|float) and value_json.action == 'heating' %}
idle
{% else %}
{{value_json.action}}
{%endif%}
temperature_command_topic: "oz_ensuite/cmnd/things/thermostat/properties/targetTemperature"
temperature_state_topic: "oz_ensuite/stat/things/thermostat/properties"
temperature_state_template: "{{value_json.targetTemperature}}"
# set current temp to temp of floor sensor not room temp sensor
current_temperature_topic: "oz_ensuite/stat/things/thermostat/properties"
current_temperature_template: "{{value_json.floorTemperature}}"
away_mode_command_topic: "oz_ensuite/cmnd/things/thermostat/properties/ecoMode"
away_mode_state_topic: "oz_ensuite/stat/things/thermostat/properties"
away_mode_state_template: "{{value_json.ecoMode}}"
mode_command_topic: "oz_ensuite/cmnd/things/thermostat/properties/mode"
mode_state_topic: "oz_ensuite/stat/things/thermostat/properties"
mode_state_template: "{{value_json.mode}}"
payload_on: "true"
payload_off: "false"
modes: [ "heat", "auto","idle", "off" ]
min_temp: 5
max_temp: 35
temp_step: 0.5
precision: 0.5
An example of a switch:
switch:
# BHT-002 GBLW thermostat control
- platform: mqtt
unique_id: oz_ensuite_switch
name: "Oz Ensuite Thermostat Switch"
state_topic: "oz_ensuite/stat/things/thermostat/properties"
value_template: >
{{ value_json.deviceOn }}
command_topic: "oz_ensuite/cmnd/things/thermostat/properties/mode"
payload_on: 'heat'
payload_off: 'off'
state_on: true
state_off: false
optimistic: false
qos: 0
retain: true
An example of a sensor:
sensor:
- platform: mqtt
name: oz_ensuite_target_temperature
state_topic: "oz_ensuite/stat/things/thermostat/properties"
value_template: >
{{ value_json.targetTemperature }}
unit_of_measurement: '°C'
device_class: temperature
An example action for an automation:
action:
# set the heating to the target temp
- service: mqtt.publish
data_template:
topic: "oz_ensuite/cmnd/things/thermostat/properties/targetTemperature"
payload: >
{{ states('sensor.floor_target_temp')|float }}
qos: 0
retain: true