Group Details Private

FlicTeam

Employees at Shortcut Labs

  • RE: Flic 2 connected in Bluetooth to Alexa

    @gianni It appears that alexa skills can only be linked to one account. So you should either use the same flic account for all your flics, or you need to create three amazon accounts and link each to each flic account.

    posted in General Discussion
  • RE: Flic 2 connected in Bluetooth to Alexa

    @gianni You can assign the Alexa action to as many Flic buttons as you wish. There is no limitation.

    posted in General Discussion
  • RE: Listen for device + trigger HTTP request

    @claes-jacobsson No idea. I guess you could try to connect to some port maybe. I don't know anything about Apple TV's network usage unfortunately.

    posted in Flic Hub SDK
  • RE: Listen for device + trigger HTTP request

    @claes-jacobsson We have mDNS functionality but it is in beta so it is not documented yet.
    But you can refer to the following code samples in the meantime (monitoring Sonos devices):

    const mdns = require("mdns");
    
    // Service browse:
    browseHandle = mdns.serviceBrowse(null /*or interface string*/, "_sonos._tcp", function(obj) {console.log(JSON.stringify(obj));})
    
    Output:
    {"add":true,"interface":"eth0","serviceName":"Sonos-38420B7D0C12@Meeting Room","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"eth0","serviceName":"Sonos-C43875785444@Kitchen","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"eth0","serviceName":"Sonos-B8E937B9C4EC@Dev","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"eth0","serviceName":"Sonos-B8E937EE3C04@Dev","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"wlan1","serviceName":"Sonos-38420B7D0C12@Meeting Room","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"wlan1","serviceName":"Sonos-C43875785444@Kitchen","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"wlan1","serviceName":"Sonos-B8E937B9C4EC@Dev","regtype":"_sonos._tcp.","replyDomain":"local."}
    {"add":true,"interface":"wlan1","serviceName":"Sonos-B8E937EE3C04@Dev","regtype":"_sonos._tcp.","replyDomain":"local."}
    
    browseHandle.cancel(); // Stops the monitoring
    
    // Resolve a service instance
    resolveHandle = mdns.serviceResolve("eth0", "Sonos-38420B7D0C12@Meeting Room", "_sonos._tcp", function(obj) {console.log(JSON.stringify(obj));});
    
    Output:
    {"interface":"eth0","fullname":"Sonos-38420B7D0C12@Meeting\\032Room._sonos._tcp.local.","hosttarget":"Sonos-38420B7D0C12.local.","port":1443,"txtEntries":{"bootseq":[56,54],"hhid":[83,111,110,111,115,95,76,68,99,69,97,107,111,56,74,56,52,121,102,99,114,54,75,49,89,69,109,48,104,57,99,111],"hhsslport":[49,56,52,51],"info":[47,97,112,105,47,118,49,47,112,108,97,121,101,114,115,47,82,73,78,67,79,78,95,51,56,52,50,48,66,55,68,48,67,49,50,48,49,52,48,48,47,105,110,102,111],"infohash":[52,71,105,56,85,107,108,80,100,68,76,73,112,118,65,99,53,111,75,108,112,87,76,53,102,101,97,110,118,74,106,57,74,73,102,54,95,84,81,109,98,102,103],"location":[104,116,116,112,58,47,47,49,57,50,46,49,54,56,46,51,46,57,58,49,52,48,48,47,120,109,108,47,100,101,118,105,99,101,95,100,101,115,99,114,105,112,116,105,111,110,46,120,109,108],"locationid":[108,99,95,102,57,99,98,52,100,99,54,51,52,55,97,52,53,53,102,56,52,56,97,48,51,101,99,55,52,51,100,52,52,48,98],"mdnssequence":[48],"mhhid":[83,111,110,111,115,95,76,68,99,69,97,107,111,56,74,56,52,121,102,99,114,54,75,49,89,69,109,48,104,57,99,111,46,89,77,77,122,112,67,49,49,72,89,51,79,57,95,110,74,98,70,97,49],"minApiVersion":[49,46,49,46,48],"protovers":[49,46,52,48,46,48],"sslport":[49,52,52,51],"uuid":[82,73,78,67,79,78,95,51,56,52,50,48,66,55,68,48,67,49,50,48,49,52,48,48],"variant":[49],"vers":[53],"wss":[47,119,101,98,115,111,99,107,101,116,47,97,112,105]}}
    
    resolveHandle.cancel(); // Stops the monitoring
    
    // Get IP address
    getaddrinfoHandle = mdns.getAddrInfo("eth0", "Sonos-38420B7D0C12.local.", /*IPv4*/true, /*IPv6*/false, function(obj) {console.log(JSON.stringify(obj));});
    
    Output:
    {"add":true,"interface":"eth0","ip":"192.168.3.9"}
    
    getaddrinfoHandle.cancel(); // Stops the monitoring
    

    When you see "add": false, that means the device's dns-sd entry has expired, i.e. the device has not renewed its entry before it expired. You can either monitor all devices of a certain type (serviceBrowse) or monitor a specific host (getAddrInfo).

    posted in Flic Hub SDK
  • RE: Listen for device + trigger HTTP request

    @claes-jacobsson Maybe monitoring it via DNS-SD could be an option. If you use e.g. https://apps.apple.com/us/app/discovery-dns-sd-browser/id305441017, do you see your Apple TV there when you scan your local network?

    posted in Flic Hub SDK
  • RE: Listen for device + trigger HTTP request

    @claes-jacobsson What kind of device do you want to monitor? How you "listen to" it depends a lot of what kind of features it supports.

    posted in Flic Hub SDK
  • RE: Listen for device + trigger HTTP request

    @claes-jacobsson If you use the Flic Hub (1st gen) or Flic Hub LR, that is possible with the Hub SDK, but requires you to write custom javascript code. Please see https://flic.io/flic-hub-studio.

    posted in Flic Hub SDK
  • RE: New Flic Twist features for the Hub SDK

    @sgemmen Thanks! Fixed.

    posted in Flic Hub SDK
  • RE: Update SDK to use the FlicTwist ?

    We have just announced a beta release of some new features that allows interaction with the Flic Twist: https://community.flic.io/topic/18536/new-flic-twist-features-for-the-hub-sdk.

    posted in Flic Hub SDK
  • New Flic Twist features for the Hub SDK

    We are today announcing a Beta release of some new features in the Hub SDK that can be used together with Flic Twist.

    In order to seamlessly continue to work with the rest of your smart home devices that you might have assigned to other triggers on the Flic Twist, we introduce the concept of Virtual Devices. A Virtual Device is handled by the Flic Hub firmware just like any other supported real device, but its functionality is implemented by the user in the Hub SDK, typically by writing some kind of bridge software that sends commands and receives update events over the LAN to/from the real device. If for example the brightness of a (real) light is changed by some external means, it is possible to tell the Flic Hub firmware from javascript about the new brightness level, which the hub then forwards to the Flic Twist, so that the LED status can update accordingly. That way when you twist it, it will start from the correct position.

    We are also adding a "message" action that can be used to send arbitrary strings to your scripts whenever the action is triggered. The intended use case is to be able to trigger custom code also for Push/Double Push in the Selector feature or perform some action when a specific point is reached in Advanced Dimming or Scene Blender.

    The virtual devices can be created in the Flic App and be set to be controlled by a Flic Twist as follows:

    IMG_9799.png

    IMG_9797.png

    Using this piece of code, updates are received in your javascript code after configuring a virtual device to be triggered in the Flic App for a specific Flic Twist:

    const flicapp = require("flicapp");
    
    flicapp.on("virtualDeviceUpdate", (metaData, values) => {
        // The values object can contain hue, saturation, brightness, colorTemperature, volume, position (for blinds)
        console.log(`Twist ${metaData.buttonId} updated virtual device ${metaData.virtualDeviceId} of type ${metaData.dimmableType} with these values: ${JSON.stringify(values)}`);
    });
    

    When a device is modified externally, we use this function to inform the system of the change:

    flicapp.virtualDeviceUpdateState(dimmableType, virtualDeviceId, values);
    

    The dimmableType can be either "Light", "Speaker" or "Blind". The values is an object containing at least one of the fields mentioned above that is appropriate for the corresponding dimmableType. For example:

    flicapp.virtualDeviceUpdateState("Light", "my_ceiling_light", {hue: 0.6, saturation: 0.7, brightness: 0.8});
    

    The values themselves are always floating point numbers between 0 and 1.

    Configure an action message to be triggered by assigning the following action in the Flic app:

    IMG_9798.png

    The action messages are easy to receive, just register a listener as follows:

    flicapp.on("actionMessage", message => console.log(`Got a message: ${message}`));
    

    We'd love to hear your feedback!

    posted in Flic Hub SDK