I have written quite a few microservices at this point:
- sysinfo-microservice - sends period MQTT messages about the host/container's status (uptime, loadavg, and that sort of thing)
- hubitat-microservice - listens to Hubitat hub events via the web socket and Maker APIs and publishes device state changes via MQTT. It accepts MQTT messages to effect a change in any connected device (e.g. turn on fan, or set fan speed to high).
- icomfort-microservice - interfaces to the Lennox icomfort multi-zone (S30) HVAC system.
- tivo-microservice - interfaces to one or more TiVo DVRs or set top boxes.
- macro-microservice - listens for commands to run a macro (a macro is simply a list of topic/commands to send via MQTT, as in a scene)
- nest-microservice - uses the deprecated Google Nest API to monitor and control Nest thermostat and sensors.
- harmony-microservice - monitor and control Logitech Harmony remotes/hubs.
- config-microservice - monitors a global config.js file and when changed publishes via MQTT. Clients and other microservices might detect this message and restart/re-render.
- appletv-microservice - monitors and controls one or more Apple TVs.
- here.com-microservice - provides weather data via MQTT from the here.com cloud API.
- tvguide-microservice - provides TV guide (cable TV lineup, etc.) via MQTT from SchedulesDirect API (subscription is $25/year)
- myq-microservice - monitor and control one or more MyQ garage door openers and sensors
- triggers-microservice - rules machine on steroids
- lgtv-microservice - monitors and controls one or more LG TVs (WebOS)
- denon-microservice - monitors and controls Denon AVRs
- bravia-microservice - monitor and control one or more Sony Bravia TVs.
- autelis-microservice - monitor and control pool and spa equipment
- presence-microservice - monitor iPhones and Apple Watches (probably any device like these) for connected to WiFi.
- roku-microservice - monitor and control Roku streaming devices.
- speak-microservice - on messages with "say" as topic, speaks the message. I run this on a raspberry pi with USB speaker attached.
The advantage of microservices is that you only have to start the ones that are relevant to your situation. If you don't have an autelis pool controller, you don't need to start that microservice.
The advantage of MQTT is that the API is very consistent, the topics are obvious (hubitat/porch light/status, etc.), and any number of www browsers or tablets/phones can control devices and the others see the updates/status ASAP. The status is also sent to all clients when you use the switch on the wall or a physical remote.
Another advantage of MQTT is that you can use CRON tasks, command line tools, scripts in any language you choose, etc., to listen to and send messages. You can make a list of messages and send them (one at a time) to control all the things, no matter which microservice handles them. This allows for a "good night" macro to turn off all the Hubitat things, the hot tub/spa, set the A/C to 72, and so on. Works across cloud services and providers.
I will say that the design of the client is tile based, but there are additional screens more specific to controlling things. The dashboards screen is tab based, each tab represents a dashboard configuration. I have a dashboard for my home theater with tiles relevant to that room, another dashboard (tab) for the master bedroom, and another for my home office.
The tiles subscribe to MQTT events specific to what they control. A switch tile for the kitchen lights might subscribe to hubitat/kitchen lights/status/switch topic and post to Hubitat/kitchen lights/set/switch, message on.
Other tiles are more interesting. The "theater" tile listens to messages for the TiVo, the Apple TV, the Roku, the Harmony Hub, the LG TV, and so on.
RoboDomo also has a very strong theater remote control flavor to it. Very similar to the Logitech Harmony remotes. You assign devices to a theater, and create activities that use the associated devices. For example, the TV activity for the theater might use the Denon AVR, the LG TV, and the TiVo, turning on all the devices needed and setting inputs (HDMI, etc.) to the correct values.
I'll post some screen shots in separate comments after this opening post.
The code is available at RoboDomo · GitHub.
The Documentation Repo is a good start, but it has a lot of work to go to complete it.