-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
MQTT Buttons state not updated - Home Assistant #199
Comments
This might be related to the change in version 1.0.0 (2022-07-22), |
Just want do add that I also tried the 0.0.4 version and the events didnt show up either on Home Assistant. |
@fmunozs @meli-femunoz Can you please check if the values appear in the mqtt topics on the mqtt server when you click the buttons? Myself I use MQTT Explorer for this purpose, you can try it out if you have no other tool. If yes, can you please provide the exact topic names? |
hello pplucky! thanks for pointing me to MQTT Explorer. I can see the message going to the sever, however it doesnt seem to be using the "automatic" format that Home Assistant uses and that must be why its not detected. I will see if I can fix it. thanks |
I can also confirm that this is pre 1.0.0 behavior, as I didn't touch the button code (I had no way of testing it at the time). As per my analysis, it seems the MQTT discovery topic is being sent from PixelIT to HA, but without any value published. If you look at the block of code within this cycle, you'll notice that unlike what happens for other sensors, no line like this one, exists for the buttons. Maybe @o0shojo0o can help figure out where are the values to be published (the same as in the UI). so that this can be fixed. Edit: If I saw this right, it seems that the possible values are true/false, so maybe it would even make more sense to transform these into binary sensors, rather than sensors... |
In teorie, the event Line 883 in 25faa66
|
@o0shojo0o @fmunozs @meli-femunoz Is any of you willing to try my fork? Using @o0shojo0o's tip above, I managed to fix a couple of things that didn't seem OK to me and renamed the buttons to Left, Middle and Right instead of just Button0, Button1 and Button2 (which still stands as the sensor ID). Playing around with MQTT, I managed to get these to appear: But as I don't have buttons assembled, I cannot do the real testing. If it looks OK, I can create a PR for it. |
Hello pplucky, I tried your fork but still cant see the value on HA. I see the update events on the "buttons" topic, and see the new val_tpl but it doesnt show yet. Also, I believe that the current implementation of MQTT for button state can be improved because currently its only possible to see the state of a single button. If I press 2 or 3 buttons at the same time only the last press is reflected. I will try to send a PR in an hour, I also think that it is better to change the dev_cla for the sensors because it is not a timestamp. |
Yes, that's a fact. My only purpose at this time was to make it MQTT discovery work also for buttons. Actually, there is a single MQTT topic for all buttons which is being overwritten each time a button is pressed, but this has nothing to do with MQTT discovery, as discovery is only getting information from the existing MQTT topics to feed the discovery-generated entities.
Damn, I forgot to remove the dev_cla, that is why it is not working. Fixed now in my fork. I added PR to include those fixes already. |
Untested, but tried creating a new MQTT topic under buttons named after the corresponding button (button1, button2 or button3) and use its state to feed MQTT discovery directly... |
Tried to compile it but it fails.
|
Can you please try again? |
Thanks for letting me know. I think i'd rather transform these into separate binary sensors before submitting a PR. Care for trying again? Looking good here (all included in same PR): |
Everything seems to be working OK! I had to remove the device from HA because the old button sensors configuration appeared next to the new ones, maybe its a good idea to mention that somewhere for users upgrading from an older firmware version :) 2022-09-11.20-53-02.mp4 |
Hello, I've just installed the latest version and connected it with my local Home Assistant server.
I can see correctly the LED Matrix state, Illuminance sensor, however none of the 3 buttons are showing up its state. The state is being shown on the PixelIt panel correctly but not on MQTT.
The text was updated successfully, but these errors were encountered: