The component allows you to manage systemd services via D-Bus
- This component uses
D-Bus
to controlsystemd
. You need to have D-Bus itself and its python bindings in order to use this component:
sudo apt install dbus libdbus-glib-1-dev libdbus-1-dev python-dbus
- You also need to set up a
polkit
rule so that your user can control systemd via D-Bus. To do this, run the command and paste the content:
sudo nano /etc/polkit-1/localauthority/50-local.d/systemd-manager.pkla
[Allow user systemd-manager to execute systemctl commands]
Identity=unix-user:<your user from which hass is executed.>
Action=org.freedesktop.systemd1.manage-units
ResultAny=yes
Not yet tested
Installed through the custom repository HACS - dmamontov/hass-systemd-manager
Or by copying the systemd_manager
folder from the latest release to the custom_components folder (create if necessary) of the configs directory.
Settings
> Integrations
> Plus
> Systemd Manager
All you have to do is select the systemd services you want to manage.
- Only one configuration is allowed;
- Do not select all services, this increases the load on the processor, especially D-Bus;
To get the status of the services, the component requests the status of the services every 10 seconds. This value can be changed in the component's settings.
All services support only entity_id.
start
service: systemd_manager.start
data:
mode: REPLACE # One of REPLACE, FAIL, ISOLATE, IGNORE_DEPENDENCIES, IGNORE_REQUIREMENTS
target:
entity_id: switch.systemd_...
stop
service: systemd_manager.stop
data:
mode: REPLACE # One of REPLACE, FAIL, IGNORE_DEPENDENCIES, IGNORE_REQUIREMENTS
target:
entity_id: switch.systemd_...
restart
service: systemd_manager.restart
data:
mode: REPLACE # One of REPLACE, FAIL, IGNORE_DEPENDENCIES, IGNORE_REQUIREMENTS
target:
entity_id: switch.systemd_...
enable
service: systemd_manager.enable
target:
entity_id: switch.systemd_...
disable
service: systemd_manager.disable
target:
entity_id: switch.systemd_...
- Install Flex Table from HACS
- Add new Lovelace tab with Panel Mode
- Add new Lovelace card: