All Projects → sleevezipper → Hass Workstation Service

sleevezipper / Hass Workstation Service

Licence: apache-2.0
Provide useful sensors and services from your workstation to Home Assistant.

Projects that are alternatives of or similar to Hass Workstation Service

Frigate
NVR with realtime local object detection for IP cameras
Stars: ✭ 1,329 (+571.21%)
Mutual labels:  home-assistant, mqtt
Itead sonoff
Alternative firmware for Itead Sonoff switches, based on the MQTT protocol and a TLS connection
Stars: ✭ 115 (-41.92%)
Mutual labels:  home-assistant, mqtt
Home Assistant Configuration
My Home Assistant Config. For more Information visit ->
Stars: ✭ 102 (-48.48%)
Mutual labels:  home-assistant, mqtt
Arilux al Lc0x
Alternative firmware for Arilux AL-LC0X LED controllers, based on the MQTT protocol and a TLS connection
Stars: ✭ 194 (-2.02%)
Mutual labels:  home-assistant, mqtt
Zm1
斐讯M1空气检测仪个人固件公开项目. 此项目为公开release+讨论
Stars: ✭ 165 (-16.67%)
Mutual labels:  home-assistant, mqtt
Addon Zwave2mqtt
Z-Wave to MQTT - Home Assistant Community Add-ons
Stars: ✭ 58 (-70.71%)
Mutual labels:  home-assistant, mqtt
Ha Shellies Discovery
Script that adds MQTT discovery support for Shellies devices
Stars: ✭ 113 (-42.93%)
Mutual labels:  home-assistant, mqtt
Smarthome
SmartHome: firmware per ESP8266 - Casa domotica
Stars: ✭ 28 (-85.86%)
Mutual labels:  home-assistant, mqtt
Temper Esp8266
Temper is a compact temperature sensor based on ESP8266 and SHT30 with large 13x7 pixel led display.
Stars: ✭ 155 (-21.72%)
Mutual labels:  home-assistant, mqtt
System sensors
Logging of system sensor specific for the RPI and sending them to a MQTT broker
Stars: ✭ 134 (-32.32%)
Mutual labels:  home-assistant, mqtt
Homeautomation.codesys3
Home Automation system build in CoDeSys 3 with MQTT communication to any third party Home Automation software
Stars: ✭ 55 (-72.22%)
Mutual labels:  home-assistant, mqtt
Openmqttgateway
MQTT gateway for ESP8266, ESP32, Sonoff RF Bridge or Arduino with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility, SMS & LORA.
Stars: ✭ 2,413 (+1118.69%)
Mutual labels:  home-assistant, mqtt
Wavin Ahc 9000 Mqtt
Esp8266 mqtt interface for Wavin AHC-9000/Jablotron AC-116
Stars: ✭ 47 (-76.26%)
Mutual labels:  home-assistant, mqtt
Pysmartnode
Micropython Smarthome framework
Stars: ✭ 58 (-70.71%)
Mutual labels:  home-assistant, mqtt
Open Home
Projeto de automação residencial usando softwares e hardwares open source.
Stars: ✭ 41 (-79.29%)
Mutual labels:  home-assistant, mqtt
Loadcelloccupany
Home automation occupancy sensor using load cells
Stars: ✭ 103 (-47.98%)
Mutual labels:  home-assistant, mqtt
Ipban
IPBan Monitors failed logins and bad behavior and bans ip addresses on Windows and Linux. Highly configurable, lean and powerful. Learn more at -->
Stars: ✭ 652 (+229.29%)
Mutual labels:  service, desktop
Open Home Automation
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
Stars: ✭ 820 (+314.14%)
Mutual labels:  home-assistant, mqtt
Android Mqtt Alarm Panel
Android Alarm Panel for Home Assistant and Home Automation Platforms (http://thanksmister.com/android-mqtt-alarm-panel/)
Stars: ✭ 124 (-37.37%)
Mutual labels:  home-assistant, mqtt
Home Assistant Config Fr
🏠Configuration de Home Assistant en français. 👨🏻‍💻 N'hésitez pas à ⭐ mon repo et à copier les bonnes idées ! 🇨🇵
Stars: ✭ 175 (-11.62%)
Mutual labels:  home-assistant, mqtt

HASS Workstation Service

This goal of this project is to provide useful sensors and services from your workstation to Home Assistant through MQTT. It accomplishes this goal by:

  • Running in the background as a service
  • Being lightweight so you'll never notice it
  • Using well defined standards
  • Being local when you want it to, only communicating through your own MQTT broker
  • Being easy to configure
  • Using secure communication

It will try to futher accomplish this goal in the future by:

  • Being platform independent

Screenshots

The settings screen

The resulting sensors and commands in Home Assistant

Installation

You can get the installer from here. When using the installer, the application checks for updates on startup. This is the recommended way to install for most users. Note: You'll get a Windows Smartscreen warning because the code was self signed. You can click "More info" and then "Run anyway" to proceed with installing.

Standalone

If you don't want to use the installer, standalone is what you need. Make sure to install .NET 5 Runtime first. Find the standalone version releases on GitHub here. Unpack all files to a folder and run hass-workstation-service.exe. This is the background service and you can use UserInterface.exe to configure the service. There is no automatic (or prompted) updating in the standalone version.

Getting Started

As a prerequisite, make sure you have an MQTT username and password available. Using Home Assistant in combination with the Mosquitto broker add-on and integration? You can both use a Home Assistant account and a local account. From a security perspective, we recommend a local account as this only provides access to the MQTT Broker and not to your Home Assistant instance.

Now that you are all set, make sure to run the hass-workstation-service.exe executable first. This executable is responsible for setting up the sensors and talking with your MQTT Broker. To configure the service, start the UserInterface.exe executable. Add your hostname or IP address, port, username and password and click on Save. In case you use the Mosquitto add-in, provide port 8883 and check Use TLS. The application will mention "All good" when configured correctly.

Updating

If you used the installer, the app checks for updates on startup. If an update is available you will be prompted to install. If you use the standalone, just delete all files from the previous install and unpack the zip to the same location as before.

Need help?

Find us on Discord.

Development

Want to develop or build the application yourself? Make sure to install the .NET Runtime .NET 5 Runtime and .NET 5 SDK. Run the following commands from the hass-workstation-service\hass-workstation-service directory to get you started:

dotnet build
dotnet publish

In case you are using Visual Studio Code, open the hass-workstation-service\hass-workstation-service folder to take advantage of the predefined build and publish tasks.

Sensors

The application provides several sensors. Sensors can be configured with a name and this name will be used in the MQTT topic like this: homeassistant/sensor/{DeviceName}/{Name}/state. Sensors will expose themselves through MQTT discovery and will automatically appear in Home assistant or any other platform that supports this type of configuration.

Sensors publish their state on their own interval which you can configure and only publish when the state changes.

UserNotificationState

This sensor watches the UserNotificationState. This is normally used in applications to determine if it is appropriate to send a notification but we can use it to expose this state. Notice that this status does not watch Focus Assist. It has the following possible states:

State Explanation
NotPresent A screen saver is displayed, the machine is locked, or a nonactive Fast User Switching session is in progress.
Busy A full-screen application is running or Presentation Settings are applied. Presentation Settings allow a user to put their machine into a state fit for an uninterrupted presentation, such as a set of PowerPoint slides, with a single click.
RunningDirect3dFullScreen A full-screen (exclusive mode) Direct3D application is running.
PresentationMode The user has activated Windows presentation settings to block notifications and pop-up messages.
AcceptsNotifications None of the other states are found, notifications can be freely sent.
QuietTime Introduced in Windows 7. The current user is in "quiet time", which is the first hour after a new user logs into his or her account for the first time. During this time, most notifications should not be sent or shown. This lets a user become accustomed to a new computer system without those distractions. Quiet time also occurs for each user after an operating system upgrade or clean installation.
RunningWindowsStoreApp A Windows Store app is running.

ActiveWindow

This sensor exposes the name of the currently focused window.

WebcamActive

This sensor shows if the webcam is currently being used. It uses the Windows registry to check will work from Windows 10 version 1903 and higher.

MicrophoneActive

This sensor shows if the microphone is currently being used. It uses the Windows registry to check and will work from Windows 10 version 1903 and higher.

CPULoad

This sensor checks the current CPU load. It averages the load on all logical cores every second and rounds the output to two decimals.

GPULoad

This sensor returns the current GPU load. This should work for both NVidia and AMD GPU's.

GPUTemperature

This sensor returns the current temperature of the GPU in °C. This should work for both NVidia and AMD GPU's.

UsedMemory

This sensor calculates the percentage of used memory.

CurrentClockSpeed

This sensor returns the BIOS configured baseclock for the processor.

WMIQuery

This advanced sensor executes a user defined WMI query and exposes the result. The query should return a single value.

For example:

SELECT * FROM Win32_Processor

returns

|64|9|To Be Filled By O.E.M.|3|Intel64 Family 6 Model 94 Stepping 3|252|1|Win32_Processor|4008|12|64|Intel64 Family 6 Model 94 Stepping 3|CPU0|100|198|1024|8192|0|6|4|GenuineIntel|4008|Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz|4|4|8|To Be Filled By O.E.M.|False|BFEBFBFF000506E3|3|24067|CPU|False|To Be Filled By O.E.M.|U3E1|OK|3|Win32_ComputerSystem|GAME-PC-2016|8|1|False|False|

This cannot not be used for this sensor. Instead try

SELECT CurrentClockSpeed FROM Win32_Processor

which results in 4008 for my PC.

You can use WMI Explorer to find see what data is available.

Here's some queries from other users:

Query Explanation Thanks
SELECT username FROM Win32_ComputerSystem Shows the current user @grizzlyjere

Want to add you query here? Please create a pull request or open an issue.

LastActive

This sensor returns the date/time that the workstation was last active. Typing or moving your mouse will reset the date/time.

LastBoot

This sensor returns the date/time that Windows was last booted.

SessionState

This sensor returns the current session state. It has the following possible states:

State Explanation
Locked All user sessions are locked.
LoggedOff No users are logged in.
InUse A user is currently logged in.
Unknown Something went wrong while getting the status.

CurrentVolume

This sensor returns the volume of the currently playing audio. So if you're listening to music and you pause, this sensor will return 0 (or at least a very low value).

State Explanation
Locked All user sessions are locked.
LoggedOff No users are logged in.
InUse A user is currently logged in.
Unknown Something went wrong while getting the status.

Dummy

This sensor spits out a random number every second. Useful for testing, maybe you'll find some other use for it.

Commands

Commands can be used to trigger certain things on the client. For each command, a switch will be available in Home Assistant. Turning on the switch fires the command on the client and it will turn the switch off when it's done. Turning it off will cancel the running command.

ShutdownCommand

This command shuts down the computer immediately. It runs shutdown /s.

RestartCommand

This command restarts the computer immediately. It runs shutdown /r.

LogOffCommand

This command logs off the current user. It runs shutdown /l.

CustomCommand

This command allows you to run any Windows Commands. The command will be run in a hidden Command Prompt. Some examples:

Command Explanation
Rundll32.exe user32.dll,LockWorkStation This locks the current session.
shutdown /s /t 300 Shuts the PC down after 5 minutes (300 seconds).
C:\path\to\your\batchfile.bat Run the specified batch file.

KeyCommand

Sends a keystroke with the specified key. You can pick any of these key codes.

Media Commands

There's several media commands available which are very self exlanatory.

  • Play/Pause
  • Next
  • Previous
  • Volume up
  • Volume down
  • Mute (toggle)

Credits

This project depends on work done by others and they should at least get a mention. Please note that this list is not complete yet.

CoreAudio

CoreAudio was used to check the current volume of playing audio.

LibreHardwareMonitor

We use this for our GPU sensors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].