BHT-6000 Thermostat (tuya) support

In my opinion, the best way to integrate into Home Assistant without using cloud services is to use this firmware - https://github.com/klausahrenberg/WThermostatBeca

Here is an example of how I integrated all my BHT-002-GBLW thermostats.

In thermostat web interface
Thermostat-hallway

climate:
  - platform: mqtt
    name: thermostat_hallway
    modes:
      - "heat"
      - "auto"
      - "off"
    initial: 5
    mode_command_topic: "home/hallway/thermostat/set/mode"
    temperature_command_topic: "home/hallway/thermostat/set/targetTemperature"
    mode_state_topic: "home/hallway/thermostat/properties"
    mode_state_template: >-
      {% if value_json.deviceOn == false %}
        off
      {% else %}
        {% if value_json.schedulesMode == 'auto' %}
          auto
        {% elif value_json.schedulesMode == 'off' %}
          heat
        {% endif %}
      {% endif %}
    current_temperature_topic: "home/hallway/thermostat/properties"
    current_temperature_template: "{{ value_json.floorTemperature }}"
    temperature_state_topic: "home/hallway/thermostat/properties"
    temperature_state_template: "{{ value_json.targetTemperature }}"
    json_attributes_topic: "home/hallway/thermostat/properties/schedules"
    min_temp: 5
    max_temp: 35
    temp_step: 0.5
automation:
  - alias: "hvac hallway"
    trigger:
      platform: mqtt
      topic: "home/hallway/thermostat/set/mode"
    action:
      - service: mqtt.publish
        data_template:
          topic: "home/hallway/thermostat/set/"
          payload: >
            {% if trigger.payload == "auto" %}
            '{"deviceOn":"true", "schedulesMode":"auto"}'
            {% elif trigger.payload == "heat" %}
            '{"deviceOn":"true", "schedulesMode":"off"}'
            {% elif trigger.payload == "off" %}
            '{"deviceOn":"false"}'
            {% else %}
            '{"deviceOn":"false"}'
            {% endif %}
switch:
  - platform: "mqtt"
    name: Lock buttons hallway
    icon: mdi:lock
    state_topic: "home/hallway/thermostat/properties"
    value_template: "{{ value_json.locked }}"
    payload_off: "false"
    payload_on: "true"
    state_off: false
    state_on: true
    command_topic: "home/hallway/thermostat/set/locked"

  - platform: "mqtt"
    name: Eco mode hallway
    icon: mdi:tree-outline
    state_topic: "home/hallway/thermostat/properties"
    value_template: "{{ value_json.ecoMode }}"
    payload_off: "false"
    payload_on: "true"
    state_off: false
    state_on: true
    command_topic: "home/hallway/thermostat/set/ecoMode"

Actually that’s all. The schedule is a bit more complicated since I had to create a lot of variables.

input_number:
  work_temp_1:
    name: "Темп. 1"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  work_temp_2:
    name: "Темп. 2"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  work_temp_3:
    name: "Темп. 3"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  work_temp_4:
    name: "Темп. 4"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  work_temp_5:
    name: "Темп. 5"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  work_temp_6:
    name: "Темп. 6"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  saturday_temp_1:
    name: "Темп. 1"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  saturday_temp_2:
    name: "Темп. 2"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  saturday_temp_3:
    name: "Темп. 3"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  saturday_temp_4:
    name: "Темп. 4"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  saturday_temp_5:
    name: "Темп. 5"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  saturday_temp_6:
    name: "Темп. 6"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  sunday_temp_1:
    name: "Темп. 1"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  sunday_temp_2:
    name: "Темп. 2"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  sunday_temp_3:
    name: "Темп. 3"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  sunday_temp_4:
    name: "Темп. 4"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  sunday_temp_5:
    name: "Темп. 5"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

  sunday_temp_6:
    name: "Темп. 6"
    min: 5
    max: 35
    step: 1
    mode: box
    icon: "mdi:temperature-celsius"
    unit_of_measurement: "°C"

