🔱Modules Usage
These modules are not created using the autodiscovery, need manual setup or they need to be combined with others to work.
Notification
Sends a notification with a title
and message
. The other options are optional:
iconUrl
: It can be a URL or a local icon.sound
: It can be a WAV file from a URL, a local WAV file or a named sound.urgency
: Available values arelow
,normal
,critical
.timeout
: Duration in milliseconds the notification disappears. This is ignored by GNOME Shell and Notify OSD.buttons
: A list of buttons that should appear on the notification.
service: mqtt.publish
data:
topic: lnxlink/desktop-linux/commands/notify
payload: >-
{ "title": "Notification Title",
"message": "Testing notification",
"iconUrl": "http://hass.local:8123/local/myimage.jpg",
"sound": "http://hass.local:8123/local/mysound.wav",
"urgency": "normal",
"timeout": 1000,
"buttons": ["Open Image"] }
You can create an automation that is triggered when the button is pressed. In this example, it will use the xdg_open
module to open the image.
alias: LNXlink notification button
trigger:
- platform: mqtt
topic: lnxlink/desktop-linux/monitor_controls/notify/button_press
payload: Open Image
value_template: "{{ value_json.button }}"
condition: []
action:
- service: text.set_value
metadata: {}
data:
value: "{{ trigger.payload_json['hints'].get('image-path') }}"
target:
entity_id: text.desktop_linux_xdg_open
RESTful
This could be used as an alternative to MQTT for getting information or controlling the system using HTTP requests by exposing a configurable port which by default is 8112.
Endpoints
GET
/status
Retrieves a list of available modules that support info data.GET
/status/<module>
Get information from the provided module.GET, POST
/control
Retrieves a list of available modules that support control.POST
/control/<module>
Form request data:topic
: <module>_<controlname>, eg. systemd_anydeskmessage
: data to send, eg. off
Usage
GET Requests Use GET requests to fetch information. For example, to obtain the current status, send a request to the
/status
endpoint.POST Requests Use POST requests to send commands and perform actions. Ensure that the POST requests include necessary payload data to specify the action to be performed.
Configuration
The RESTful API is accessible through a configurable port, with the default being 8112. You can modify this setting in the LNXlink configuration file to suit your network requirements.
Statistics
It is used to send basic information of the app to gather daily usage per version.
The data is sent after 15 minutes of startup and then every 24 hours. Only some basic information is sent which includes UUID (a unique identifier that is generated and stored when first used) and the version of the app.
The server is a CloudFlare Worker that stores the data sent by the app including the date and the country the request originated from.
The statistics server is configurable under the configuration file of LNXlink, so you can use your own analytics server. By setting the URL to null or excluding the statistics module, you can disable it from sending any data.
Voice Assistant
The Speech Recognition module listens to the user's input and sends the response as an attribute to the binary sensor of speech recognition entity.
For the automation to work you will need to setup the Media Player.
Turn PC On or Off
Combine with Wake on Lan to control your PC with one switch:
switch:
- platform: template
switches:
my_pc:
friendly_name: "My PC"
unique_id: my_pc
value_template: "{{ not is_state('button.shutdown', 'unavailable') }}"
turn_on:
service: switch.turn_on
data:
entity_id: switch.pc_wol
turn_off:
service: button.press
data:
entity_id: button.shutdown
Open a URL or File
service: mqtt.publish
data:
topic: lnxlink/desktop-linux/commands/xdg_open
payload: "https://www.google.com" # or "myimg.jpeg" for file
Keys Send
Send a series of keys:
service: mqtt.publish
data:
topic: lnxlink/desktop-linux/commands/send_keys
payload: "ctrl+f H e l l o space W o r l d"
You can create a virtual keyboard on your frontend:


Install Update
When a new version of LNXlink is available the update sensor on Home Assistant activates the INSTALL button, but when you are using the development installation this option doesn't get activated. You can manually send the MQTT topic to start the update:
service: mqtt.publish
data:
topic: lnxlink/desktop-linux/commands/update/update
Set unavailable after shutdown
Just before LNXlink stops, it sends to MQTT an OFF command, but sometimes it doesn't stop gracefully. To fix this, you will have to create an automation on Home Assistant which checks for when was the last time one of the sensors got a value and if it exceeds it sends the OFF command to the MQTT server.
This is an example of the automation which checks events for the idle sensor:
alias: lnxlink powered down
description: ""
mode: single
trigger:
- platform: template
value_template: >-
{{ (now() | as_timestamp -
states.sensor.desktop_linux_idle.last_changed | as_timestamp) >
10 }}
condition: []
action:
- service: mqtt.publish
data:
qos: 0
retain: true
topic: lnxlink/desktop-linux/lwt
payload: "OFF"
Last updated