Announcement

Collapse
No announcement yet.

Don't think I'm understanding VSPs properly, a little help please?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Don't think I'm understanding VSPs properly, a little help please?

    Up until recently I have only been using this plugin to relieve data from subscribed topics, and control a HS4 device/event from those triggers.. Today I have now been trying to get my first device to work using a publish topic too which has not been going well.

    I have a physical device, an EV Charger, which can be set to two different modes, using a topic published to "GoPlug/divertmode/set" with a payload either 1 or 2 which will then control the physical device.

    I am trying to setup my plugin device in HS4 such that there are two buttons, one being "Max" and the other "Eco". I need the "Max" button to publish a value 1 to the topic above. And I need Eco to publish a value 2 to the same topic.

    So far, I have accomplished the creation of a plugin device, with two buttons, "Max" and "Eco". If I use a 3rd party MQTT client to publish to this same topic which I am also subscribed to in HS4, the plugin device is correctly updated with a status of "Max" when I publish a payload of 1, and "Eco" when I publish a payload of 2.

    My problem, which I have been unable to resolve myself, is when i press the buttons, "Max" will publish a value/payload also of "Max", and Eco the same. Whereas I need to publish either a 1 or 2 respectively.

    Here is my topic association:
    Click image for larger version  Name:	3.png Views:	0 Size:	4.3 KB ID:	1396986
    The plugin device MQTT settings with VSPs - I tried setting the "Publish Payload Template" to $$value although when I click the buttons the payload published is simply "value":
    Click image for larger version  Name:	1.png Views:	0 Size:	13.9 KB ID:	1396988
    HS3 style device status page:
    Click image for larger version  Name:	2.png Views:	0 Size:	4.0 KB ID:	1396987
    And status graphics page:
    Click image for larger version  Name:	4.png Views:	0 Size:	7.9 KB ID:	1396985
    Attached Files

    #2
    Put $$VALUE: in the payload template on the Edit tab. Typically either the $$LABEL: or $$VALUE: is published and I forget which of the two is the default. The label will be the text on the button and the value with be the number related to the text via VSP.

    Comment


      #3
      Thank you the ":" I think is what I was missing

      Comment

      Working...
      X