-
Notifications
You must be signed in to change notification settings - Fork 0
Home Assistant automation
- Login to your Home Assistant server
- Make sure you've installed and configure the Mosquitto Broker add-on
- Create a user in Mosquito (and reduce the user's access if you want to be security conscious)
Begin creating an automation in the Home Assistant web app:
-
Settings > Automations & scenes > "+ Create Automation" > Create new automation
-
Set what should trigger ScreenSleeper under "When" (for example, a long press of an off button)
-
Under "Then do", add action "MQTT: Publish".
-
For topic: "my_pc/sleep/set"
-
For payload: "on"
-
Retain: off (unchecked)
-
Save automation
Example "Then do"
Note: You can customize the topic and payload to anything you like, just set them the same in ScreenSleeper's config. It's a convention in MQTT to pick a topic which ends with "/set" to indicate a request to set something.
The actual action taken by ScreenSleeper will depend on what is set for the Action
in the config. The default is to sleep the monitor and go to the lock screen.
- Copy MQTT details (topic and payload) to ScreenSleeper's config file
Hint:
- You can use "+ Add Action" to add another action to the same Automation, so you can turn off your lights at the same time as your PC screen.