i8beef / HomeAutio.Mqtt.GoogleHome

MIT License
215 stars 29 forks source link

Announce: 2.0 #117

Closed i8beef closed 2 years ago

i8beef commented 3 years ago

Announcing the 2.0 release of HomeAutio.Mqtt.GoogleHome! This is a major release with some breaking changes. The biggest change is that with google now publishing a public schema for the google smart home contract, a lot of pieces can be simplified and moved from HARD CODED (and hand maintained) to CONFIGURATION based (via these schema files), which hopefully will make long term maintenance and expansion far easier.

Changes include:

  1. Upgraded to .NET 5.0, and updated all libraries. Should see a performance / memory benefit from this.
  2. Adds LinearRange ValueMap which can map values bi-directionally between two arbitrary ranges by calculation automatically (for instance, Google accepting 0..99 as values, and your lights using 0..254, etc.) (See #113 )
  3. All QUERY and EXECUTE intent responses will now automatically include online for every device without having to manually include it. This has largely worked in the past, but might be "more correct" now (see: #108 )
  4. Makes topicRoot configurable now that command delegation will always publish, etc. Configured by mqtt:topicRoot, but will still default to "google/home" when omitted (see: #109 )
  5. Begins using Google's published schema files for validation, examples, etc.
  6. Eliminates need to designate "googleType" on all state configs. This information is now derived from Google schema files automatically.
  7. Uses Google's schema files to decide WHICH state values to send back as a result of a QUERY / EXECUTE. With Google introducing more request-response style commands, in order to support that states needed to be differentiated as either actual "device" state (used for QUERY and report state) and command-specific "result" states that are only utilized when generating command responses, and without necessitating making the "command" config architectures more involved.

Breaking Changes / Issues

  1. .NET 5.0 moves away from delegating certificate handling to OpenSSL to a managed solution. As part of this, there is a new rule in how it handles PFX certs that may cause issues. IF YOU GENERATED THE CERT VIA THE SCRIPT IN THE DOCS your signing cert is probably going to be broken (docs have been updated to reflect new recommendation). If you saved the .key and .crt, you can regenerate the PFX with the following command to correct the PFX: openssl pkcs12 -export -out signingKey.pfx -inkey signingKey.key -in signingKey.crt Otherwise you may need to generate a new PFX and relink.
  2. Due to an upstream deprecation, the Serilog logging configuration changes. Change RollingFile configuration to match the File config similar to the default appsettings.json file. Log files will likely not work until you make this change.
  3. The googleType is no longer necessary which should simplify the devices config file. It should load ok with it, and saving any device in the interface should regen the whole file without them automatically, or you can manually remove them.
  4. This is a big change in approach, and I could easily have missed something. If you find issues not covered here (non-working / garbled examples, bad validation / warnings during startup that seem incorrect, non-working commands, etc.), especially with more rarely used trait types, please report them here!
clmcavaney commented 3 years ago

Just wanted to let you know that it all worked perfectly. I re-created the PFX, but found I had to relink anyway - not sure if that is related to the upgrade or not.

Great work Micheal (@i8beef) - thanks.

i8beef commented 3 years ago

Glad to hear it! Definitely let me know if you run into anything. There's still plenty of work to do around the validation now, but this puts me in a much better place for maintenance as I can generate most of the worst parts from Google's schema files now.

ai91 commented 3 years ago

@i8beef the project is great! Thank you for your effort. Inspired by your HomeAutio.Mqtt.GoogleHome, I've also created two similar projects: one for Amazon Alexa, another for Yandex Alisa: https://github.com/ai91/AlexaSmartHome.MQTT.bridge https://github.com/ai91/AlisaSmartHome.MQTT.bridge

more than a half year using all three of them (google, amazon, yandex) on daily basis - work just perfect :-)

i8beef commented 3 years ago

Nice! Glad to see more options for MQTT bridges. The model of using MQTT as a communication backplane and protocol unification avenue has worked really well for me, and I'm glad to see others expanding the offerings!