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:
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":
HS3 style device status page:
And status graphics page:
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:
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":
HS3 style device status page:
And status graphics page:
Comment