Sweet home Scala 3
summary
Built a small production-ish automation engine that runs on a Raspberry Pi and talks to Home Assistant over Scala 3 with Home Assistant via WebSocket JSON. Uses custom typeclass-derived JSON formats (falls back to an unknown event), enqueues messages with monotonically increasing ids to match async responses, and models automations as pure-value triggers/actions with three-state reactions. Replaces Node-RED/Python for the fun of exploring derived JSON formats using Scala 3 typeclass derivation and Tasks/ZIO; demo toggles lights, shows notifications, and works, including a quirky compiler-driven RGB blink.
AI-written summary · about
chapters (10)
- 0:00Start
- 5:22The Home Assistant
- 6:31Dashboard
- 11:35Set Up the Goals
- 13:35Communicate with Home Assistant
- 17:37Derived Json Format
- 21:01Fallback Member Extractor
- 27:52Triggers
- 31:15Recap the Automation
- 38:53Light Notification
related talks
49mStream Away with Scala
46mScala on the Move!
47mServerless Scala - Functions as SuperDuperMicroServices
48mReal-World Functional Scala
40mREST no more - Using Actors for the Internet of LEGO...
32mProduction-ready direct-style Scala
29mFull Stack Scala Web Application.
31mSCALA FROM B TO F - BACKEND DEVELOPER ON FRONTEND
