I'm using the hasp with my own MQTT based home automation system. I do use the default display sw.
HASP Version: 1.02
LCD Version: 3
Right now, I just have page 1 defined with actual button values. If I query the txt attribute, I not only get a state button response with the correct text, but also get a state json response from p[7].b[15] with the same text. This is the log from my system:
12:06:35.991 mqttx: Published hasp/hasp01/command/p[1].b[7].txt, !
12:06:36.001 mqttx: Received PUBLISH (d0, q0, r0, 'hasp/hasp01/state/p[1].b[7].txt', ... (9 bytes))
12:06:36.002 hasp: hasp: topic:hasp/hasp01/state/p[1].b[7].txt,msg:Overcast ;
12:06:36.008 mqttx: Received PUBLISH (d0, q0, r0, 'hasp/hasp01/state/json', ... (46 bytes))
12:06:36.009 hasp: hasp: topic:hasp/hasp01/state/json,msg:{"event":"p[7].b[15].val","value":"Overcast "};
You can see the correct "Overcast " response for p[1].b[7], but the json is reported mistakenly from p[7].b[15]!
Here is the response if I query p[7].b[15] directly:
12:06:42.265 mqttx: Published hasp/hasp01/command/p[7].b[15].txt, !
12:06:42.273 mqttx: Received PUBLISH (d0, q0, r0, 'hasp/hasp01/state/p[7].b[15].txt', ... (0 bytes))
12:06:42.274 hasp: hasp: topic:hasp/hasp01/state/p[7].b[15].txt,msg:;
12:06:42.278 mqttx: Received PUBLISH (d0, q0, r0, 'hasp/hasp01/state/json', ... (37 bytes))
12:06:42.280 hasp: hasp: topic:hasp/hasp01/state/json,msg:{"event":"p[7].b[15].val","value":""};
You can see that both the state button and state json responses are the correct empty value.
Sending queries to page 1 buttons 4-7 yield the same response from page 7 button 15.
But, further testing shows that querying button 4 on any page (or any other valid button for that page) returns the incorrect page/button for the json return (but the correct attribute value). So while the second log above seems to show a correct json response for page 7 button 15, that's just a coincidence since queries to ALL page have in the response page 7 button 15 as the button address. And it doen't always return p[7].b[15] in the json. the actual page/button seems to change based on query history and page selections. At one point during my testing of this issue, the json return changed to p[11].b[5].
Possibly, there is some incorrect "memory" somewhere that is being used as the json page/button value in the return (although the actual text attribute value is returned properly).
New info: The page/button returned in the json appears to be that of the last button pressed. So this is where the bad page/button number is coming from.
Steps to reproduce:
- Go to any page.
- press a button
- via MQTT, query another page/button text value.
- See that the "event" page/button shown in the json return is the button pressed in step 2, not the page/button of the query. Note that the "value" in the response is correct for the query page/button.