Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users
    1. Home
    2. sgemmen
    3. Best
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 14
    • Best 4
    • Controversial 0
    • Groups 0

    Best posts made by sgemmen

    • Flic Twist Feature Request : Advanced - Position Triggers/Actions

      Summary
      Be able to select an advanced mode for Twist / Push Twist that allows the user to assign an “actions” trigger to any of the 12 available positions.

      Note
      This would be similar to the scene blender, except the user could select any of the 12 positions with the more simple goal of assigning an action to each (no blend functionality).

      Basic Use Case
      Set each of the 12 positions to sonos playlists and twist to the desired playlist.

      Advanced Use Case
      Be able to make internet requests from each of the positions in the twist for home automation uses.

      How I got here
      I thought this feature was already available. Without the availability to access the twist rotation events in the flicsdk I came up with what I thought would be another way to accomplish this. I used “net” from the flichub SDK TCP module to start a basic webserver on the hub, from there I thought I could then send requests from my twists to the flichub web server to accomplish my goal. Unfortunately, the above configuration feature doesn’t seem available and I could only use the “scene blender” to accomplish it at the 4 available points.

      It nearly works perfectly… kudos for sending the timestamp, serial, name in the headers…

      Flic hub web server output from twist requests:
      Screenshot 2024-01-13 at 8.23.36 AM.png

      Although my desire is advanced, I’m pretty sure this would be a very good feature for the average user as well.

      If there is another way to accomplish this, would love to hear it!

      Having a lot of fun using flic! Thank you!

      PXL_20240113_162710555.jpg

      posted in General Discussion
      sgemmen
      sgemmen
    • RE: Flic API support for Twist

      @Emil Would really love an update on either support for Flic Hub turn events for the Twist or at a minimum what you mentioned here

      @Emil said in Flic Twist - Rotate clockwise / counterclockwise?:

      Http Request at every step. Currently the number of steps is 4 but we intend to increase it to 12.

      I come to the forum nearly everyday hopeful to see an announcement for these things. I'm sure i'm not the only one. If you add the twist events, I'll be happy to share my code for integrations and again I'm sure I'm not the only one who would be happy to do that. Let's unleash the power of this thing!

      Heres a list of other posts I see related to wanting/needing this:

      https://community.flic.io/topic/18410/flic-twist-rotate-clockwise-counterclockwise/3?lang=en-US
      https://community.flic.io/topic/18367/twist-volume-control-not-for-alexa?lang=en-US
      https://community.flic.io/topic/18333/flic-twist-sdk-support?lang=en-US
      https://community.flic.io/topic/18405/flic-twist-feature-request-advanced-position-triggers-actions?lang=en-US
      https://community.flic.io/topic/18361/first-use-of-flic-twist-feedback-and-feature-requests?lang=en-US
      https://community.flic.io/topic/18390/flic-twist-homebridge-attempt?lang=en-US
      https://community.flic.io/topic/18393/roadmap?lang=en-US
      https://community.flic.io/topic/18377/smarthings-support-for-twist?lang=en-US

      I have 6 twists and 30+ buttons (lost count). Clearly, I'm a crazy supporter of Flic products, my only desire that hasn't been fulfilled is more updates on the progress for improvements. 🙏

      @william @THZ @jezgdavies @flicflop @dustingtorres @ankitajaykapur @timlogan475 @jermainemadam @ingo @3gillespie @AndySXR @mitvortrieb @gregorysinclair @mystery-tech @bytheedgeuk @stephen_mallett

      posted in Developers
      sgemmen
      sgemmen
    • RE: Flic Twist - SDK Support

      Hey @flicflop!

      I nearly have a workaround for getting the twist events on the hub. Maybe you have some thoughts on it https://community.flic.io/topic/18405/flic-twist-feature-request-advanced-position-triggers-actions

      posted in General Discussion
      sgemmen
      sgemmen
    • Flic Twist and Home Assistant for Twist Events

      TL;DR: If you use Home Assistant, getting programmatic access to Flic Twist events is doable.

      alt text

      https://youtube.com/shorts/vk94HH6OKEI?si=wHioNnW3-7Nc5gYW

      This video shows using the twist events to switch pandora radio stations. Each of the 25 clicks on the twist is a station.

      These instructions are my best recollection of setting it up and not what actually happened. If you run into something that isn’t right, I’m happy to update this post or answer a question.

      ALSO: If you know of a simpler way to work programmatically with the Flic Twist, please let me know! This was born from me wondering if it would take less time to do this than to keep checking this forum to see if the Twist SDK was available yet.

      1. Have Home Assistant: I use Home Assistant OS on a Raspberry Pi 4.
      2. Add Matterbridge: Install Matterbridge to connect Flic devices with Home Assistant. Follow the setup to get a QR code and register your devices in the Flic app under “Providers -> Matter.” Matterbridge expos
        https://github.com/t0bst4r/matterbridge-home-assistant-addon?tab=readme-ov-file
      3. Configure a Virtual Light:
      • Install the Home Assistant File Editor.
        https://github.com/home-assistant/addons/blob/master/configurator/DOCS.md
      • Edit configuration.yaml to add a virtual light. Example configuration:
      light:
        - platform: template
          lights:
            album_dial:
              friendly_name: "Album Dial"
              level_template: "{{ states('input_number.album_dial_brightness') | int }}"
              value_template: "{{ is_state('input_boolean.album_dial_switch', 'on') }}"
              turn_on:
                - service: input_boolean.turn_on
                  target:
                    entity_id: input_boolean.album_dial_switch
                - service: input_number.set_value
                  target:
                    entity_id: input_number.album_dial_brightness
                  data:
                    value: 255
              turn_off:
                service: input_boolean.turn_off
                target:
                  entity_id: input_boolean.album_dial_switch
              set_level:
                - service: input_boolean.turn_on
                  target:
                    entity_id: input_boolean.album_dial_switch
                - service: input_number.set_value
                  target:
                    entity_id: input_number.album_dial_brightness
                  data_template:
                    value: "{{ brightness }}"
      
      4.	Restart Home Assistant. Your virtual light (album_dial) should appear in the Matterbridge logs.
      5.	Link Flic Twist to Virtual Light: In the Flic app, go to your Twist settings -> Brightness -> Link to album_dial. Turning the dial now adjusts the brightness.
      

      Optional: Use MQTT for Custom Events

      If you want to integrate with the Flic Hub or other systems, publish MQTT events from Home Assistant:

      1. Install Mosquitto Broker: Add the Mosquitto addon in Home Assistant.
      2. Set up Automation: Edit automations.yaml to publish events to MQTT:
      - id: publish_album_dial_to_mqtt
        alias: Publish Album Dial State to MQTT
        trigger:
          - platform: state
            entity_id: light.album_dial
        action:
          - service: mqtt.publish
            data:
              topic: home/album_dial/switch
              payload: >
                {
                  "state": "{{ 'on' if state_attr('light.album_dial', 'brightness') | int > 0 else 'off' }}",
                  "brightness": "{{ state_attr('light.album_dial', 'brightness') | int }}",
                  "timestamp": "{{ now().timestamp() | int }}"
                }
              retain: true
      
      1. Restart Home Assistant: You should now see MQTT events in the logs or an MQTT client like MQTT Explorer.

      Flic Hub Integration Example

      If you want to work with the Flic Hub, you can subscribe to these MQTT events:
      1. Start a Flic Hub Project: Use flic-hub-sdk-mqtt-js.
      2. Subscribe to MQTT Events: Example main.js script:

      var mqtt = require("./mqtt").create("HOME_ASSISTANT_IP", { port: 1883 });
      
      mqtt.on("connected", function () {
        console.log("Connected");
        mqtt.subscribe("home/album_dial/switch");
      });
      
      mqtt.on("publish", function (pub) {
        console.log("Received: ", pub.message);
        // Example: const message = JSON.parse(pub.message);
      });
      
      mqtt.connect();
      

      Hope this helps someone!

      posted in Developers
      sgemmen
      sgemmen