Home Assistant Simple Motorised Roller Blind

hmmm :thinking: Do you get any logs about it at all?

is the same problem as before, the messages are not transmitted completely. Here is a picture of Mqtt.fx . In HA the messages are not displayed. ( max, min and reset) . Only the cover message and the status arrives.

Ah ok, I know what’s going on here!

TLDR: Your device client ID’s are too long.

Detail:
The JSONDocuments have to be a predetermined length, which I set to the minimum I could get away with based on the existing names.

Options:

  1. Increase allocated memory for config JSONDocuments so full JSON is sent.
  2. Only change the names in the MQTT topics /studyBlind/ in the code. Then change the entity names in HA.
  3. Update to latest release. This simplifies the process for having multiple instances of the project. You will need only to change one variable mqttName and the rest should be done in HA. Note: This is as yet untested and you would be the guinea pig :smiley:

Thank you very much, here I like to play the guinea pig :slight_smile: . Unfortunately, however, this does not solve the problem for me. If I now give the mqtt name HA finds a new device. But as soon as I add another device with a different name, HA does not create a new entity. I.e. only one device is found. The mqtt messages look ok to me at first. The messages are no longer truncated. If I delete the entity of the first device, then it finds the second device.
Maybe it has something to do with the topics ?
I hope I am not annoying.

So it’s late and I’ve not looked into this but I’ve just potentially had an epiphany with this.

I think mqttCoverDeviceClientId needs to be unique for each device too. I will try it out tomorrow and let you know.

Not in the slightest, I very much enjoy this kind of stuff :slight_smile: plus I use this project myself and have been thinking of adding another one so we both benefit.

I tried that, but it doesn’t seem to solve the problem either.
I have done the following in the My_Helper.h:

const String mqttCoverDeviceClientId = mqttName;
const char* mqttCoverDeviceName = mqttName.c_str();

The problem is then it finds the first device, displays the name correctly and then the second device again does not work. There must be something else wrong in the topics. At least when another device is created.

First I changed only the mqttCoverDeviceClientId. If I then change the mqttCoverDeviceClass, then HA no longer finds a device

OK, so I dare say I may have solved this issue now haha

I’ve put out a new release and even tested it myself.

The problem was that I hadn’t quite got the topics and devices names quite right in order to create a separate instance for each device in HA.

I increased the memory allocation for the JSONDocuments so you can have longer device names. Try to keep them below 20 characters to be on the safe side though.

I also realised that the mqtt_server const was misleading as I was entering a full http url when it just needs to be an IP address. So the variable has been changed to mqtt_server_ip for the sake of clarity. There is also now an option to change the MQTT port number.

One thing I noted during testing was that if a device name from the previous broken instance was used it would remain broken. I think the details of that device are cached in HA. What this means for you I think, is that you will probably have to choose a different name than eliaBlind.

Good luck, hope this finally works. Let me know how you get on. :crossed_fingers: :smiley:

1 Like

great, that seems to work. Two entities are now found. There was still a small error in my_helper.h

change
const char* mqtt_server_port = 1883;
to

int mqtt_server_port = 1883

thank you very much. I will now test a little and add more devices. What is apparently not allowed in the name is a space. Then HA does not find any device.

I will contact you as soon as I notice more things. Thanks a lot, it was a lot of fun until here.

Woohoo finally some good progress! :laughing:

I’ll implement the change to int and it will be in the next release. Thanks for all your help :slight_smile:

1 Like

Thanks for your work on this. I’m 3d printing the parts as we speak. Find this overall to be better then TheHookUp solution.

1 Like

Thanks man, I shall be taking that compliment to the bank! Hope it works out well.

very nice release. I have integrated it on many blinds by now. Many thanks at this point. But I still have one question. Is there a way to change the motor direction ? Either in HA or in the Arduino code ? One more small addition, with the Safari browser it doesn’t work for me that the SSID and the password are taken over. In the Arduino code there is always an empty string. I could not test another browser yet, but I will do it later.
:grinning:

1 Like

Any reason not to use ESPHome? There’s a time tested version that uses the same parts HERE

1 Like

So there is currently no way of changing the motor direction but it’s a good idea for a later release.

It’s the .step() method that determines the direction. Either 1 or -1 so it’s shouldn’t be too difficult to implement that once I find some time.

I’m not sure exactly what you mean with regards to the Safari browser, could you elaborate?

No reason at all other than I prefer coding over scripting.

Fair point, I should probably do more coding.

Sorry, didn’t mean to hijack thread…

I’ll add a link instead:

i love your setup! thank you!!!
now, 1 motor is too weak for a big window of mine. how can i use a 2 motors setup as seen here from Printables. ? how would i even wire the 2 motors and can i use your same bin file from here?

1 Like

Hey,

Thanks for the compliment, glad your like it :slight_smile: unfortunately I couldn’t really tell you how to change it much as it’s the hardware and electrical side of things isn’t my strong suite.

Hope it works out though!