User input processing



  • @user2684
    You have explained that you go for maximum flexibility for the user talking about processing incoming data.

    I wonder if the same is true for outgoing data.

    What I am looking for is the following.

    I have a list with several sensors. I need to choose one out of the list and transmit the related unique number.

    Looking back in my history I would prefer to have a user filled pulldown menu with the names of the sensor being in the pull down list. Up-on selection of one of the sensors the index of the sensor in the list is taken as data element being transmitted.

    Would this be possible?



  • There is a similar flexible mechanism for manipulating the data before being sent to an actuator but the target sensor has to be already selected so does not apply in your scenario. I wonder if you can play with rules to achieve it. Something like once you provide your input to an input widget a rule triggers which compare that input with something and then triggers an action. Try providing some more details on the exact process and I'll try to figure out something. Thanks!



  • @user2684
    There might be a possibility. The data have to be transmitted to one and the same sensor. The only thing I would like is that the data to be transmitted being selected by means of a pull-down menu. What happens is that via MQTT the number of the sensor is transmitted. But whatever number it goes always via the same sensor.



  • ok, since this is going to be a new type of widget I want to be sure to capture well your requirements as well as other potential use cases. I understand the need to send a configurable message to one sensor you can select from the list. So the dropdown component is clear. I need to evaluate better the possible implementation scenarios now. Probably the most simple approach would be to have actions (like with buttons) associated to a selection so user can run rules, set values and so on. Keeping track on https://github.com/egeoffrey/egeoffrey-gui/issues/63



  • @user2684

    Sounds good to me!



  • I may have an approach you may want to try out which does not require any new widget (not because I don't want to add one but because I want to limit them and make them as more universal as possible).

    What you need:

    1. A (set of) sensors configured as an actuator (I expect you already have them)
    2. A sensor, format text, no service associated. Let's called it actuator_selection. This will be used to store the sensor_id of the actuator you want to send the value to
    3. A Input widget with in "allowed values" the list of the sensor_id of the actuators (in this way a dropdown will be show and the new value is saved upon selection).
    4. A rule configured with "realtime" triggering, whose trigger is actuator_selection so every time you change the value in the widget, it will be run
    5. A variable in the rule, let's call it actuator_selection_value which retrieves the value of the sensor actuator_selection
    6. An action in the rule in the format SET %actuator_selection_value% <value> which set the value of the actuator stored in the variable to the value of your choice

    How does it look like?



  • @user2684
    I have to chew on this one a little bit.
    I will play around with it later on when I finished looking around in the new GUI.

    First impression is very good.



  • @user2684

    I have been trying a little bit.
    @3 - what sign should be used as separator between the elements in the list? Now I can choose between an empty line and one line with more sensor id's.



  • @eporocrail said in User input processing:

    @3 - what sign should be used as separator between the elements in the list? Now I can choose between an empty line and one line with more sensor id's.

    You should use comma separated values (sensor1,sensor2,sensor3)



  • @user2684

    Just tested it. Works very well. I like it very much. Maybe one remark. The value to be sent to the selected sensor is set in the rule. Would it be possible to pass this value from out the widget to the selected sensor?



  • @eporocrail said in User input processing:

    Just tested it. Works very well. I like it very much.

    Great! I imagined this solution to be a bit more flexible rather than an ad-hoc widget

    Maybe one remark. The value to be sent to the selected sensor is set in the rule. Would it be possible to pass this value from out the widget to the selected sensor?

    Sure, you need an additional sensor mapped to an input widget. Then in the rule you want a variable to retrieve this value and use the %sensor_id% notation instead of the static value



  • @user2684

    Works.

    Send value.jpg

    Maybe it is useful to change the name of the field in widget configuration - general from "Widget title" into "Widget text".



  • I'm just afraid 'text' would remind of a something inside the widget rather than on top of it


Log in to reply