However, I want to have one single drop down menu, which will have 3 options: DUT, HOST and OFF and will of course send u1 if I press DUT, u2 if I press HOST and u0 if I press OFF from that drop down menu.
Thank you. I already tried that but that has its problem, for instance it is not so intuitive. I will try to explain why. However, there is a slight modification which needs to be done to the implementation you posted.
This is because it is only taking commands and forwarding to the command line from the mappings. Which is strange but this is how it is doing it. Hence I need to put “\n” to send the command.
However, the problem here is that if I select any one of the mappings, it only lightens up for a second. So this does not give the user a current status at which my board is.
The values are correct, for instance, if I press DUT then the u2 command is transmitted, I am sure about that because I can see it on my command line terminal which I have opened. And the commands seem to be correct. Also I am displaying the status on the board through a OLED display and it shows that the board is switching between different modes. However, I want the mode which I select to remain lighted on my UI. That is not happening.
What value does the serial binding set the String Item to, after transmitting the ux command?
The state of this Item is what is used to select a sitemap mapping button to “light up”.
I think this suggestion needs the REGEX magic word, perhaps? Could probably be simplified just to add \n to whatever command, but I don’t know REGEX.
I think it’s a good idea, because the \n might be confusing the sitemap.
No. The Item definition suggested by @mpampinos that I highlighted is an Item definition, not a sitemap entry.
My overall thinking here is that you should command your string Item to values like “u1”, and have the serial binding automatically add a “\n” that you need. I think a single REGEX in the Item’s serial binding can do that for you.
But it would be really really helpful to find out what your string Item gets set to after a command, because then you can use that to map your sitemap buttons to get the highlighting working, and then translate that (whatever it is) into something that you really want to send out over serial.
The file events.log shows you command and state changes for Items. You could show us a snippet of that for when you post a command that works, if you put things back to a working condition.
Well, whatever your REGEX does (I do not understand REGEX) you are also trying to apply what I think are invalid transforms as well.
ItemStateChangedEvent] - Test changed from u1 to
Okay, so your serial responds to a command with a null or blank or non-printable characters, and that becomes your Item state after a command.
That’s of no use to you at all for the sitemap to use to highlight which button you clicked last.
You need some other way to remember the last click.
A simple way would be to have two Items
String Test "serial command" {serial = "whatevers"}
String Test_Proxy "Mode"
Put the proxy on your sitemap with the text mappings you want. When you click to send a command, autoupdate will also update its state to match the command and the last clicked button will be highlighted.
Write a rule that listens for commands to the proxy and converts them into commands to the real serial Item.
Thank you. This work around works, however, for future reference, one can implement the REGEX command and that might help. But for my purpose this solution works really good.