View on GitHub Add to HACS

Merging gaming and smart home technologies, I recently embarked on a project to streamline game control through Home Assistant using Playnite. Originally, my proof-of-concept (PoC) involved several moving parts, including MongoDB, Docker containers, and more. However, I’ve now simplified this setup significantly by creating a custom Home Assistant integration that interacts directly with Playnite via MQTT (Playnite Web Plugin), removing much of the complexity and overhead.

What Changed?

Previously, I used a Playnite dashboard on Home Assistant, integrating various components like a Node.js API and MongoDB to manage game states and covers. In the updated version, I leverage the Playnite Web Plugin and the newly developed Playnite Web MQTT Home Assistant Integration to achieve a more seamless experience.

The Playnite Web Plugin communicates with Playnite via MQTT, and the Home Assistant integration converts these MQTT messages into devices like switches to start and stop games.

Since games are represented as switches they can easily be controlled via Home Assistant’s dashboard, voice assistants, or other integrations. Additionally, users can add custom scripts to automate more advanced game control and management.

For example you can expose the game switches to Google Assistant and control your games with voice commands.

Current Features

  • Game Control via Switches: Each game has a switch entity in Home Assistant for starting and stopping games.
  • Custom Scripts: Users can add custom scripts for more advanced control and automation when launching or stopping games.
  • Cover Image and Metadata Retrieval: Games’ metadata, including cover images, is fetched and displayed in the Home Assistant dashboard.

Limitations

  • Stopping Games: Stopping a game doesn’t work fully due to limitations in Playnite itself. However, some workarounds using techniques similar to the PlayState plugin may allow game stopping in the future.
  • Game State Accuracy: Game state data is not entirely accurate because the Playnite Web Plugin does not publish persistent MQTT messages regarding the game state. Additionally, it doesn’t differentiate between different releases of the same game.

Future Plans

I plan to explore integrating PlayState’s functionality and enhancing the game state system by allowing better detection of which game release is active.

Conclusion

Thanks to @andrew-codes for his fantastic work on the Playnite Web Plugin, which made this integration possible. Although it’s still a work in progress, this integration marks a significant step forward in combining gaming with home automation.

Resources

View on GitHub Add to HACS