Coder Social home page Coder Social logo

Comments (18)

thoukydides avatar thoukydides commented on May 28, 2024

There is not much clue in that small non-debug log snippet as to the root cause.

The Missing details of 15 programs warning means that for some reason the Home Connect API would not allow the program options to be read. There are many reasons why this might be the case, such as a program being in progress, or some other issue preventing any program from being selected (such as full drip tray or out of beans). However, without a full debug log from when the plugin started there is nothing that I can do to diagnose the problem.

I can see where the program.options is no iterable error is likely to have been generated as a result of a problem reading the appliance's programs... and it will be trivial to fix that. However, that is a symptom rather than the cause. Fixing it will not make the options available in the schema for other programs - it will only affect the log output.

Please run Homebridge with the -D option to enable full debug logging, and provide a full log from when the plugin is first started. Please provide the log as a text file (not a screenshot).

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

v0.16.9 should fix the program.options is not iterable error and allow the configuration template to be output to the log file.

However, it will not do anything to address the underlying problem that prevented the program options from being read. For that I still need a full debug log.

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

Thanks for the quick replay. Please find the debug log attached.

DebugLog.txt

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

Thank you for providing the log. This suggests that the Home Connect API did return a response that appeared valid for all 28 programs, but that 15 of them simply do not support any options (at least not via the Home Connect API). Assuming that they should have supported options...

The plugin caches this information rather than reading it from the Home Connect API every time it starts, so it is possible that there was a problem when the plugin was first started, and the bad results have been cached.

I am running out of time to investigate today, but will continue looking at it again as soon as I can.

In the mean time it would be helpful if you could try:

  1. Stop Homebridge.
  2. Delete the cache file. Based on your log this is probably in the /root/.homebridge/homebridge-homeconnect/persist directory on your system. Two files will be named 94a08da1fecbb6e8b46990538c7b50b2 and 130b9cf2dc079eb8116e6fca2c2ec001; ignore those. There should be a third file with a different name; take a copy of this and then delete the original. See Files Storing Plugin State for more details of these files.
  3. Restart Homebridge.

Please provide both the cache file that you copied/deleted and the log for restarting Homebridge (with -D debug again) afterwards.

Do NOT attach the 94a08da1fecbb6e8b46990538c7b50b2 file because that contains the Client ID and OAuth tokens for your account!

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

Okay thanks, that changed something related to the UI Options. Now I have the "amount option" for every program but the others options for "caffe crema" are gone.

Please see the files attached. Unfortunately there was an error while saving the original cache file, therefore I have just attached the new one and the debug log.
b96150f642b42e5ab256f6eb348e11c6.txt
Debug2Log.txt
image

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

Thanks - the cache file has given me some ideas as to what might be going wrong. I need to think about it some more and run a few tests. Probably won't have time until the weekend though.

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

Quick update...

After a few experiments I have ruled out the potential bugs that I thought might have been the cause. I have also been unable to reproduce any behaviour similar to that reported - either with my physical appliances or the appliance simulators.

The contents of the provided cache file suggest that the Home Connect API only returned the single ConsumerProducts.CoffeeMaker.Option.FillQuantity option for each program. However, you previously had additional options for the ConsumerProducts.CoffeeMaker.Program.Beverage.Coffee program... so those must have been returned by the API at some point.

One possibility is that your CoffeeMaker only returns the program options after a program has been selected. The documentation suggests that some appliances behave in this way, but I have not encountered any others so far.

I have a few more things to try, but suspect that I will have to add additional debug to the plugin to work out what is happening with your appliance...

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

Thanks for the update. One thing I have noticed at the first test, is that the number of missing program details were reduced by scrolling through the coffeemaker menu. But that just changed the "detail missing" message in the homebridge console.

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

One thing I have noticed at the first test, is that the number of missing program details were reduced by scrolling through the coffeemaker menu. But that just changed the "detail missing" message in the homebridge console.

That makes sense.

When the plugin first starts it reads:

  • The list of all supported programs
  • The list of currently available programs
  • The supported options for each available program, but without selecting each first. The result is ignored if no options are returned.

The count of missing programs will be those that are not currently available (e.g. coffee drinks if the beans are empty) plus those that did not return any options.

When the plugin receives a notification that a program has been selected (e.g. scrolling through the programs on the appliance) the options are read again. The result is used regardless of whether any options were returned. This therefore reduces the number of missing programs.