input_datetime:
  work_time_1:
    name: Время вкл.
    has_date: false
    has_time: true

  work_time_2:
    name: Время вкл.
    has_date: false
    has_time: true

  work_time_3:
    name: Время вкл.
    has_date: false
    has_time: true

  work_time_4:
    name: Время вкл.
    has_date: false
    has_time: true

  work_time_5:
    name: Время вкл.
    has_date: false
    has_time: true

  work_time_6:
    name: Время вкл.
    has_date: false
    has_time: true

  saturday_time_1:
    name: Время вкл.
    has_date: false
    has_time: true

  saturday_time_2:
    name: Время вкл.
    has_date: false
    has_time: true

  saturday_time_3:
    name: Время вкл.
    has_date: false
    has_time: true

  saturday_time_4:
    name: Время вкл.
    has_date: false
    has_time: true

  saturday_time_5:
    name: Время вкл.
    has_date: false
    has_time: true

  saturday_time_6:
    name: Время вкл.
    has_date: false
    has_time: true

  sunday_time_1:
    name: Время вкл.
    has_date: false
    has_time: true

  sunday_time_2:
    name: Время вкл.
    has_date: false
    has_time: true

  sunday_time_3:
    name: Время вкл.
    has_date: false
    has_time: true

  sunday_time_4:
    name: Время вкл.
    has_date: false
    has_time: true

  sunday_time_5:
    name: Время вкл.
    has_date: false
    has_time: true

  sunday_time_6:
    name: Время вкл.
    has_date: false
    has_time: true
input_select:
  thermostat:
    name: Выберите термостат
    options:
      - Прихожая
      - Ванная
      - Балкон

There are many repetitions in this automation, but do not know how to do better.

