Millheat local API development questions

@seime I only have a couple of Mill panel heaters myself, but I want the binding to work with other Mill devices as well. The problem is that the Mill documentation is very “limited”, and some places obviously wrong. So, I’m happy for any input you have that can help me make “better guesses” about the devices that I don’t possess. Mill’s documentation states that the API supports:

  • Panel heaters - Generation 3.
  • Convection heaters - Generation 3.
  • Oil heaters - Generation 3.
  • Wi-Fi Socket - Generation 3.

There doesn’t seem to exist a Wi-Fi “fan heater” among their offerings at this time. When looking at your binding, I can see that you have “fan control”. I assume that is for the fan heaters, and that they had Wi-Fi in the past?

They also have air purifiers, heat pumps and the “Mill Sense” sensor that has Wi-Fi, but presumably these don’t support the local API.

The Wi-Fi Socket in particular is a huge guesswork for me. It’s not a heater at all, it’s just a “smart socket” that can turn on or off a load, as far as I can understand. I assume that most of the functions in the API isn’t available for this (it probably has a temperature sensor, but it can’t have a PID controller for example, as it must turn the load either on or off).

So, in short, of the Mill devices you have detailed information about, which features/functions are common, and which are unique for a particular type?

I realize that I will have to rely on feedback from users of the devices I don’t possess to get this right, I was just hoping to make some “educated guesses” as to what each Thing-Type should offer in advance, that isn’t completely off.

I have a Gen2 floor standing panel heater with built-in fan to improve convection. But the model is discontinued due to the heat drying out the roller bearings of the fan, making it noisy.

The Gen2 model is basically a panel heater without the heating panel itself. For that it provides a socket where you can connect you old, dumb heater. AFAIK the Gen2 was controlled like any heater, and it might be so that the Gen3 is similar and just switches the socket on and off fairly often (but not too often I presume).

Aside from the abovementioned I only have a few standard Gen2 panel heaters. But I’m in the market for some new ones for a separate project, so I’m following you work on the Gen3, and I’m happy to take product advice :slight_smile:

Do you intend to add support for cloud as well while you’re at it? Mill had a Cloud API (provider) migration a year or so back, leaving the old binding dead in the water for everyone that migrated. I started migrating the binding to the new API but didn’t finish, WIP is here: WIP update to new API! · seime/openhab2-addons@d394494 · GitHub. It appears to work 95%, but Mill has introduced some “I’ll disable this heater for your because you are not using it” functionality that I have not tried to get around.

1 Like

Thanks for the info :+1:

I’m afraid I don’t have enough experience with these devices to give any advice. I just have a couple of 1000W “Invisible” panel heaters, and I haven’t had them long enough to judge their quality. But, if they last and don’t break after a few years, they seem to do what they should when they work. I don’t think there’s much difference between the different panel heater models except the design and the size of the heating element. I have never seen one of their other products, so I know less than you about those :wink:

No - that would also be contraproductive as your binding, the official one, already does the cloud-bit. It would be much better to fix whatever is wrong with yours for those that want to use the cloud as I see it.

Call me paranoid (I’m sure many do), but I strongly dislike “cloud solutions”. There is obviously the privacy issue of different companies monitoring different parts of your life, and when somebody put all this together, they have a really detailed view of what you’re doing. But, it’s also that you get trapped in a never-ending cycle of updates, phasing out of products, incompabilites and more and more pressure to “upgrade” to newer equipment to keep things working. I just think life is too short to be a part of that dance.

So, I even block my devices in my firewall so that they can’t do the “cloud communication” that they still try to do even though I turned “cloud communication” off in the device. That’s one thing that annoys me with them by the way, they have a 3 second timer in their firmware when they can’t connect their beloved “cloud”, so they keep trying to contact it every 3 seconds forever, “polluting” my local network with useless traffic. If I let them through, they will shut up after 30 seconds or so, when they have reported whatever it is that they “need” to report to their cloud overlord.

The reason I bought a Mill device in the first place was that I needed a new panel heater, and I’m so tired of this “cloud” stuff that I started looking for something with local control. I found that Mill claims that they offer this, and that was basically the entire reason I bought one (in addition to the fact that I liked the “low temperature” heating element which is has a lesser fire risk). I have a dehumidifier which is “infested” with “Tuya cloud” and that has no local access or possibility to turn off the communication with their servers, which means that I have to run down in the basement to adjust it and/ to monitor the humidity (since I have blocked it in the firewall).

That annoys me enough that I have started a project to replace the WBR3 chip in it with a ESP32 chip (they have the same “pinout”). I have gotten and flashed the ESP32, but I’m not looking forward to the soldering job since this is all very small. I also need to figure out how the chip communicates with the device to control it, if it uses “simple” GPIO I/O or if there’s some kind of more “advanced” communication going on that I’ll have to try to figure out. Once that is solved, I must program the ESP32 and find a way to make OH control it (I’m hoping that your ESPHome binding can come in handy here :wink: ). But, as I still am not done with the dehumidifier, and it really is more work than I appreciate to “get control over it”, I was looking for a way not to repeat this and will try to exclusively buy things that have local control if it’s at all possible in the future.

