Internet Of Things (IOT) integration with Linux using MQTT
Reason this release was yanked:
WIP
Project description
LNX link
This is a Linux service for integrating your system with an external application like Home Assistant using MQTT. It is inspired by IOT Link.
Features
- System control: Shutdown, Restart, Send Keys, Notify, Media, Screen On/Off.
- System monitor: CPU, Ram, Network, Media, Microphone, Idle, Bluetooth battery.
- Home Assistant: Uses MQTT Autodiscovery to create entities.
- No sudo required: No need to be root user to install and use, unless used on server setup.
- Easily expanded: Any new module is automatically imported.
Installation
One command install and update:
bash <(curl -s "https://raw.githubusercontent.com/bkbilly/lnxlink/master/install.sh")
You can manually update the configuration file /opt/lnxlink/config.yaml
and restart the service with the use of systemctl:
systemctl --user restart lnxlink.service
Examples
Send a notification with an image as a preview:
service: mqtt.publish
data:
topic: {prefix}/{clientId}/commands/notify
payload: >-
{ "title": "Notification Title",
"message": "Testing notification",
"iconUrl": "http://hass.local:8123/local/myimage.jpg" }
Send a series of keys:
service: mqtt.publish
data:
topic: {prefix}/{clientId}/commands/send-keys
payload: "<CTRL>+t"
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
Create a media player using mqtt-mediaplayer using the information collected from the media sensor:
Technical Notes (click to expand)
Creating new senosr
To expand the supported features, create a new python file on modules folder and use this template:
class Addon():
name = 'Example'
icon = 'mdi:home-assistant'
unit = ''
def startControl(self, topic, data):
''' When a command is sent, it will run this method '''
print(topic, data)
def getInfo(self):
''' Returns any type that can be converted to JSON '''
return 15
def exposedControls(self):
''' Optional method which exposes an entity '''
return {
"mybutton": {
"type": "button",
"icon": "mdi:button-cursor",
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lnxlink-2022.10.0.tar.gz
(12.7 kB
view hashes)
Built Distribution
Close
Hashes for lnxlink-2022.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f003b972cedcba881d156c532b423c06d3381e320e3433402ea5bf8cf508252d |
|
MD5 | 160ed32ee4a63215ddb3e1157a634e1a |
|
BLAKE2b-256 | 88868b2752a861533f6eb5dcc0bad30599e4baf7af0712ca0ba82ce0894dd8e7 |