Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
MQTTPUBLISH(“shellies/deviceid/relay/0/command”, “off”)

Listener script

doc_tap_pp_listener_script_description;

doc_tap_pp_listener_script_improvements_heading;

doc_tap_pp_listener_script_instead_of;

Code Block
VAR jsonResponse := TOSTRING(RECEIVEDBYTES);

if parsejson(jsonResponse, "Topic") = "my-topic"

	Va := todouble(parsejson(jsonResponse, "Payload"));

end

doc_tap_pp_listener_script_new_way;

Code Block
if RECEIVEDMSG.TOPIC = "my-topic"

	Va := todouble(TOSTRING(RECEIVEDMSG.PAYLOAD));

end

doc_tap_pp_listener_script_new_way_description;

doc_tap_pp_listener_script_packet_analysis_heading;

doc_tap_pp_listener_script_packet_analysis_description;