We control Led FX installed on Windows
Download LedFX for Windows
More details can be read here
Documentation
I will share my configuration option. It may be useful. The thing is that the integration of LedFX, as the author writes, is no longer supported by the author, maybe I misunderstood him, but not the point. I have this integration on the Home Assistant did not work, maybe it works with the LedFX addon, but I do not need the LedFX addon, since the LedFX server is running on Windows
Integration does not work, although the LedFX server itself is running
We create scenes in Led FX and name them as it is convenient for us
Next, you need to find out the name of the scene. We enter it in the browser and look at the data
http://127.0.0.1:8888/api/scenes
We are looking for the lines of the names of our scenes. Your scenes can be named in their own way, but the principle of search is the same. In my case, the scenes have names like in the screenshot, and through json we are looking for the names of our scenes. We will use them to create switches
Creating switches using integration Command line Switch
For all command_off we use the same equalizer off, and for command_on we specify which equalizer we need to turn on. The status does not change quickly, I specified 10 seconds.
switch:
- platform: command_line
switches:
ledfx_scene_visualiser_blade_power:
friendly_name: "LedFX Visualiser BladePower"
command_timeout : 10
icon_template: mdi:music
command_on: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"blade-power","action":"activate"}'
command_off: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"music-off","action":"activate"}'
command_state: curl -X GET 'http://192.168.5.27:8888/api/devices' | grep 'blade_power(Reactive)'
- platform: command_line
switches:
ledfx_scene_visualiser_bands:
friendly_name: "LedFX Visualiser Bands"
command_timeout : 10
icon_template: mdi:music
command_on: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"bands","action":"activate"}'
command_off: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"music-off","action":"activate"}'
command_state: curl -X GET 'http://192.168.5.27:8888/api/devices' | grep 'bands(Reactive)'
- platform: command_line
switches:
ledfx_scene_visualiser_energy:
friendly_name: "LedFX Visualiser Energy"
command_timeout : 10
icon_template: mdi:music
command_on: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"energy","action":"activate"}'
command_off: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"music-off","action":"activate"}'
command_state: curl -X GET 'http://192.168.5.27:8888/api/devices' | grep 'energy(Reactive)'
Let’s create a script for the hidden launch of Led FX via IOT Link
Here are more examples of how it is configured
If you want to see that the Led FX server is running, then specify in “visible”: true, “fallback”: true
sequence:
- service: mqtt.publish
data:
topic: iotlink/workgroup/home/commands/run
payload: >-
{ "command": "C:\\Program Files (x86)\\LedFx\\data\\LedFx.exe", "args":
"--open-ui", "path": "C:\\Program Files (x86)\\LedFx\\data", "user": "",
"visible": false, "fallback": false }
retain: false
qos: '0'
mode: single
alias: 'Starting the server LedFX '
icon: mdi:television-ambient-light
Let’s create an Led FX addon for IOS Link so that the Home Assistant has a Led FX status sensor
It will look like this
1)First in the folder c:\ProgramData\IOTLink\Addons\ProcessMonitor\apps\ create a file LedFX.yaml
We stuff the code into the file
############################################################################
# Process Monitor
############################################################################
# Define configuration for monitoring a specific process.
############################################################################
# processes: Process names (without .exe) to be monitored.
# windows: Process window titles considered. Regex Accepted.
# classnames: Process class names considered. Regex Accepted.
# configs:
# enabled: Enable/Disable.
# discoverable: Enable/Disable HA Auto Discovery.
# advancedMode: Enable HA Auto Discovery for advanced stats (MEM, CPU, etc).
# displayName: Display Name used for HA Auto Discovery.
# cacheable: Enable/Disable caching monitor values.
# grouped: Group similar processes information.
# true: All similar processes information (memory, cpu, etc) grouped.
# false: Consider only the first process found.
# interval: Interval for refreshing this information.
# compareType: Comparison used to match windows and classnames.
# 0: Should MATCH ALL windows AND MATCH ALL classnames
# 1: Should MATCH ALL windows OR MATCH ALL classnames
# 2: Should MATCH ALL windows AND AT LEAST ONE classnames
# 3: Should MATCH ALL classnames AND AT LEAST ONE window
# 4: Should MATCH AT LEAST ONE window OR AT LEAST ONE classnames
############################################################################
# LedFx color music for WLED
processes:
- LedFx.exe
windows:
classnames:
configs:
enabled: true
discoverable: true
advancedMode: false
displayName: LedFx
cacheable: true
grouped: true
compareType: 0
interval: 10
-
Next, open config.yml, located on the path c:\ProgramData\IOTLink\Addons\ProcessMonitor\
-
Find the line monitors and add LedFX: !include apps/LedFX.yaml
monitors:
LedFX: !include apps/LedFX.yaml
- We save and launch LedFX, a topic should appear in MQTT Explorer, and a LedFX sensor will appear in Home Assistant through MQTT integration. Search for it in the Name of your PC Processes
Текст на русском (Text in Russian)
Управляем LedFX, установленный на Windows.
Скачать LedFX для Windows
Более подробно можно почитать здесь
Документация
Поделюсь своим вариантом настройки. Может будет полезным. Все дело в том, что интеграция LedFX как пишет автор, больше не поддерживается автором, может я и неправильно его понял, но не суть. У меня данная интеграция на Home Assistant не заработала, возможно это работает с аддоном LedFX, но мне аддон LedFX не нужен, так как сервер LedFX запущен на Windows/
Интеграция не работает, хотя сам сервер LedFX запущен
Создаем в LedFX сцены и именуем как нам удобно
Далее, нужно узнать имя сцены. Вводим в браузере и смотрим на данные
http://127.0.0.1:8888/api/scenes
Ищем строки названия своих сцен. У вас сцены могут именоваться по своему, но принцип поиска одинаковый. В моем случае сцены имеют названия как на скриншоте, а через json мы ищем названия своих сцен. Их будем применять для создания выключателей
Создаем выключатели используя интеграцию Command line Switch
Для всех command_off используем одинаковое выключение эквалайзера, а для command_on указываем какой эквалайзер нам надо включить. Статус меняется не быстро, я указал 10 секунд.
switch:
- platform: command_line
switches:
ledfx_scene_visualiser_blade_power:
friendly_name: "LedFX Visualiser BladePower"
command_timeout : 10
icon_template: mdi:music
command_on: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"blade-power","action":"activate"}'
command_off: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"music-off","action":"activate"}'
command_state: curl -X GET 'http://192.168.5.27:8888/api/devices' | grep 'blade_power(Reactive)'
- platform: command_line
switches:
ledfx_scene_visualiser_bands:
friendly_name: "LedFX Visualiser Bands"
command_timeout : 10
icon_template: mdi:music
command_on: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"bands","action":"activate"}'
command_off: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"music-off","action":"activate"}'
command_state: curl -X GET 'http://192.168.5.27:8888/api/devices' | grep 'bands(Reactive)'
- platform: command_line
switches:
ledfx_scene_visualiser_energy:
friendly_name: "LedFX Visualiser Energy"
command_timeout : 10
icon_template: mdi:music
command_on: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"energy","action":"activate"}'
command_off: curl -L -X PUT 'http://192.168.5.27:8888/api/scenes' --data-raw '{"id":"music-off","action":"activate"}'
command_state: curl -X GET 'http://192.168.5.27:8888/api/devices' | grep 'energy(Reactive)'
Создадим скрипт для скрытного запуска LedFX через IOT Link
Вот еще примеры как это настраивается
Если хотите видеть, что сервер LedFX запущен, то укажите в “visible”: true, “fallback”: true
sequence:
- service: mqtt.publish
data:
topic: iotlink/workgroup/home/commands/run
payload: >-
{ "command": "C:\\Program Files (x86)\\LedFx\\data\\LedFx.exe", "args":
"--open-ui", "path": "C:\\Program Files (x86)\\LedFx\\data", "user": "",
"visible": false, "fallback": false }
retain: false
qos: '0'
mode: single
alias: 'Запуск сервера LedFX '
icon: mdi:television-ambient-light
Создадим аддон LedFX для IOT Link, чтобы в Home Assistant был сенсор состояния LedFX
Выглядеть это будет вот так
- Сперва в папке c:\ProgramData\IOTLink\Addons\ProcessMonitor\apps\ создадим файлик LedFX.yaml и в файлик запихиваем код. Код ниже
В файлик запихиваем код
############################################################################
# Process Monitor
############################################################################
# Define configuration for monitoring a specific process.
############################################################################
# processes: Process names (without .exe) to be monitored.
# windows: Process window titles considered. Regex Accepted.
# classnames: Process class names considered. Regex Accepted.
# configs:
# enabled: Enable/Disable.
# discoverable: Enable/Disable HA Auto Discovery.
# advancedMode: Enable HA Auto Discovery for advanced stats (MEM, CPU, etc).
# displayName: Display Name used for HA Auto Discovery.
# cacheable: Enable/Disable caching monitor values.
# grouped: Group similar processes information.
# true: All similar processes information (memory, cpu, etc) grouped.
# false: Consider only the first process found.
# interval: Interval for refreshing this information.
# compareType: Comparison used to match windows and classnames.
# 0: Should MATCH ALL windows AND MATCH ALL classnames
# 1: Should MATCH ALL windows OR MATCH ALL classnames
# 2: Should MATCH ALL windows AND AT LEAST ONE classnames
# 3: Should MATCH ALL classnames AND AT LEAST ONE window
# 4: Should MATCH AT LEAST ONE window OR AT LEAST ONE classnames
############################################################################
# LedFx светомузыка для WLED
processes:
- LedFx.exe
windows:
classnames:
configs:
enabled: true
discoverable: true
advancedMode: false
displayName: LedFx
cacheable: true
grouped: true
compareType: 0
interval: 10
-
Далее открываем config.yaml, расположенный по пути c:\ProgramData\IOTLink\Addons\ProcessMonitor\
-
Находим строчку monitors и добавляем LedFX: !include apps/LedFX.yaml
monitors:
LedFX: !include apps/LedFX.yaml
- Сохраняем и запускаем LedFX, в MQTT Explorer должен появиться топик, а в Home Assistant, через интеграцию MQTT появится сенсор LedFX. Искать его в Имя вашего ПК Processes