Control MCZ Maestro pellet stove via HACore trough MQTT

Hi elzinc,

I experience the exact same issue, did you already solve it?

Hi,
I was also struggling with the MQTT. I had it working but after an upgrade it broke again. For the people who connects through the cloud you really must look to te configuration. Mine is like this:

USE_MCZ_CLOUD: true
MQTT_ip: 192.168.0.23
MQTT_port: '1883'
MQTT_authentication: 'True'
MQTT_user: homeassistant
MQTT_pass: verrylongpass
MQTT_TOPIC_SUB: Maestro/Command
MQTT_TOPIC_PUB: Maestro/State
MQTT_PAYLOAD_TYPE: TOPIC
WS_RECONNECTS_BEFORE_ALERT: '5'
MCZip: 192.168.120.1
MCZport: '81'
MCZ_device_serial: 'serialnumber'
MCZ_device_MAC: MACadress
MCZ_App_URL: http://app.mcz.it:9000

The info for MQTT can you find in the mqt intergration. go to intergrations and choose config on the Mosquitto broker panel. then choose re-configure MQTT. This will open a screen with your login info.

I also run a program called MQTT-Explorer-0.4.0-beta1 as a standalone program for sniffing the MQTT server. When you start this program you have to enter the credentials for the connection. After that you will see the Maestro topic. This can take a minute before it shows.

If that works well then you can add a sensor to the configuration.yaml.

sensor:
  - platform: mqtt
    name: "Kachel Alles"
    state_topic: "Maestro/State"
    value_template: "{{ value_json['Etat du poele'] }}"
    json_attributes_topic: "Maestro/State"

This will contain all posible objects with their values.

I have now a dashboard like this:

Greets Hank

2 Likes

Hello
Can you share your lovelace ?

of course

configuration.yaml

sensor:
  - platform: mqtt
    name: "Kachel Alles"
    state_topic: "Maestro/State"
    value_template: "{{ value_json['Etat du poele'] }}"
    json_attributes_topic: "Maestro/State"
  - platform: mqtt
    name: "Kachel Status van de kachel"
    state_topic: "Maestro/State"
    value_template: >
      {% if value_json['Etat du poele'] == 'Eteint' %}
      Uit
      {% else %}
      Aan
      {% endif %}
  - platform: mqtt
    name: "Kachel Temperatuur kamer"
    state_topic: "Maestro/State"
    unit_of_measurement: "°C"
    value_template: "{{ value_json['Temperature ambiante'] }}"
  - platform: mqtt
    name: "Kachel Temperatuur ingesteld"
    state_topic: "Maestro/State"
    unit_of_measurement: "°C"
    value_template: "{{ value_json['TEMP - Consigne'] }}"
  - platform: mqtt
    name: "Kachel power staat"
    state_topic: "Maestro/State"
    value_template: >
      {% if value_json['Puissance Active'] == 'Puissance 1' %}
      Power 1
      {% elif value_json['Puissance Active'] == 'Puissance 2' %}
      Power 2
      {% elif value_json['Puissance Active'] == 'Puissance 3' %}
      Power 3
      {% elif value_json['Puissance Active'] == 'Puissance 4' %}
      Power 4
      {% elif value_json['Puissance Active'] == 'Puissance 5' %}
      Power 5
      {% else %}
      "{{ value_json['Puissance Active'] }}"
      {% endif %}
  - platform: mqtt
    name: "Kachel Vis Sans Fin"
    state_topic: "Maestro/State"
    value_template: "{{ value_json['RPM - Vis sans fin - LIVE'] }}"
  - platform: mqtt
    name: "Kachel Bougie"
    state_topic: "Maestro/State"
    value_template: >
      {% if value_json['Etat de la bougie'] == 'Ok' %}
      Uit
      {% else %}
      Aan
      {% endif %}
  - platform: mqtt
    name: "Kachel Status van de kachel"
    state_topic: "Maestro/State"
    value_template: >
      {% if value_json['Etat du poele'] == 'Eteint' %}
      Kachel uit
      {% elif value_json['Etat du poele'] == 'Controle du poele froid / chaud' %}
      Controle koud of warm
      {% elif value_json['Etat du poele'] == 'Start 2 Froid' %}
      Koude start 2
      {% elif value_json['Etat du poele'] == 'Clean Froid' %}
      Schoonmaak koud
      {% elif value_json['Etat du poele'] == 'Load Froid' %}
      Koude lading
      {% elif value_json['Etat du poele'] == 'Start 1 Froid' %}
      Koude start 1
      {% elif value_json['Etat du poele'] == 'Start 2 Froid' %}
      Koude start 2
      {% elif value_json['Etat du poele'] == 'Clean Chaud' %}
      Schoonmaak warm
      {% elif value_json['Etat du poele'] == 'Load Chaud' %}
      Warme lading
      {% elif value_json['Etat du poele'] == 'Start 1 chaud' %}
      Warme start 1
      {% elif value_json['Etat du poele'] == 'Start 2 chaud' %}
      Warme start 2
      {% elif value_json['Etat du poele'] == 'Stabilisation' %}
      Stabilisatie
      {% elif value_json['Etat du poele'] == 'Puissance 1' %}
      Power 1
      {% elif value_json['Etat du poele'] == 'Puissance 2' %}
      Power 2
      {% elif value_json['Etat du poele'] == 'Puissance 3' %}
      Power 3
      {% elif value_json['Etat du poele'] == 'Puissance 4' %}
      Power 4
      {% elif value_json['Etat du poele'] == 'Puissance 5' %}
      Power 5
      {% elif value_json['Etat du poele'] == 'Extinction' %}
      Uitgaan
      {% else %}
      "{{ value_json['Etat du poele'] }}"
      {% endif %}

