Support for zont-online thermostat

Unfortunately all the description is only in Russian…

  1. Thermostat for remote control of heating with built-in Wi-Fi or GPRS module.
  2. Link to the provider or manufacturer’s product or service page:
    https://zont-online.ru/internet-magazin/termostaty
  3. API :
    https://zont-online.ru/api/docs/
    This thermostat has support in other smart home systems such as ioBroker, HomeBridge, majordomo
    I would like to see his support and Home Assistant

I have integrated my Zont Expert module into HA using “rest” and “rest_command” platforms.
The same way you can use for other Zont devices.

I. Getting zont api credentials and device parameters structure.

  1. Download Advanced REST Client (or install their Chrome plugin) to learn how to create and test API requests.

  2. Encode your zont login:password into Base64 format using any online base64-encoder.

  3. Use ARC to get your token.
    Send POST-request to https://zont-online.ru/api/get_authtoken
    using headers

content-type: application/json
authorization: Basic XXXXXXXXXX
x-zont-client: your@email

(XXXXXXXXXX - is your base 64-encoded login:password from step 2
your@email - is your email assotiated with your zont account)

  1. Find “token”: “yyyyyyyyyyyyyyyyyyyy” in request output.
    Now you have credentials for all your zont api requests:
    x-zont-client: your@email
    x-zont-token: yyyyyyyyyyyyyyyyyyyy

  2. Use ARC to get all your device parameters.
    Send POST-request to https://zont-online.ru/api/devices
    using headers

content-type: application/json
x-zont-client: your@email
x-zont-token: yyyyyyyyyyyyyyyyyyyy

and body

{"load_io":true}
  1. Now you have all your device parameters, modes, settings, etc. in request output.

  2. Find your device id (for example “id”: 12345), your termometers and other settings you need and copy their json-ways (for example, devices[0].thermometers[0].last_value - is your first device first termometer, devices[0].thermometers[1].last_value - your first device second termometer, devices[1].balance.value - your second device balance, etc). It’s recommended to use any online json-editor to view raw-text and tree-based json structure.

II. Integrating into HA - sensors and commands.

  1. Copy zont api credentials in your secrets.yaml (if you do not have this file you should create it in /config folder where your configuration.yaml is located):
x_zont_client: your@email
x_zont_token: yyyyyyyyyyyyyyyyyyyy
  1. Create zont rest/template sensor.
sensor:
  - platform: rest
    resource: https://zont-online.ru/api/devices
    name: zont
    method: POST
    timeout: 30
    scan_interval: 10
    force_update: true
    headers:
      X-ZONT-Client: !secret x_zont_client
      X-ZONT-Token: !secret x_zont_token
      Content-Type: application/json
    payload: '{"load_io": true}'
    value_template: '{{ value_json.ok }}'
    json_attributes:
      - devices
  - platform: template
    sensors:
      # Your sensor name
      zont_external_temp:
        # You can find your devices[X] and thermometers[Y] numbers in step 7
        value_template: '{{ states.sensor.zont.attributes.devices[0].thermometers[0].last_value }}'
        device_class: temperature
        # Your sensor friendly name
        friendly_name: 'Outside temperature'
        unit_of_measurement: '°C'
  1. Create zont rest command.
rest_command:
  # Your command name
  zont_set_comfort:
    url: https://zont-online.ru/api/update_device
    method: POST
    headers:
      X-ZONT-Client: !secret x_zont_client
      X-ZONT-Token: !secret x_zont_token
      Content-Type: application/json
    # Setting "Comfort" mode for device id 12345
    payload: '{"device_id":12345,"thermostat_mode":"comfort"}'
  1. After HA restart you will have new sensor.zont_external_temp and rest_command.zont_set_comfort

  2. Create other sensors and commands you need.

2 Likes

Hi Kirill

Thank you for this tutorial. Successfully added my Zont H2 into HA with temperature, working mode and online status. However I stuck with adding boiler mode (active or not). Would you help me?

The first one is mode

  - platform: template
    sensors:
      zont_mode:
        value_template: '{{ states.sensor.zont.attributes.devices[0].thermostat_ext_mode }}'
        friendly_name: "Режим"
  - platform: template
    sensors:
      zont_boiler:
        value_template: '{{ states.sensor.zont.attributes.devices[0].io["boiler-state"].state }}'
        friendly_name: "Горелка"

first one working. Second one not

Попробуй так…

- platform: template
  sensors:
    zont_thermostat_time_state:
      value_template: '{{ states.sensor.zont.attributes.devices[0].io["last-boiler-state"]["boiler_work_time"] }}'

- platform: template
  sensors:
    zont_thermostat_state:
      value_template: >-
        {% if states('sensor.zont_thermostat_time_state') | int > 0 %}
          on
        {% elif states('sensor.zont_thermostat_time_state') | int == 0 %}
          off
        {% else %}
          unknown
        {% endif %}

Thanks. But it says “off” all the time no matter if heater is on or off (Спасибо! но ХА пишет off вне зависимости от фактического статуса горелки)

What is the value of sensor.zont_thermostat_time_state ?

Status is unavailable

Problem wasn’t there, but you pointed me into right direction. i had few spaces here.

    payload: '{"load_io": true}'

Deleted and both codes are working. Your code as well. Thank you very much!

Hello. Do you have settings for full control ZONT H2? I don't know how to use rest_command. I need choose temperature + or - with display it. Tried it with using -climate-, but without result. Could you please me with final code for control ZONT H2?

try rest command like this

zont_set_off:
url: https://zont-online.ru/api/update_device
method: POST
headers:
X-ZONT-Client: !secret x_zont_client
X-ZONT-Token: !secret x_zont_token
Content-Type: application/json
payload: ‘{“device_id”:20589,“thermostat_ext_mode”:3}’
device_id change
good article about H2

Is there any possibility of local control of the ZONT device, not via the Internet?

Существует какая то возможность локального управления устройством ZONT, не через интернет?

Нет такой возможности. Только через облако.

Но ведь по протоколу rs485 можно управлять локально термостатом ZONT H2000+ панелью ZONT МЛ753 и локально по WiFi панелью ZONT МЛ753WiFi.