automation:
  - alias: "read status at system startup"
    initial_state: true
    trigger:
      - platform: homeassistant
        event: start
    action:
      - service: mqtt.publish
        data_template:
          topic: home/hallway/thermostat/properties/schedules
          payload: ""

  - alias: "reading thermostat status"
    initial_state: true
    trigger:
      platform: state
      entity_id: input_select.thermostat
    action:
      #Work days###########################################################################################
      - service: input_number.set_value
        data_template:
          entity_id: input_number.work_temp_1
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w1t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.work_temp_2
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w2t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.work_temp_3
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w3t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.work_temp_4
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w4t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.work_temp_5
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w5t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.work_temp_6
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w6t') | float }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.work_time_1
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w1h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.work_time_2
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w2h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.work_time_3
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w3h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.work_time_4
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w4h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.work_time_5
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w5h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.work_time_6
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'w6h') ~ ":00" }}
      #Saturday###############################################################################################
      - service: input_number.set_value
        data_template:
          entity_id: input_number.sunday_temp_1
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u1t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.sunday_temp_2
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u2t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.sunday_temp_3
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u3t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.sunday_temp_4
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u4t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.sunday_temp_5
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u5t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.sunday_temp_6
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u6t') | float }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.sunday_time_1
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u1h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.sunday_time_2
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u2h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.sunday_time_3
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u3h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.sunday_time_4
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u4h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.sunday_time_5
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u5h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.sunday_time_6
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'u6h') ~ ":00" }}
      #Sunday#############################################################################################
      - service: input_number.set_value
        data_template:
          entity_id: input_number.saturday_temp_1
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a1t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.saturday_temp_2
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a2t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.saturday_temp_3
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a3t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.saturday_temp_4
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a4t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.saturday_temp_5
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a5t') | float }}
      - service: input_number.set_value
        data_template:
          entity_id: input_number.saturday_temp_6
          value: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a6t') | float }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.saturday_time_1
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a1h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.saturday_time_2
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a2h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.saturday_time_3
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a3h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.saturday_time_4
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a4h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.saturday_time_5
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a5h') ~ ":00" }}
      - service: input_datetime.set_datetime
        data_template:
          entity_id: input_datetime.saturday_time_6
          time: >
            {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
            {% set thermostat = "climate.thermostat_" ~ thermostats[states('input_select.thermostat')] %}
            {{ state_attr(thermostat, 'a6h') ~ ":00" }}
script:
  set_schedule_thermostats:
    alias: "Set Schedule Thermostats"
    sequence:
      service: mqtt.publish
      data_template:
        topic: >
          {% set thermostats = {'Прихожая': 'hallway', 'Ванная': 'bathroom', 'Балкон': 'balcony'} %}
          home/{{thermostats[states('input_select.thermostat')]}}/thermostat/set/schedules
        payload: >-
          {% set mydict = {
          "w1h": state_attr('input_datetime.work_time_1', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "w1t": states('input_number.work_temp_1')|int,
          "w2h": state_attr('input_datetime.work_time_2', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "w2t": states('input_number.work_temp_2')|int,
          "w3h": state_attr('input_datetime.work_time_3', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "w3t": states('input_number.work_temp_3')|int,
          "w4h": state_attr('input_datetime.work_time_4', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "w4t": states('input_number.work_temp_4')|int,
          "w5h": state_attr('input_datetime.work_time_5', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "w5t": states('input_number.work_temp_5')|int,
          "w6h": state_attr('input_datetime.work_time_6', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "w6t": states('input_number.work_temp_6')|int,

          "u1h": state_attr('input_datetime.sunday_time_1', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "u1t": states('input_number.sunday_temp_1')|int,
          "u2h": state_attr('input_datetime.sunday_time_2', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "u2t": states('input_number.sunday_temp_2')|int,
          "u3h": state_attr('input_datetime.sunday_time_3', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "u3t": states('input_number.sunday_temp_3')|int,
          "u4h": state_attr('input_datetime.sunday_time_4', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "u4t": states('input_number.sunday_temp_4')|int,
          "u5h": state_attr('input_datetime.sunday_time_5', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "u5t": states('input_number.sunday_temp_5')|int,
          "u6h": state_attr('input_datetime.sunday_time_6', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "u6t": states('input_number.sunday_temp_6')|int,

          "a1h": state_attr('input_datetime.saturday_time_1', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "a1t": states('input_number.saturday_temp_1')|int,
          "a2h": state_attr('input_datetime.saturday_time_2', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "a2t": states('input_number.saturday_temp_2')|int,
          "a3h": state_attr('input_datetime.saturday_time_3', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "a3t": states('input_number.saturday_temp_3')|int,
          "a4h": state_attr('input_datetime.saturday_time_4', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "a4t": states('input_number.saturday_temp_4')|int,
          "a5h": state_attr('input_datetime.saturday_time_5', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "a5t": states('input_number.saturday_temp_5')|int,
          "a6h": state_attr('input_datetime.saturday_time_6', 'timestamp') | int | timestamp_custom('%H:%M', false),
          "a6t": states('input_number.saturday_temp_6')|int
          } %}
          {{ mydict | tojson }}

And the last :slight_smile: in the interface, the control of the thermostat itself

cards:
  - entity: climate.thermostat_hallway
    name: Термостат в прихожей
    type: thermostat
  - cards:
      - entities:
          - entity: switch.lock_buttons_hallway
            name: Блок кнопок
        show_header_toggle: false
        type: entities
      - entities:
          - entity: switch.eco_mode_hallway
            name: Эко режим
        show_header_toggle: false
        type: entities
    type: horizontal-stack
type: vertical-stack

Schedule Cards Examples

cards:
  - cards:
      - entities:
          - entity: input_number.work_temp_1
        show_header_toggle: false
        type: entities
      - entities:
          - entity: input_datetime.work_time_1
        type: entities
    type: horizontal-stack
  - cards:
      - entities:
          - entity: input_number.work_temp_2
        show_header_toggle: false
        type: entities
      - entities:
          - entity: input_datetime.work_time_2
        show_header_toggle: false
        type: entities
    type: horizontal-stack
  - cards:
      - entities:
          - entity: input_number.work_temp_3
        show_header_toggle: false
        type: entities
      - entities:
          - entity: input_datetime.work_time_3
        show_header_toggle: false
        type: entities
    type: horizontal-stack
  - cards:
      - entities:
          - entity: input_number.work_temp_4
        show_header_toggle: false
        type: entities
      - entities:
          - entity: input_datetime.work_time_4
        show_header_toggle: false
        type: entities
    type: horizontal-stack
  - cards:
      - entities:
          - entity: input_number.work_temp_5
        show_header_toggle: false
        type: entities
      - entities:
          - entity: input_datetime.work_time_5
        show_header_toggle: false
        type: entities
    type: horizontal-stack
  - cards:
      - entities:
          - entity: input_number.work_temp_6
        show_header_toggle: false
        type: entities
      - entities:
          - entity: input_datetime.work_time_6
        show_header_toggle: false
        type: entities
    type: horizontal-stack
title: Рабочие дни
type: vertical-stack
cards:
  - cards:
      - entities:
          - entity: script.set_schedule_thermostats
            icon: 'mdi:file-move-outline'
            name: Задать расписание
          - entity: input_select.thermostat
        show_header_toggle: false
        title: Задание расписания термостатов
        type: entities
      - cards:
          - cards:
              - entities:
                  - entity: input_number.saturday_temp_1
                show_header_toggle: false
                type: entities
              - entities:
                  - entity: input_datetime.saturday_time_1
                type: entities
            title: Суббота
            type: horizontal-stack
          - cards:
              - entities:
                  - entity: input_number.saturday_temp_2
                show_header_toggle: false
                type: entities
              - entities:
                  - entity: input_datetime.saturday_time_2
                show_header_toggle: false
                type: entities
            type: horizontal-stack
          - cards:
              - entities:
                  - entity: input_number.saturday_temp_3
                show_header_toggle: false
                type: entities
              - entities:
                  - entity: input_datetime.saturday_time_3
                show_header_toggle: false
                type: entities
            type: horizontal-stack
          - cards:
              - entities:
                  - entity: input_number.saturday_temp_4
                show_header_toggle: false
                type: entities
              - entities:
                  - entity: input_datetime.saturday_time_4
                show_header_toggle: false
                type: entities
            type: horizontal-stack
          - cards:
              - entities:
                  - entity: input_number.saturday_temp_5
                show_header_toggle: false
                type: entities
              - entities:
                  - entity: input_datetime.saturday_time_5
                show_header_toggle: false
                type: entities
            type: horizontal-stack
          - cards:
              - entities:
                  - entity: input_number.saturday_temp_6
                show_header_toggle: false
                type: entities
              - entities:
                  - entity: input_datetime.saturday_time_6
                show_header_toggle: false
                type: entities
            type: horizontal-stack
        type: vertical-stack
    type: vertical-stack
type: vertical-stack

And same for sunday

4 Likes

Tuya Custom Components ! Does not work! Temps show double value & only whole numbers

I have a new HASS Pi system (core 109.2) and I use Smart life (Tuya) devices. I am able to set up the integration in the configuration.yaml file. The thermostats display current tempx2 (instead of 25degC they have 50DegC).
I did the GitHub solution to create "custom_components/tuya…folder and add all the files in the photo. See link: https://github.com/home-assistant/core/tree/dev/homeassistant/components/tuya
The problem is HASS starts with the error

What to do from here? Please help anyone.

Note: if I remove the manifest.json file…the integrations work BUT then I still have the same double temp & whole numbers problem…

The old fix is not more suitable, no updates where made (there was some major and costant changes in hass). There are all the info to make a new one and some tips on the discussion. The suggestion, if the device is compatible, is to upgrade to a different firmware (You lose the tuya platform and app but can handle everything via home assistant via mqtt - the andvantage is a full control also if the whole system is offline). The other way, that has no problem with home assistant (and also future upgrades), is to make a template sensor for temperature (that reports the temperature /2) and a custom thermostat (that uses data from the original integration and the template sensor described above). Is a messy workaround but can work. To get specific support open an issue on github about original tuya integration (that still have the doubled temperature issue)

ciao , prima di tutto complimenti. Sapresti darmi una dritta passo passo su come risolvere questo problema?Grazie mille

quale problema?

Ho seguito la tua guida riguardo al termostato . Non riesco a capire come procedere in quanto ho hassio installato su docker e anche installando l addon terminale l indirizzo wget che è nella guida non funziona

Come già scritto, il componente non è più supportato dalle versioni recenti di hass.
Nella discussione un altro utente ha fornito una versione più aggiornata ma credo che ad oggi non sia più supportata nemmeno quella.
Per praticità e ottimizzazione del risultato ci siamo spostati sulla modifica del firmware del termostato: https://github.com/klausahrenberg/ThermostatBecaWifi
Comunque ho verificato i link (anche se ormai inutili all’uso) e sono integri, con wget il file viene scaricato ma va poi rinominato correttamente.

ti ringrazio sei stato gentilissimo, proverò la procedura di flash del firmware. Ho visto che comunica con mqtt quindi basta mettere le credenziali di home assistant per gestire tutto da li?

Da questo posti in giù BHT-6000 Thermostat (tuya) support trovi le varie configurazioni (ed automazioni) usate/testate. Non so se con nuove versioni del firmware qualcosa sia cambiato (in meglio se mai, mi pare sia stato aggiunto l’OTA update che quando ho flashato io non c’era - e visto che funziona bene, su 3 dispositivi, lascio tutto com’è). Comunque da quel post in giù trovi tutti gli interventi anche di altri utenti.
Ricorda che con il flash del firmware perdi la possibilità di utilizzare l’app originale, ma gli stessi dati li vedi comunque da Hass, quindi se hai accesso esterno mantieni anche la funzionalità di telecontrollo. Negli snippet precedenti mi pare non sia trattato il setting della programmazione oraria (cronotermostato), puoi comunque farla dal dispositivo (il firmware tocca solo la parte della comunicazione) e se non vado errato nella pagina del firmware è specificato qualcosa in tal senso.
Di base con mqtt è molto meglio (sia come logica che come funzionalità).
Qui nella community ti consiglio di scrivere in inglese, ricevi molte più risposte

Hello all,
there is a way to know if the internal relè is closed or open? This means if is possible to know if the Device Climate have send the turn on command to the boiler.

In Italiano:
C’è un modo per sapere se il termostato ha inviato il consenso alla caldaia di accendersi. Ovvero non riesco a capire se posso intercettare lo stato del relè se chiuso o aperto

Ciao, non capisco cosa dici. IO ho lo stesso termostato senza alcuna modifica e funziona. a cosa ti riferisci?

C’è un modo per sapere se il termostato ha inviato il consenso alla caldaia di accendersi. Ovvero non riesco a capire se posso intercettare lo stato del relè se chiuso o aperto

Non direttamente. Lo stato del relè non può essere letto ma, sapendo che se la temperatura target è maggiore della temperatura ambiente il relè è chiuso, si può fare un binary sensor che te lo riporti.

La modifica serve per leggere il termostato in locale senza passare per i server tuya

Grazie,
però non so perchè il mio termostato chiude il relè quando la target è maggiore o uguale alla temperatura attuale di 1 grado e non di 0,5

E poi questo binary sensor andrebbe in stato on anche se il termostato è spento perchè le temperature le legge lo stesso

Sembra strano. vedi se nel menu ti fa regolare il treshold. O aggiungi lo 0,5 al template.

Spento in che senso?

In ormai due anni ho visto che si verificano problemi di report solo se all’avvio di HomeAssistant non sono presenti i due valori di temperatura, e si risolve da solo non appena vengono aggiornati. Ma non ho mai provato a vedere che dati vengono inviati quando si usa il modo “programma settimanale”, per praticità li faccio via automazioni.

Spento nel senso SPENTO. Anche da spento (cioè proprio turned off) home assitant legge lo stesso i valori impostati quindi se la temperatura di casa è scesa il sensore andrebbe su on anche se i termosifoni sono spenti perchè appunto il termostato non ha dato conenso essendo spento

Il BHT-6000 non può essere spento. Viene spento solo lo schermo, per tutto il resto è da considerarsi acceso. Se la temperatura scende sotto il valore soglia il relè chiude comunque. E’ comunque uno stato che puoi monitorare (lo stato dello schermo) e aggiungerlo con un “if” al template. Se invece vuoi essere certo dello stato della caldaia devi fare un altro circuito. il più semplice è ESP-01 + Relè, che se hai più termostati e più zone ti consente di conoscere lo stato della caldaia indipendentemente da quale termostato la commuta.

Il mio non si comporta così. Se lo spengo i termosifoni non si accendono mai ed è giusto che sia così. Sennò esco di casa per una settimana di vacanza e voglio lasciare i termosifoni spenti che faccio? Stacco i fili dal termostato?

No, come in tanti altri termostati si lascia in manuale con temperatura a 5°C. Io di BHT-6000 ne ho 3 e nessuno si comporta nel modo che descrivi. Se il tuo si comporta diversamente devi trovare soluzioni alternative per ricavare/dedurre il dato, se leggi la discussione c’è anche come vedere quali dati il termostato scambia con il server tuya e script python per leggere in locale il dato.