Versions Compared

Key

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

...

Code Block
        {
            "accessory": "mqttthing",
            "type": "fan",
            "name": "fireplace-fan",
            "url": "http://192.168.1.50:1883",
            "username": "homebridge",
            "password": "pass",
            "topics": {
              "getOn": {
                "topic": "stat/fireplace-fan/RESULT",
                "apply": "return JSON.parse(message).FanSpeed > 0 ? true : false;"
              },
              "setOn": {
                "topic": "cmnd/fireplace-fan/FanSpeed",
                "apply": "return message ? '' : '0';"
              },
              "getRotationSpeed": {
                "topic": "stat/fireplace-fan/RESULT",
                "apply": "return Math.round(JSON.parse(message).FanSpeed * 33.3);"
              },
              "setRotationSpeed": {
                "topic": "cmnd/fireplace-fan/FanSpeed",
                "apply": "return Math.round(message / 33.3);"
              }
            },
            "confirmationPeriodms": 1000
        },


Order of Operations when Setting Rotation Speed

Code Block
***** ff:setRotationSpeed - mesage=73
***** ff:setOn - mesage=true



***** ff:setOn - mesage=true

References

...