La Marzocco GS/3 & Linea Mini support

I got that straight from the raw APK from the store and I think there was only one instance of the id/secret, but I’ll check again.

Are you using the Android or iOS app? Which version?

Edit: I confirmed that client_id and client_secret only exist in one file (main.js) and only where those constants are defined and where the Javascript constructs the token request:

function e(e,t){this.http=e,this.loadingService=t,this.oauthV2Token="oauth/v2/token"}return e.prototype.getClientParams=function(){return{client_id:i.a.API.CLIENT_ID,client_secret:i.a.API.CLIENT_SECRET}}

This APK has no idea what machine I’m using, and I use the iOS version anyway :slight_smile:.

I was trying to figure out how to download an older version to see if the values were different, but it’s not in any of the mirror sites.

I know that it’s annoying, but could you try that secret and see if it works for you?

@mrvautin It would make the integration much easier to use if we can settle on a single client_id/client_secret that I can embed in the integration. Would you mind trying this out to see if it works for you?

CLIENT_ID: 4_2d2impykbv0g44oc88kogw000s8wgwwgws80ccowkcg0wk8o8w
CLIENT_SECRET: 1m52x65srmysk4owk0ww4ok84sw484ww0gsoo0kc0gs4gcwkko

Is anyone who’s currently not using that ID/secret willing to try it?

afraid that is the id/secret I’m using already

perhaps you can have these as defaults but allow them to be overridden in config?

Yes, that’s a thought, and would require only small changes. It would be great to get some positive confirmation that multiple secrets work, though.

Edit: I added the client_id and client_secret from above in the README in the repo, so at least it’s somewhere for a new user to start.

1 Like

sorry this is a pretty basic question, but how do I check what version of the integration I have installed and does it auto update? :smiley:

(either via the HACS install or the manual install)

If it’s manual, maybe it’s worth mentioning on the readme?

Also I notice if I go to ‘configurations’ I see my Linea Mini has been discovered (by IP), even though it already exists below (by name)

by the way, everything has been working great for months (so thanks yet again!), other than the same issue I reported before that it often is reported as being switched on when it is actually off. This is hours after it turned off, i.e. the next morning, so I don’t think it’s related to the poll rate.

I may be on an old version though.

You can see the installed version number by using the 3-dot menu and selecting “Information” (latest is 0.7.5). I just noticed that 0.7.5 was still marked as a pre-release, so I just upgraded it to a real release. I do wish that it was listed on the main card in HACS.

HACS doesn’t support auto-updating on purpose, as everyone should read the release notes and update when ready. The integration should ignore future discoveries if it’s already configured, but it’s possible that the unique_id that I use wasn’t configured properly if you’re using an old version. I highly recommend upgrading to 0.7.5 to take advantage of improved connection reliability (it’s rock solid for me), and you may need to uninstall/reinstall depending on how old your version is.

Do note that if you’re upgrading from an older version (months ago now), that the entities may have changed. For instance, the boiler temps were moved from sensor.* to water_heater.* to accommodate changing the values and adapting to existing Lovelace cards. Just look at the entities provided by the integration to see the current list.

I use the app and cards almost exclusively to control the machine config because it’s so much easier and faster, and the only issues that I’ve seen are when the machine itself stops accepting network connections. In those rare cases, even the official app can’t connect and I have to power-cycle the machine. It doesn’t happen very often, and recovers after a power cycle.

BTW, could you see if there’s anything obvious in your logs when you see the mismatched state? I have my GS/3 front panel display, including the clock, displayed on my Lovelace dashboard to ensure that the integration is still running and receiving data, but I don’t know what that would show for LM users. I generally report connection errors as errors in the log, so please share a snippet if you see something weird.

1 Like

I was on 0.7 and have updated to 0.7.5 - will keep an eye on it and report back

1 Like

Lots of stuff was added between 0.7 and 0.7.5, including model differentiation, support for the Lovelace card, tests, and connection reliability, so hopefully it works better for you. If not, please do speak up.

1 Like

Wow. I’m new to HA and I just added this integrations. I have a LM and the client id and secret worked perfectly.
Thanks for the great effort @rccoleman

Quick question, What happens if the IP address changes from the DHCP?

/edit Just noted that the temperature setting adjustment does not seem to respond. When I press down or up the number disappears and no adjustment is made

I would recommend making a DHCP reservation for your devices that you need to connect to, or really, all your devices. If the IP address for your machine changes, you’d need to remove the integration and add it again.