switch:
  # Switch Poele On Off
  - platform: mqtt
    name: Kachel aan uit
    state_topic: "Maestro/State"
    value_template: >
      {% if value_json['Etat du poele'] == 'Eteint' %}
      off
      {% else %}
      on
      {% endif %}
    state_on: "on"
    state_off: "off"
    command_topic: "Maestro/Command"
    payload_on: "34,1"
    payload_off: "34,40"

Scripts with yaml through the gui yaml editor
the first

alias: Kachel 1 kouder
sequence:
  - service: mqtt.publish
    data:
      topic: Maestro/Command
      payload: >-
        42,{% set state = states('sensor.kachel_temperatuur_ingesteld') %}{{
        state | float | round - 1 if is_number(state) }}
mode: single
icon: mdi:thermometer-chevron-down

and the other one


alias: Kachel 1 warmer
sequence:
  - service: mqtt.publish
    data:
      topic: Maestro/Command
      payload: >-
        42,{% set state = states('sensor.kachel_temperatuur_ingesteld') %}{{
        state | float | round + 1 if is_number(state) }}
mode: single
icon: mdi:thermometer-chevron-up


and the lovelace yaml also through the gui yaml editor

   - icon: mdi:fire
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: button
            tap_action:
              action: toggle
            entity: switch.kachel_aan_uit
            icon_height: 80px
            icon: mdi:fire
            show_state: true
            show_name: true
          - type: horizontal-stack
            cards:
              - type: button
                tap_action:
                  action: toggle
                entity: script.kachel_1_warmer
                name: 1 °C warmer
              - type: entity
                entity: sensor.kachel_temperatuur_ingesteld
                name: Doel Temp
              - type: button
                tap_action:
                  action: toggle
                entity: script.kachel_1_kouder
                name: 1 °C kouder
          - type: horizontal-stack
            cards:
              - type: entity
                entity: sensor.kachel_temperatuur_kamer
                name: Kamer temperatuur
              - type: entity
                entity: sensor.kachel_bougie
                name: Status Bougie
          - type: entity
            entity: sensor.kachel_status_van_de_kachel_2
            name: Status van de kachel
          - type: entity
            entity: sensor.kachel_vis_sans_fin
            name: Toeren schroef

hey guys, i think i have a little problem with the mqtt configuration. i user seb_lz script with local connection. in the logs i can the the values from the stove, so the addon is working well. i installed the mosquitto broker and added mqtt to homeassistant. if i use the exemple sensors i just get “unknown” state.

Update: now it is working - i updated my ha, after the reboot the mqtt integration asked for username/password again, after that the sensors become available

1 Like

