Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Lable change Iobroker via MQTT #37

Closed
Frodonet opened this issue Mar 20, 2023 · 11 comments
Closed

Button Lable change Iobroker via MQTT #37

Frodonet opened this issue Mar 20, 2023 · 11 comments

Comments

@Frodonet
Copy link

Hi I tried your great Produkt. Alls works fine with my IObroker but to change the Button Labels I didi not find a working way.
Can you help me to get a working url Request ?

Regards Frodonet

@Taffmailer
Copy link

Hi
I would like to join this - super project.
I have the same problem and looking for a solution how I can change the label via mqtt in the iobroker environment.

all the best

@Zixim
Copy link

Zixim commented Mar 20, 2023

Home Assistant sends a MQTT message to homebuttons/Home Buttons XXXXXX/cmd/btn_6_label with payload containing the label.
XXXXXX being the device identifier.
Next time you press any button, the device will get the message and adjust the label.

@Frodonet
Copy link
Author

ok I can send the Message to the device buy instead of my text it shows "null" on the display

@nplan
Copy link
Owner

nplan commented Mar 20, 2023

{BASE_TOPIC}/{DEVICE_NAME}/cmd/btn_{1-6}_label is the topic used for label text. The default BASE_TOPIC is homebuttons and DEVICE_NAME is what you set it during initial setup. Defaulting to Home Buttons XXXXXX with Xs replaced with the ID. The message should be published with retained flag set, so that Home Buttons receives it when it wakes up.

Since you're getting "null", could you please check with MQTT Explorer what is actually published to the topic?

@Taffmailer
Copy link

Taffmailer commented Mar 22, 2023

I have published value "Entry" . After the „home button" was woken up by pressing any button, the data communication took place (Sorry for screenshots, I have not found a full logfile about the history).
I hope that this is helpful

Publish

CleanShot 2023-03-22 at 09 15 34@2x

CleanShot 2023-03-22 at 09 16 08@2x

CleanShot 2023-03-22 at 09 16 26@2x

@Frodonet
Copy link
Author

I have the same in my MQTT Explorer.

@nplan
Copy link
Owner

nplan commented Mar 22, 2023

This seems like a MQTT compatibility issue. Which MQTT broker are you using?

When Home Buttons wakes up, it receives the new label command, updates the label and then sends a MQTT message with empty payload to the broker which should then delete the retained cmd topic.

But here something goes wrong. Instead of deleting the topic the payload is set to "null" which updates the label again...

@Taffmailer
Copy link

Taffmailer commented Mar 22, 2023

I'm using iobroker with the adapter MQTT 4.0.7. I haven't any problems with my other devices including esp32 via mqtt

@nplan
Copy link
Owner

nplan commented Mar 22, 2023

This is the problem: ioBroker/ioBroker.mqtt#231 (comment)

On a real MQTT broker you can delete a retained topic by publishing an empty payload. Which Home Buttons does for labels. On the broker that you are using, this does not appear to be supported.

Could you switch the broker to mosquitto? And then only use this adapter in the client mode.

@Taffmailer
Copy link

Thanks a lot, I've solved the problem.

  • installed mosquitto at iobroker server,
  • created a separate mqtt instance at iobroker in client mode which connects to mosquitto
  • Topic is homebutton/#
  • configured the retainer flag there
  • and reconfigured the home button (new mqtt broker is now mosquitto)

... and it works

@nplan nplan closed this as completed Mar 22, 2023
@Frodonet
Copy link
Author

Thanks a lot, I've solved the problem.

  • installed mosquitto at iobroker server,
  • created a separate mqtt instance at iobroker in client mode which connects to mosquitto
  • Topic is homebutton/#
  • configured the retainer flag there
  • and reconfigured the home button (new mqtt broker is now mosquitto)

... and it works

Can you tell me more details ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants