Gas fireplace (Mertik Maxitrol) with rfxtrx

There is this protocol between the app and the wifi module, as the wifi module is expensive, i wanted to replace it with esp.

The wifi module has a access point, and we can connect the app to wifi module for controlling the devices using its access point.

First i programmed the esp in accesspoint, but the app is not getting connected to it, and Hense i cannot automate the device.

What i have a this protocol(they(mertik maxitrol) named confidential but somehow i manged to get it.)

Now i want to make esp to work as this wifi module. I dont know how. Totally noob here. Please guide me.

I am attaching the picture for further understanding.

If this link helps in anyways

Have you started working with esp ? OR do you know how to emulate esp as this wifi module?

have you managed integrating the wifi module into ha ?

Yes and no. I migrated the Homey code to Python and that works, but then came summer and no use of the fireplace.

Interested in a public HA integration?

3 Likes

Hello

Yes please it could be great

1 Like

Alpha version ready. Anyone that want to help test it?

image

3 Likes

Hi, this seems like just the thing I have been waiting for. So nice that you are doing this and sharing.

I am not the best in coding, but I am very interested in this intergrations. I have the wifi-module (B6R-WWN) and if I can be at any service in testing this. Then I am up for it.

Yes please. We have a Bellfires fireplace with the WiFi-module (B6R-W2BE-0).

@dkvistgaard @wilfredktlr thank you for the interest. Unfortunately I found some critical bugs that I must sort out first - hopefully ready by the end of Sunday. I will get back to you

No problem. My first idea was to take the code from the Homey implementation and create a Home Assistant integration myself. To accomplish this I did the following to test if sending a raw TCP-packets to WiFi-module works.

  • Start a packet capture on my firewall (which sits in between my phone and WiFi-module)
  • Use the Android app from Bellfires on my phone to turn on/off the light of the fireplace
  • Send the same packets to turn on/off the light using https://packetsender.com/
  • Great success…! :wink:

PS. I found this topic some time ago but recently I saw your post about the integration. Do you have a repo you can maybe share with me so I can take a look at your code? I am not a Python but a C# programmer (by occupation). So reading and understanding the code won’t be a problem. :nerd_face:

I ported the Homey version to a Python module. Just need to sort the logic between HA entities and the status of the fireplace

Anyone got the fan speed working with bellfire mertik maxitrol? i already have fireplace on/off, flame higher and lower, light on/off and light higher and lower only missing fan speed. im using broadlink rm4 pro.

@dkvistgaard @wilfredktlr and others with the Mertik wifi module: I have released the alpha version of the Mertik Maxitrol integration here:

Open todo’s:

  • Move mertik.py to a python module with own repo
  • Change I/O calls to async I/O calls
  • Add to HACS repository for even easier installation
  • Move Entities to a single Device / Platform
  • Implement Zero Conf / autodetect IP

Thanks. I will try to take a look at it this week and let you know what I find. One thing I did already find is a hardcoded IP address.

PS. If you want I can write the Dutch translation. If so I’ll fork your repository and create a pull request.

I can’t believe this is finally coming together! Thank you @djerik ! Installing and testing now…

:cry: : Unfortunately it’s not working for me… gutted. I have a B6R-W2MR-0 but none of the entities are available after configuration and I see a few of these errors, with similar on the other “domains” too.

Logger: homeassistant.components.switch
Source: custom_components/mertik/mertik.py:50
Integration: Switch (documentation, issues)
First occurred: 13:36:54 (2 occurrences)
Last logged: 13:36:54

    Error adding entities for domain switch with platform mertik
    Error while setting up mertik platform for switch

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 438, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 709, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 804, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 556, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 597, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 562, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 997, in state
    if (is_on := self.is_on) is None:
  File "/config/custom_components/mertik/switch.py", line 40, in is_on
    return bool(self._dataservice.is_on)
  File "/config/custom_components/mertik/mertikdatacoordinator.py", line 29, in is_on
    self.mertik.is_on or self.mertik.is_igniting
  File "/config/custom_components/mertik/mertik.py", line 50, in is_on
    return self.on
AttributeError: 'Mertik' object has no attribute 'on'


I’ve been working on my fork of @djerik his code and fixed some stuff (including your error) and added functionality to turn the light on/off (exluding brightness), set the flame height and, turn the aux on/off, set eco and manual mode et cetare. Everything still has some bugs but I’ll try to keep working on it this week and push my changes when they are working well enough.

Sorry for the bugs. My guess is, that it is due to either network problems or different versions of the WiFi module returning different responses.

@wilfredktlr I suggest to make small and individual pushes, as it is easier to review and more people get the benefits faster

No problem. I eat bugs for breakfast. :wink:

I had the same problem as @lwsrbrts. My WiFi-module (B6R-W2BE-0) returns a different start of the string (instead of 303030300003) so the method __processStatus() is never executed. After I changed it to my version the error went away. Maybe it has something to do the the model/serial number or it is generated when you register the module. We’ll have to do some more investigation. For now I’ll hard code it and work on creating a working integration.

@djerik how do you want me to push my changes to your repository? Can I just create my commits in my main branch and create a single pull request to merge it into your repository? Let me know your preffered workflow. I’m somewhat new to using Github. At work (I’m a .NET-developer) we use Gitlab and Git Flow to create feature branch for every single issue and then merge those into the different branches used for testing and deployment.