I’ve been trying to integrate the Globe fire Wiona for some time, but someone has already managed to do it without success.

does anyone knows how to get the state from the pellet level sensor? i get a warning in the mcz app when the pellets getting empty and i like to have a boolean sensor in ha for the warning.

Using cloud the Command payload seems to no longer have any effect. The command for on/off has been working well for ages, but recently stopped. Can see the message going through in the logs but no change to the stove itself. Any changes?

did you manage to workaround this?

Yes, sorry should have posted here. I read back through the code. The payload now needs to include the prefix 0 for on. You probably have also spotted the removal of the ^ on Etat

    payload_on: 34,01

Well this is strange… mine works fine, still today, with payload “34,1”:

- platform: mqtt
    name: Maestro
    state_topic: "Maestro/State"
    value_template: >
      {% if value_json['Etat du poele'] == 'Eteint' %}
      off
      {% else %}
      on
      {% endif %}
    state_on: "on"
    state_off: "off"
    command_topic: "Maestro/Command"
    payload_on: "34,1"
    payload_off: "34,40"
1 Like

just want to check again, does this works without any Cloud Integration straight connecting to the stove? IF so are all MCZ Modells with Wifi supported by HA?

For local connection you need to bridge the direct wifi connection from the stove to your internal network which is not as straight forward. The commands are then slightly different.

1 Like

hello,

I have been using the MCZ script (GitHub - SebLz/ha-addons) in cloud mode for 2-3 months. thank you for this addon it’s great. after a HAOS 2022.4.7 and MQTT 6.0.2 update ==> the sensor returns the unknown value. the MCZ logs are OK, I see the feedback. did you encounter the problem? the restore does not correct the problem. how can i debug?

config MCZ addon

"MQTT_TOPIC_SUB": "Maestro/Command/"
"MQTT_TOPIC_PUB": "Maestro/"

log MCZ:
2022-05-01 08:43:37,769 :root :: INFO :: Publication sur le topic MQTT Maestro/ le message suivant : {“Etat du poele”: “Puissance 1”, “Etat du ventilateur ambiance”: “Automatique”, “Etat du ventilateur canalise 1”: “Desactive”, “Etat du ventilateur canalise 2”: “Desactive”, “Temperature des fumees”: 119, “Temperature ambiante”: 20.5, “Puffer Temperature”: 255, “Temperature chaudiere”: 0, “Temperature NTC3”: 255, “Etat de la bougie”: “Ok”, “ACTIVE - Set”: 135, “RPM - Ventilateur fummees”: 887, “RPM - Vis sans fin - SET”: 169, “RPM - Vis sans fin - LIVE”: 169, “Brazero”: [“Code inconnu :”, “255”], “Profil”: “Manuel”, “Etat du mode Active”: “On”, “ACTIVE - Live”: 137, “Mode de regulation”: “Dynamique”, “Mode ECO”: “Off”, “Silence”: “Off”, “Mode Chronotermostato”: “Off”, “TEMP - Consigne”: 14.0, “TEMP - Boiler”: 70, “TEMP - Carte mere”: 28.0, “Puissance Active”: “Puissance 1”, “Heure du poele (0-23)”: 8, “Minutes du poele (0-29)”: 47, “Jour du poele (1-31)”: 1, “Mois du poele (1-12)”: 5, “Annee du poele”: 2022, “Heures de fonctionnement total (s)”: “164:0:5:8”, “Heures de fonctionnement en puissance 1 (s)”: “134:14:39:52”, “Heures de fonctionnement en puissance 2 (s)”: “0:12:53:51”, “Heures de fonctionnement en puissance 3 (s)”: “0:5:56:39”, “Heures de fonctionnement en puissance 4 (s)”: “0:4:25:42”, “Heures de fonctionnement en puissance 5 (s)”: “2:7:20:42”, “Heures avant entretien”: 661, “Minutes avant extinction”: 0, “Nombre d’allumages”: 1192, “Sonde Pellets”: “Sonde pas active”, “Effet sonore”: “Off”, “Etat effets sonores”: “On”, “Sleep”: “Off”, “Mode”: “Hiver”, “Sonde wifi temperature 1”: 39, “Sonde wifi temperature 2”: 255, “Sonde wifi temperature 3”: 255, “Inconnu”: 255, “Set Puffer”: 64, “Set Boiler”: 50, “Set Health”: 255, “Temperature retour”: 255, “Antigel”: “On”}

