Giter Club home page Giter Club logo

commandfusion-mqtt-plugin's Introduction

Commandfusion-MQTT-Plugin

MQTT Plug-in for Commandfusion iViewer Simple MQTT Client for Commandfusion iViewer

Usage is quite simple:

Setup:

  • Add MQTT.js file to Project Script Manager
  • Create TCP System with link and port of your MQTT Broker. (Standard MQTT port is 1883)
  • Create first two commands - MQTT_Connect and MQTT_Subscribe. Those should only have appropriate javascript code(example in script)
  • Create a macro - MQTT_Start, which should call two commands above with 100ms Interval(first connect, then subscribe). Assign this macro to Startup macro in System Properties.
  • Create single feedback with (.*) regex.

Use Add Command to generate publish messages. Just put MQTT_Publish function in Javascript field,according to example in script. For example:

For switch: Field Javascript: MQTT_Publish("/myhome/command/Light_FF_Bath_Ceiling/state","ON", system)

For slider: Field Command Value: {{[sliderval]}} Field Javascript: MQTT_Publish("/myhome/command/Temperature_Setpoint/state",data, system) Do not forget to set "Javascript sends command value" flag

To process feedbacks:

  • Create a UDP Socket Loopback system with IP 127.0.0.1
  • As End Of Message Character define \x0D in System Properties of this system
  • For each feedback create new feedback and in regex provide appropriate regex assuming that your incoming data in this case will have a look like topic=value.For example: /myhome/in/Light_FF_Bath_Ceiling=(OFF) /myhouse/office/Room_Temp=(.*)

Some improvements are planned:

  • packet length is calculated a bit primitive way, and not according to standard (this should be fixed with recent commit by Jarrod)
  • Security/Authorization to be added

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.