Versions Compared

Key

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

...

Tip

doc_tap_packetparser_scripts_link;

Info

Definition of error states from scripts

Service attributes and actions

Scripts and auxiliary variables on the module

Scripts and helper variables on the device

See more info on [Modbus documentation page](https://taphome.com/support/15597569).

doc_tap_packetparser_moreinfo;

...

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;