If scrolling through the programs makes additional options available (rather than just reducing the missing count in the log) then that is something I can probably improve in the plugin, e.g. by automatically selecting each program in turn the first time that the plugin is started (assuming that the appliance is idle). However, it doesn’t sound like this is the case...

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

Instant of reading the options list directly from the device, can we may provide a self created database for the machines?

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

Instant of reading the options list directly from the device, can we may provide a self created database for the machines?

That is already supported. Just edit the config.json file by hand and specify whatever options you want.

Only three options are currently supported by the public Home Connect API for CoffeeMaker appliances, even if additional options can be set in the official Home Connect app:

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

Actually, looking at your log file again I suspect that the issue is that only options valid for the currently selected program are being returned.

[2/13/2020, 17:28:59] [HomeConnect] [Kaffeemaschine] BSH.Common.Root.SelectedProgram=ConsumerProducts.CoffeeMaker.Program.Beverage.WarmMilk (0 listeners)
[2/13/2020, 17:28:59] [HomeConnect] [Kaffeemaschine] ConsumerProducts.CoffeeMaker.Option.FillQuantity=100 ml (0 listeners)
[2/13/2020, 17:28:59] [HomeConnect] [Kaffeemaschine] ConsumerProducts.CoffeeMaker.Option.MultipleBeverages=false (0 listeners)

When you restarted the plugin after deleting the cache the selected program was ConsumerProducts.CoffeeMaker.Program.Beverage.WarmMilk which probably does only support the single option of ConsumerProducts.CoffeeMaker.Option.FillQuantity. It is entirely plausible that only this option was then returned when querying the other programs without first selecting them.

Quoting from the Home Connect API documentation:

Please note that most of our appliances dynamically update the API over the available options upon selection of the program. Therefore, the simplest and safest implementation would be to first select a program without any option and then query the available options of this program and for example dynamically present them on UI.

You could test this by manually selecting a coffee program (that should have strength and temperature options), stopping Homebridge, deleting the cache file, and then restarting Homebridge.

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

(Note that the ConsumerProducts.CoffeeMaker.Option.MultipleBeverages option is not actually supported by the Home Connect API despite being returned and logged...)

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

You could test this by manually selecting a coffee program (that should have strength and temperature options), stopping Homebridge, deleting the cache file, and then restarting Homebridge.

That worked, now I have the three options. Too bad that all the other options are not available in the public api. Thanks for your great support and your work. :)

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

That worked, now I have the three options.

Thanks for letting me know. In that case it looks like I do need to get the plugin to select each program before reading the options. Yours is the first appliance that I have encountered that actually requires this.

My current idea is:

  • At plugin start keep the existing behaviour of trying to read the programs without first selecting them.
  • When a program is selected (not by this plugin) then read its options, overwriting any previously cached as currently, but also preventing the read at start-up from overwriting them.
  • When Identify is used and the appliance is off or idle, save the current power and selected program, turn the appliance on, check that all supported programs are currently available, select and read each program in turn (again overwriting any previously cached and preventing the read at start-up from overwriting them), and restore the originally selected program and power state.

With most appliances there won’t be any significant change to the normal behaviour. However, with appliances like yours the options can be correctly read using Identify.

Not ideal, but probably a reasonable compromise since the API is not really designed for one-off reading of supported options.

Too bad that all the other options are not available in the public api.

The Home Connect API is being gradually extended, so it is possible that the missing options will be added in the future. Keep an eye on:
https://developer.home-connect.com/changelog

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

Just noticed that some programs have still no options:
image

from homebridge-homeconnect.

Frederick-G764 avatar Frederick-G764 commented on May 28, 2024

After one identify from the home+ app the options are added to the schema.

from homebridge-homeconnect.

thoukydides avatar thoukydides commented on May 28, 2024

This should be handled better in v0.17.0.

The plugin now attempts to select each program before reading the options. At start-up this is only done for programs that have not been read successfully before. When the Identify routine is invoked this is done for all programs.

In both cases:

  • Results are cached and not re-read for a minimum of 24 hours.
  • Only "available" programs are read. This may exclude some programs that cannot currently be selected, e.g. coffee drinks when the beans are empty.
  • No programs are selected unless:
    • There is no active program (i.e. the appliance is either Inactive or Ready).
    • RemoteContolActive is set (if supported by the appliance).
    • The appliance has not been recently controlled locally (LocalControlActive).

from homebridge-homeconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.