This was a digression I guess, but I just wanted to describe how badly I want to avoid using the “cloud”. As such, it’s not natural for me to try to implement any communication with the “cloud”, and it would also be very hard to do since I refuse to install their “apps” and block the devices from communicating in my firewall :wink:

1 Like

Maybe this is the way to go [Guide]Millheat hardware modification, making it open source - Hardware - Home Assistant Community

If you have pre gen. 3 hardware, that might be the only option if you don’t want to rely on the “cloud” yes, but the local REST API introduced in gen 3 is “good enough” as far as I am concerned. There are a couple of things that don’t work, at least on my devices, and there are multiple shortcomings in the documentation, but all in all it lets you do what you need (the commercial lock for example seems to be broken, it’s supposed to let you program an upper and lower “allowed temperature” that can be set to using the display/buttons).

Sure, it isn’t open-source, and it DOES communicate with Amazon servers even if you turn “cloud communication” off, but it does much less communication with it turned off than when turned on. According to the documentation, the device has no battery backed RTC, so that it will go online to get the correct time after every reboot. If it used NTP, that would be just fine, but I’ve found no trace of NTP traffic in the firewall logs, so it probably fetches the current time from Amazon servers instead - stupidly. But, the device only needs to “know” the time if you want to use the built-in schedules. I haven’t implemented, and don’t intend to, those API calls. I mean, when using it with OH, it’s much better, and more flexible, to let OH do this, to make whatever rules you want for raising/lowering temperatures at different times of the day, in weekends or when you’re away. So, the only thing that actually bothers me is that it never seems to “give up” on trying to contact Amazon to get the time, and keeps doing that every 3 seconds “forever” until I let it through. It must also do something more than fetch the time, as it contacts 3 different Amazon servers after booting. But, I digress, what I’m trying to say is that I think the “local API” gives sufficient control that you don’t need to do a hardware mod like the one described above, even if a few things should ideally be changed to make it “perfect”.

There are downsides to such mods too, if you actually want to replicate what the heater can do today, there will be quite a lot of work to make the software for your replacement controller. Also, they seem to have changed the design for gen 3, I have opened one of my devices up, and the “controller” and the “Wi-Fi chip” are one and the same from what I can tell.



It is not just a “simple” on/off thermostat, it uses PWM to regulate the heating element and runs a software PID controller to control how much heat to apply. Add with things like “open-window” functions and tuning of PID parameters, and there’s really quite a lot to “replicate” in your “replacement software” if you want to make your own that does roughly the same. Not to mention that you also have to implement the control of the display and the buttons, configuration menus etc.

Ideally they would open-source the whole firmware so that we could improve it, but companies are always worried that somebody else will copy their products, so that probably won’t happen. As such, the local API is a good compromise. The problem is that they haven’t responded to any questions on GitHub since 2022, and there has been no updates to the documentation for more recent firmware versions, so I don’t know if their heart is really in the local API. But, that also depends on how much “support” it gets in home automation systems like OH, so making bindings and similar available, so that the local API actually has “real value for customers” might help to convince them not to drop support for it in the future.

The project for the gen 2 device looks very similar to what I am planning for my dehumidifier, except that I’m not so lucky that the controller is connected by wires, so I have to desolder the WBR3 and solder the ESP32 in the same spot. That opens the possibility of breaking the whole thing, of course, and is far from ideal. I’m really happy the fewer such projects I must undertake.

@hmerk Things have started to happen on GitHub, so I might find it worth the effort to create some more issues.

1 Like

I think the binding is getting ready now - I’ve been writing documentation (JavaDocs) for the last couple of days. The binding is currently 14460 lines, so writing documentation takes some time.

But, assuming that I will finish writing the documentation in the near future, I’ve been starting to wonder how version management works on the Community Marketplace.

Should I use a “binding version” that corresponds to the OH version, or should I just do “regular versioning” starting from 1.0.0? Is there are way to tell OH which version(s) the binding will work, so that only compatible versions are available for download? If so, is there an easy way for me to test it with previous versions of OH to figure out how far back it goes until it breaks? I assume that only OH 4.x is to consider, but it would still be nice if it would work with versions before the very latest, if possible.

Usually the versioning for marketplace add-ons are independent. Use what ever versioning that makes sense to you. They are really only used in the “change log” section of the post.

That’s handed via the title of the topic. For example, here’s the title for one of my rule templates that only works for OH 3.2 through OH 3.4. " Time Based State Machine [3.2.0;3.4.9]. Here is the same rule template rewritten for OH 4: Time Based State Machine [4.0.0.0;4.9.9.9].