Regarding the temperature change issue, I assume you’re talking about the “more info” dialog for the water_heater entity? I see that too, and it’s puzzling. The water_heater.set_temperature service works fine for me, as does this card, which I use all the time. It looks like it’s doing exactly the same thing that the built-in more-info dialog is doing (calling the same water_heater.set_temperature service), so I don’t know what’s going on. I’ll admit that I never change the boiler temp this way, so I didn’t notice it was broken. Thanks for reporting!

Edit: Found it, fixed it, and made an v0.7.6 release. You should see the update in HACS, so install it and restart HA.

The problem turned out to be that I didn’t have min_temp and max_temp attributes in the water_heater entities and the Frontend code checks against them when changing the value. If they don’t exist, it freaks out, does nothing, and you end up with the blank temp display. Adding them immediately fixed it.

I left the step at the default of 1 degree because using a fractional value leads to annoying display issues that I cannot fix. You would periodically end up with something like 205.999999999999, and then it would eventually fix itself when the updated data is read. 1 degree is probably fine for most folks.

Updated.

Temp setting now works but unlike what you mentioned the changes are 0.5 degrees which is perfectly fine

Excellent, glad to hear that it works. The 0.5 degree step may be an override for C vs. F, if you’re using Celsius. It’s coming from the base water_heater controls code in the Frontend and may take localization into account at some point.

I installed HA just so I could try your LM integration. Thanks! It works great. and I can confirm like others that the shared client_id and client_secret you lifted from the app’s main.js work just fine. (I have a LMLM.)

Unfortunately, HA doesn’t support my projector or the GC100 I use to talk to it, so… I may have to fix that and contrinute to HA, or try to use lmdirect in openHAB.

Edit: Looks like lmdirect requires Python3.8 because of the := operator?

Glad it’s working for you. Yes, I decided to go full walrus since I was primarily targeting HA and it’s already onto 3.9 :slight_smile:. I think that’s it, though. Just a convenience.

Just setup home assistant on a Raspberry Pi I had just for this, worked great.
I also have my Linea Mini on a separate vlan, works great and HomeKit integration is awesome.
Would be really good somehow to know when the heat sensor reaches the desired temp, not sure if this is possible in HomeKit though

You could easily write an automation in Home Assistant for that - have it send a notification to your phone, have Alexa speak something (I do this when my hot water sensor reaches temp after turning on my recirc pump), turn on a siren :). You could adapt something like this to monitor and respond to the boiler temp:

- id: water_is_hot
  alias: Water is Hot
  initial_state: true
  trigger:
    - platform: state
      entity_id: sensor.mbath_water_temp
  condition:
    - condition: numeric_state
      entity_id: sensor.mbath_water_temp
      above: input_number.max_water_temp
    - condition: state
      entity_id: input_boolean.water_hot
      state: "off"
  action:
    - entity_id: input_boolean.water_hot
      service: homeassistant.turn_on
    - data:
        message: Water hot
        target:
          [
            "media_player.lr_echo",
            "media_player.mbath_dot",
            "media_player.kit_dot",
          ]
        data:
          type: tts
      service: notify.alexa_media

I have a corresponding “water is cold” automation that resets input_boolean.water_hot when the temp drops below a certain value (i.e., when the the pump/machine is turned off).

- id: water_is_cold
  alias: Water is Cold
  initial_state: true
  trigger:
    - platform: template
      value_template: "{{ states('sensor.mbath_water_temp')|float < (states('input_number.max_water_temp')|float - 3.0) }}"
      for:
        seconds: 30
  condition:
    - condition: state
      entity_id: input_boolean.water_hot
      state: "on"
  action:
    - entity_id: input_boolean.water_hot
      service: homeassistant.turn_off
1 Like

I want to bring this issue to your attention, since you’ll start seeing regular errors in the log with this integration once you upgrade to HA 2021.8. As I mentioned there, the latest httpx package was updated with a change that breaks the latest authlib release, and that causes communication with the La Marzocco gateway to fail. I suggest a workaround in the github issue that I’ve been using successfully, and I hope that the authlib team will release a new version soon that’s compatible with the latest httpx package. Once they do, it should be picked up automatically when you restart HA.

La Marzocco updated their privacy agreement and that’s preventing the integration from logging into the server account and retrieving the account information. Launch the La Marzocco app to read/accept the agreeement and the integration will be able log in and will work again. I’ll see if I can detect that and display a better error message with what the user needs to do.

I found this by seeing a response to the https://cms.lamarzocco.io/api/customer endpoint with a message like “The privacy policy has changed and needs to be accepted”, but I neglected to save it and I don’t think I can get it back. I know it’s a tall ask, but if anyone can grab the response from Postman or similar to that endpoint before you’ve accepted the new policy, I’m happy to add a better log message for it.

I’ve also added this info to the pinned issue in Github because it has the same error signature in the HA log.