<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Flic Twist and Home Assistant for Twist Events]]></title><description><![CDATA[<p dir="auto">TL;DR: If you use Home Assistant, getting programmatic access to Flic Twist  events is doable.</p>
<p dir="auto"><img src="https://camo.nodebb.org/2bbe4d3de734b0907d0b140c22810ba1b747e483?url=https%3A%2F%2Fimg.youtube.com%2Fvi%2Fvk94HH6OKEI%2Fmaxresdefault.jpg" alt="alt text" class=" img-responsive img-markdown" /></p>
<p dir="auto"><a href="https://youtube.com/shorts/vk94HH6OKEI?si=wHioNnW3-7Nc5gYW" rel="nofollow ugc">https://youtube.com/shorts/vk94HH6OKEI?si=wHioNnW3-7Nc5gYW</a></p>
<p dir="auto">This video shows using the twist events to switch pandora radio stations. Each of the 25 clicks on the twist is a station.</p>
<p dir="auto">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.</p>
<p dir="auto">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.</p>
<ol>
<li>Have Home Assistant: I use Home Assistant OS on a Raspberry Pi 4.</li>
<li>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 -&gt; Matter.” Matterbridge expos<br />
<a href="https://github.com/t0bst4r/matterbridge-home-assistant-addon?tab=readme-ov-file" rel="nofollow ugc">https://github.com/t0bst4r/matterbridge-home-assistant-addon?tab=readme-ov-file</a></li>
<li>Configure a Virtual Light:</li>
</ol>
<ul>
<li>Install the Home Assistant File Editor.<br />
<a href="https://github.com/home-assistant/addons/blob/master/configurator/DOCS.md" rel="nofollow ugc">https://github.com/home-assistant/addons/blob/master/configurator/DOCS.md</a></li>
<li>Edit configuration.yaml to add a virtual light. Example configuration:</li>
</ul>
<pre><code>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 }}"
</code></pre>
<pre><code>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 -&gt; Brightness -&gt; Link to album_dial. Turning the dial now adjusts the brightness.
</code></pre>
<p dir="auto">Optional: Use MQTT for Custom Events</p>
<p dir="auto">If you want to integrate with the Flic Hub or other systems, publish MQTT events from Home Assistant:</p>
<ol>
<li>Install Mosquitto Broker: Add the Mosquitto addon in Home Assistant.</li>
<li>Set up Automation: Edit automations.yaml to publish events to MQTT:</li>
</ol>
<pre><code>- 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: &gt;
          {
            "state": "{{ 'on' if state_attr('light.album_dial', 'brightness') | int &gt; 0 else 'off' }}",
            "brightness": "{{ state_attr('light.album_dial', 'brightness') | int }}",
            "timestamp": "{{ now().timestamp() | int }}"
          }
        retain: true
</code></pre>
<ol start="3">
<li>Restart Home Assistant: You should now see MQTT events in the logs or an MQTT client like MQTT Explorer.</li>
</ol>
<p dir="auto">Flic Hub Integration Example</p>
<p dir="auto">If you want to work with the Flic Hub, you can subscribe to these MQTT events:<br />
1.	Start a Flic Hub Project: Use flic-hub-sdk-mqtt-js.<br />
2.	Subscribe to MQTT Events: Example main.js script:</p>
<pre><code>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();
</code></pre>
<p dir="auto">Hope this helps someone!</p>
]]></description><link>https://community.flic.io/topic/18510/flic-twist-and-home-assistant-for-twist-events</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 13:30:28 GMT</lastBuildDate><atom:link href="https://community.flic.io/topic/18510.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Dec 2024 19:29:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Flic Twist and Home Assistant for Twist Events on Wed, 21 May 2025 14:17:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.flic.io/uid/5018">@sgemmen</a> Thanks for this, finally got around to setting it up. It wasn't working at first but realised I needed to add the two helpers (boolean and number) for the targets of the service.</p>
<p dir="auto">Now I need to work on using it to adjust all the lights in a room while keeping the relative brightness of them the same.</p>
<p dir="auto">EDIT: Found this add-on which seems to work - <a href="https://community.home-assistant.io/t/relative-brightness-light-group/695450" rel="nofollow ugc">https://community.home-assistant.io/t/relative-brightness-light-group/695450</a> - brightness changes are a bit jerky (not sure if this related to flic, the add-on, or something else) but it does the job for now.</p>
]]></description><link>https://community.flic.io/post/21904</link><guid isPermaLink="true">https://community.flic.io/post/21904</guid><dc:creator><![CDATA[Matthew Griffin]]></dc:creator><pubDate>Wed, 21 May 2025 14:17:45 GMT</pubDate></item></channel></rss>