The version ranges somewhat follow the Maven syntax where ] means something different from ') for example. If you include the version ranges in the title, the add-on will only appear in the add-on store for versions of OH that fit in that range.

Unfortunately, when a new major version of OH comes out (5.0 is being talked about as the next release after OH 4.3 is released in a few weeks) that usually means breaking changes which means you can’t have one jar file that will be compatable with both OH 4 and OH 5 so you’ll need to create a new post. That’s not guaranteed to be required but it is likely particularly considering that the move to a major version corresponds with moving to a new JRE version.

I can’t help with the testing on earlier versions question.

1 Like

Your binding will not run on openHAB 3 as the structure did change. For openHAB 4, it might run on earlier versions, if you did not use openHAB specific changes introduced between 4.0 and upcoming 4.3.

That’s no problem for me, it probably isn’t major changes that’s required. The Maven versioning in the topic is actually perfect - that’s just what I was looking for.

When it comes to easily testing previous versions, I’m wondering if checking out the corresponding tag of openhab-distro and then running the “demo.app” might be sufficient. It’s worth a try at least, as it shouldn’t take that long to build. Checking out openhab-core is hopeless, as it takes hours to build each time you change the commit.

I don’t know exactly what was introduced when, which is why I thought the simplest way was to test it and look for errors in the log - or compilation errors if it’s an API change. I guess I will just have to test if switching the openhab-distro commit is enough.

According to the Maven versioning range rules, you could just use [4.0.0.0;5), except if OH releases ALPHA and BETA releases that is considered pre-releases and thus is “less than 5” if it’s e.g “5.0.0.0-alpha”:

It depends on how versioning is used in OH and if the full Maven syntax is supported of course, but if it works, it’s more “elegant” to use “excluding” instead of “including” when the upper limit is assumed to be the next major (or minor) release.

I said “Maven like” with purpose. It’s not quite the full Maven syntax in all respoects. IIRC I tried using that before and it didn’t work. Things may have changed in the mean time. There’s a thread somewhere that goes over all the ins and outs but I can’t find it at the moment. I’ll try to remember and come back and look when I have more time.

1 Like

See Energi Data Service Binding [4.0.0.0;4.1.0.0) - #12 by wborn

When including all four digits, both inclusive and exclusive seem to work. As an example, I do not see this in 4.3: EntsoE Binding [4.0.0.0;4.3.0.0)

2 Likes

For information: Switching the commit for openhab-distro worked like I hoped. I closed all other add-on and core projects in Eclipse, so that only the “demo.app” and the binding I wanted to test were open (to minimize refresh/build/update cycles). After checking out a tag, I just needed to let Eclipse do some refreshes and then do a “Maven → Update Project” and it’s more or less ready to go. It takes a few minutes to download different Maven dependencies, but except for that it works well.

I found that this binding seems to work fine down to 4.1.0. I tested 4.0.0 and 4.0.4, but neither of them wanted to start with or without the binding. It looks like some combination of Java version and OSGi/bnd version issue, so I didn’t spend the time needed to try to figure out what the problem was. But, at least I know that it works with 4.1.0 and later - most likely it will work with 4.0.x too.

Writing documentation is slow, but I’m getting there. I’ve just written the README, and I’d appreciate any input about improvements; missing information, if something is unclear etc:

1 Like

The binding is now published on the marketplace, and seems to work fine when I install it on my “production” OH box.

I guess that concludes this topic, unless something unforeseen pops up.

One last question: Since it’s not intended for people to comment in the “community marketplace” section, is it “customary” to create a topic for a binding somewhere else, like under Add-ons -> Bindings where people can ask questions and/or provide feedback? The advantage of this is that I could watch that topic, instead of probably missing if somebody posts something about it elsewhere?

Thanks for creating this binding! I’m in the market for some Gen3 devices now due to this binding and the PID functionality of the heaters.

My personal preference:

  • Shorter and clearer texts. I mean, explanatory texts are good as well, but important info may drown with too many words. Just personal preference.
  • Thing actions with a single parameter, why not just make it available in a channel? Ie setCustomName

Takk for bindingen!

1 Like

Being brief isn’t my strong side. Believe it or not, I’ve tried to be short. But, I also want to cover all the bases.

That said, I don’t think most users will need to read the documentation, channels, Actions and Things are pretty much documented in the descriptions in the binding itself. The exception is probably how to configure the Wi-Fi without using the “app” - it took me some time to figure this out, as it’s not exactly documented.

I’m wondering if there’s some place in the binding itself where this procedure could/should be documented, but it is long-ish…

Because it’s one of those things I don’t expect you to want to do more than once. In 4.3.0, Actions can be executed from MainUI, which makes them much more accessible. The “custom name” is actually set in the firmware of the device, it’s a way to name your devices in some way meaningful to you, not something you need/want to expose as an Item as far as I can see.

Bare hyggelig - jeg håper andre drar nytte av den også :slightly_smiling_face: