id628 a633db73c8 Merge pull request #5 from alexander-cato/main-1
Added current state sensor + other improvements
2023-08-07 10:58:47 -04:00
2023-03-19 14:28:41 -04:00
2023-08-05 22:25:19 -04:00
2023-07-15 19:04:32 -04:00
2023-08-05 22:54:06 -04:00

flic2hass

A Flic SDK utility to publish all of your Flic buttons to Home Assistant via MQTT

Requirements:

  • A Flic Hub
  • A functional MQTT server

Basic Steps:

1. Connect to Flic Hub IDE:

2. Create MQTT module:

  • One in the Web IDE, click "Create Module".
  • Give the new module a name. "MQTT" is a good option but anything will work.

3. Insert main.js and mqtt.js:

  • Copy content from main.js in this repo to main.js in the flic IDE.
  • Right click the folder in the left pane and select "New File".
  • Name the file mqtt.js (IT MUST BE NAMED THIS).
  • Copy content from mqtt.js in this repo to mqtt.js in the flic IDE.

4. Update variables in main.js:

  • Modify server, hatopic, authentication with your details.

    If your MQTT server does not require authentication:

  • Delete:

    var username = 'flichub';
    var password = 'xxxxx';
    
  • Replace:

    var mqtt = require("./mqtt").create(server,{'username':username,'password':password});
    

    With:

    var mqtt = require("./mqtt").create(server);
    
  1. Start the module in the IDE by clicking the green play button, and watch the Console output (it's extremely verbose right now)

    If the module didn't start correctly, try powercycling your Flic Hub and reconnect. Verify the Module saved properly and is running.

  2. Once the module has started and you have verified it is working as expected, turn on the "restart after crash" checkbox to ensure the module is always running after any unexpected crash or hub power cycle.

S
Description
A BETTER Flic SDK utility to publish all Flic buttons to Home Assistant via MQTT
Readme
1 MiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 52%
TypeScript 48%