config sensor

  • platform: mqtt
    name: “Maestro_Etat_poele”
    unique_id: Maestro_Etat_poele
    state_topic: “Maestro/”
    value_template: “{{ value_json[‘Etat du poele’] }}”

Hello @imcaro,

try changing

"MQTT_TOPIC_PUB": "Maestro/"

to

"MQTT_TOPIC_PUB": "Maestro/State"

(and same for state_topic in config sensor)

This could be due to the trailing slash in the mqtt topic (cf: MQTT seems to have broken with latest 6.0.1 update · Issue #2020 · home-assistant/addons · GitHub)

I applied “Maestro/State” in the config + sensor

but the problem persists, the sensors remain in an unknown state

Hi there,
Very impressive work!
I am totally new to this, so it may be a simple mistake… However, I struggle with getting a cloud connection with SebLz addon. Seems to be refused?!

HA on virtualbox, WIN10 - working fine with other automations…
MQTT is up and running.

I hope you have some suggestions to where I went wrong/could try different things.

BW, Jesper

This is the log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:12:33] INFO: Launching maestro cloud connection plugin
2022-05-14 19:12:33,789 :root :: INFO :: Lancement du deamon
2022-05-14 19:12:33,790 :root :: INFO :: Anthony L. 2019
2022-05-14 19:12:33,790 :root :: INFO :: Pipolaq's version
2022-05-14 19:12:33,790 :root :: INFO :: Niveau de LOG : DEBUG
2022-05-14 19:12:33,790 :engineio.client :: INFO :: Attempting polling connection to http://app.mcz.it:9000/socket.io/?transport=polling&EIO=3
2022-05-14 19:12:33,793 :urllib3.connectionpool :: DEBUG :: Starting new HTTP connection (1): app.mcz.it:9000
2022-05-14 19:12:38,799 :engineio.client :: INFO :: HTTP GET request to http://app.mcz.it:9000/socket.io/?transport=polling&EIO=3&t=1652548353.7908173 failed with error HTTPConnectionPool(host='app.mcz.it', port=9000): Max retries exceeded with url: /socket.io/?transport=polling&EIO=3&t=1652548353.7908173 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f360dd6e410>: Failed to establish a new connection: [Errno -3] Try again')).
Traceback (most recent call last):
  File "/maestro/cloud/maestro.py", line 229, in <module>
    sio.connect(_MCZ_App_URL)
  File "/usr/local/lib/python3.7/site-packages/socketio/client.py", line 280, in connect
    raise exceptions.ConnectionError(exc.args[0]) from None
socketio.exceptions.ConnectionError: Connection refused by the server
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

This is the config - serial and macadress changed of course.

USE_MCZ_CLOUD: true
MQTT_ip: core-mosquitto
MQTT_port: '1883'
MQTT_authentication: 'True'
MQTT_user: jesper
MQTT_pass: password
MQTT_TOPIC_SUB: Maestro/Command
MQTT_TOPIC_PUB: Maestro/State
MQTT_PAYLOAD_TYPE: TOPIC
WS_RECONNECTS_BEFORE_ALERT: '5'
MCZip: 192.168.120.1
MCZport: '81'
MCZ_device_serial: '11111111'
MCZ_device_MAC: 11aa22bb33cc
MCZ_App_URL: http://app.mcz.it:9000

Hi @Seb_Lz

As I’m using HA Core I’m not able to install addons to my HA Instance.
Would it be possible to make your addon available trough HACS?

Today my RPI died and as I have to start over anyway I’d better start using your integration.

Thanks in advance!

Kim

Hi, I’m afraid I won’t have time to do that, besides I’m not sure it really makes sense to duplicate this feature in HACS. Isn’t it possible for you to move to a supervised HA install or HassOS (Installation - Home Assistant) ?

Hi,

Not an option here (running on a Mac server in venv)
I reinstalled a rpi in the meantime and did it the old fashioned way…
It would’ve been more logical if you’d made it to work with hacs from the beginning. Then it would’ve worked on every installation method but I understand it’s too much work now.