oklona / Miele-MQTT

A very simple script to read data from Miele@home cloud services, and publish using Mosquitto MQTT
21 stars 10 forks source link

PHP Warning message in Version 3.1a01 #23

Closed skyrop closed 3 years ago

skyrop commented 3 years ago

Hi oklona

By starting the script, Version 3.1a01, I get this PHP warning message. Any Idea? However the script is working an delivers data.

loxberry@loxberry:~/webfrontend/legacy/miele $ php miele-MQTT.php PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

oklona commented 3 years ago
    Ah, this is because you don’t have the new values set in your config file. You need to recreate the config, using the -c parameter, so the script will know the expiry date of your token. If not, it wouldn’t know when to refresh. I might consider creating a new version that will just refresh immediately if token expiry date is unset, haven’t thought about that before. But the “official” answer is that you have to recreate your config 😀

 Fra: skyrop @.>Sendt: søndag, mai 16, 2021 10:24 pmTil: oklona/Miele-MQTTKopi: SubscribedEmne: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)  Hi oklona By starting the script, Version 3.1a01, I get this PHP warning message. Any Idea? However the script is working an delivers data. @.:~/webfrontend/legacy/miele $ php miele-MQTT.php PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

skyrop commented 3 years ago

Hello oklona

Thank you for your feedback. I deleted and created the config file again with the -c parameter, but unfortunately I still get the warning messages as you can see below. I also noticed that a lot of files containing the device information are created in the miele folder. Does that have to be the case?

@.:~/webfrontend/legacy/miele $ php ./miele-MQTT.php -c Username (email) to connect with []: Please type your password: How many days before epiry to refresh token? [5]: Please state country in the form of "no-NO, en-EN, etc."[]: de-CH Please input the client ID assigned to you by Miele API administrators []: Please input the Client Secret assigned to you by Miele []: Type the name of your mosquitto host [localhost]: Type login-name for Mosquitto []: Type the password for your mosquitto user (will be saved in PLAIN text) []: Type the base topic name to use for Mosquitto [/miele/]: PHP Warning: rename(./miele-config2.php,./miele-config2.php.org): No such file or directory in /opt/loxberry/webfrontend/legacy/miele/mie le-MQTT.php on line 261 Warning: rename(./miele-config2.php,./miele-config2.php.org): No such file or directory in /opt/loxberry/webfrontend/legacy/miele/miele-MQ TT.php on line 261 @.:~/webfrontend/legacy/miele $ php ./miele-MQTT.php PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 PHP Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406

@.***D74B56.3F678AE0]

Regards Pascal

Von: oklona @.> Gesendet: Montag, 17. Mai 2021 10:03 An: oklona/Miele-MQTT @.> Cc: Pascal Roth @.>; Author @.> Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

Ah, this is because you don’t have the new values set in your config file. You need to recreate the config, using the -c parameter, so the script will know the expiry date of your token. If not, it wouldn’t know when to refresh. I might consider creating a new version that will just refresh immediately if token expiry date is unset, haven’t thought about that before. But the “official” answer is that you have to recreate your config 😀

Fra: skyrop @.>Sendt<mailto:@.%3eSendt>: søndag, mai 16, 2021 10:24 pmTil: oklona/Miele-MQTTKopi: SubscribedEmne: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23) Hi oklona By starting the script, Version 3.1a01, I get this PHP warning message. Any Idea? However the script is working an delivers data. @.:~/webfrontend/legacy/miele<mailto:@.:~/webfrontend/legacy/miele> $ php miele-MQTT.php PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350 Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-842107263, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMS4E7CADKYWDJ4TAZLTODEUHANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

oklona commented 3 years ago
    Ah, thanks! I save those files in order to debug. I planned to turn them off before publishing, but obviously forgot to… I will update the script tomorrow!

 Fra: skyrop @.***>Sendt: mandag, mai 17, 2021 7:54 pmTil: oklona/Miele-MQTTKopi: oklona; CommentEmne: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23) 

Hello oklona

Thank you for your feedback. I deleted and created the config file again with the -c parameter, but unfortunately I still get the warning messages as you can see below.

I also noticed that a lot of files containing the device information are created in the miele folder. Does that have to be the case?

@.***:~/webfrontend/legacy/miele $ php ./miele-MQTT.php -c

Username (email) to connect with []:

Please type your password:

How many days before epiry to refresh token? [5]:

Please state country in the form of "no-NO, en-EN, etc."[]: de-CH

Please input the client ID assigned to you by Miele API administrators []:

Please input the Client Secret assigned to you by Miele []:

Type the name of your mosquitto host [localhost]:

Type login-name for Mosquitto []:

Type the password for your mosquitto user (will be saved in PLAIN text) []:

Type the base topic name to use for Mosquitto [/miele/]:

PHP Warning: rename(./miele-config2.php,./miele-config2.php.org): No such file or directory in /opt/loxberry/webfrontend/legacy/miele/mie le-MQTT.php on line 261

Warning: rename(./miele-config2.php,./miele-config2.php.org): No such file or directory in /opt/loxberry/webfrontend/legacy/miele/miele-MQ TT.php on line 261

@.***:~/webfrontend/legacy/miele $ php ./miele-MQTT.php

PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405

Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405

PHP Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406

Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406

@.***D74B56.3F678AE0]

Regards

Pascal

Von: oklona @.***>

Gesendet: Montag, 17. Mai 2021 10:03

An: oklona/Miele-MQTT @.***>

Cc: Pascal Roth @.>; Author @.>

Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

Ah, this is because you don’t have the new values set in your config file. You need to recreate the config, using the -c parameter, so the script will know the expiry date of your token. If not, it wouldn’t know when to refresh. I might consider creating a new version that will just refresh immediately if token expiry date is unset, haven’t thought about that before. But the “official” answer is that you have to recreate your config 😀

Fra: skyrop @.>Sendt<mailto:@.%3eSendt>: søndag, mai 16, 2021 10:24 pmTil: oklona/Miele-MQTTKopi: SubscribedEmne: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

Hi oklona

By starting the script, Version 3.1a01, I get this PHP warning message. Any Idea? However the script is working an delivers data.

@.:~/webfrontend/legacy/miele<mailto:@.:~/webfrontend/legacy/miele> $ php miele-MQTT.php

PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

PHP Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

Warning: A non-numeric value encountered in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 350

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-842107263, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMS4E7CADKYWDJ4TAZLTODEUHANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

oklona commented 3 years ago

Hello. I am back at my desk again, and able to look at things. I see a few things happening here: 1) You don't actually need to delete the existing config-file when running with "-c". If you keep the old config file available, you don't have to type in your email, tokens and stuff, since the script will use the values present in your existing config-file while creating a new one :-) However, by deleting the config file (which I never do myself), I noticed I need to check for the existence of an old config file before renaming it :-)

2) That error in line 350 doesn't really make sense as long as you have a new config file created. Does it still show up after you stopped and restarted the script? You do have "timetorefresh" defined in your new miele-config2.php? Please check and confirm

3) The errors in phpMQTT.php are also new to me. They may be a result of some of the data from your devices, but I will need to look into that at some point.

Regards,

Ole

oklona commented 3 years ago

I just uploaded a new version, where I stop logging all HTTP to PHP* files. I would appreciate if you could run "php miele-MQTT.php -D -s" (meaning debug, single run), and send me the output.

skyrop commented 3 years ago

Hello Ole

I can confirm that each time I stop and restart the script, I get the Line 350 error. I have no value set on "timetorefresh"

Regards Pascal

Von: oklona @.> Gesendet: Dienstag, 18. Mai 2021 10:13 An: oklona/Miele-MQTT @.> Cc: Pascal Roth @.>; Author @.> Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

Hello. I am back at my desk again, and able to look at things. I see a few things happening here:

  1. You don't actually need to delete the existing config-file when running with "-c". If you keep the old config file available, you don't have to type in your email, tokens and stuff, since the script will use the values present in your existing config-file while creating a new one :-) However, by deleting the config file (which I never do myself), I noticed I need to check for the existence of an old config file before renaming it :-)
  2. That error in line 350 doesn't really make sense as long as you have a new config file created. Does it still show up after you stopped and restarted the script? You do have "timetorefresh" defined in your new miele-config2.php? Please check and confirm
  3. The errors in phpMQTT.php are also new to me. They may be a result of some of the data from your devices, but I will need to look into that at some point.

Regards,

Ole

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-842957640, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMXB6JJV2I5OKBC7TCTTOIOQLANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

oklona commented 3 years ago

Wow, interesting! If you now run it anew with the -c parameter (without removing existing config), do you then get the timetorefresh parameter in the config file?

skyrop commented 3 years ago

I would like to test the new version, but where can I find the File? I only see Version 3.1a01, where I have the issue ?

regards

Von: oklona @.> Gesendet: Dienstag, 18. Mai 2021 11:49 An: oklona/Miele-MQTT @.> Cc: Pascal Roth @.>; Author @.> Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

I just uploaded a new version, where I stop logging all HTTP to PHP* files. I would appreciate if you could run "php miele-MQTT.php -D -s" (meaning debug, single run), and send me the output.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-843025657, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMVALP3YBTPHCVAOBNDTOIZYVANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

oklona commented 3 years ago

Ah, sorry, I didn't merge it into Master. If you choose "Development" instead of "Master" in the Github main window, you will find the updated code :-)

skyrop commented 3 years ago

Yes, if I run it that way. I have a value in the timetorefresh.

Von: oklona @.> Gesendet: Dienstag, 18. Mai 2021 14:22 An: oklona/Miele-MQTT @.> Cc: Pascal Roth @.>; Author @.> Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

Wow, interesting! If you now run it anew with the -c parameter (without removing existing config), do you then get the timetorefresh parameter in the config file?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-843125058, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMSYMSK2GFE2RR6CC63TOJLYFANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

oklona commented 3 years ago

Interesting! Now I need to test you scenario as well :-) Cool, then at least we have you up and running!

skyrop commented 3 years ago

Hello Ole

With Version 3.1a02, I can confirm no more php files are created. This is the requested debug outbut:

@.***:~/webfrontend/legacy/miele $ php miele-MQTT.php -D -s Checking token for expiry Token expires in 2590882 seconds, timetorefresh is 5 days. Token must be refreshed with 432000 seconds left Authorization: Bearer CH_8479a51fdbdce46f4bdc87c2fd9c4b17 Postdata: Method: GET URL: https://api.mcs3.miele.com/v1/devices/ PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 PHP Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 Appliance type: Washing machine Program Name: Delicates Program status: In use Program type: 1 Program phase: Main wash Start Time: 00:00 Time left: 00:57 Time elapsed: 00:09 Light On: DryingStep: Ventilationstep:

Target Temperature 1: 30 Target Temperature 2: Target Temperature 3: Current Temperature 1: Current Temperature 2: Current Temperature 3: Info available: Failure: Door open: Remote Control Enabled: 1 SmartGrid Enabled: Mobile Start Enabled: Ambient Light Enabled: Light Enabled: SpinningSpeed: 900 PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 597 Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php on line 597 EcoFeedbackEnabled: Array BatteryLevel: Appliance type: Tumble dryer Program Name: Cottons Program status: Off Program type: 3 Program phase: Anti-crease Start Time: 00:00 Time left: 00:00 Time elapsed: 00:51 Light On: DryingStep: Normal Ventilationstep:

Target Temperature 1: Target Temperature 2: Target Temperature 3: Current Temperature 1: Current Temperature 2: Current Temperature 3: Info available: Failure: Door open: Remote Control Enabled: 1 SmartGrid Enabled: Mobile Start Enabled: Ambient Light Enabled: Light Enabled: SpinningSpeed: EcoFeedbackEnabled: BatteryLevel: Appliance type: Dishwasher Program Name: Auto Program status: In use Program type: 0 Program phase: Main wash Start Time: 00:00 Time left: 02:05 Time elapsed: 00:00 Light On: 2 DryingStep: Ventilationstep:

Target Temperature 1: Target Temperature 2: Target Temperature 3: Current Temperature 1: Current Temperature 2: Current Temperature 3: Info available: Failure: Door open: Remote Control Enabled: 1 SmartGrid Enabled: Mobile Start Enabled: 1 Ambient Light Enabled: Light Enabled: 2 SpinningSpeed: EcoFeedbackEnabled: BatteryLevel: Appliance type: Steam combination oven Program Name: Program status: Off Program type: 0 Program phase: Start Time: 00:00 Time left: 00:00 Time elapsed: 00:00 Light On: DryingStep: Ventilationstep:

Target Temperature 1: Target Temperature 2: Target Temperature 3: Current Temperature 1: Current Temperature 2: Current Temperature 3: Info available: Failure: Door open: Remote Control Enabled: 1 SmartGrid Enabled: Mobile Start Enabled: Ambient Light Enabled: 2 Light Enabled: SpinningSpeed: EcoFeedbackEnabled: BatteryLevel:

Von: oklona @.> Gesendet: Dienstag, 18. Mai 2021 11:49 An: oklona/Miele-MQTT @.> Cc: Pascal Roth @.>; Author @.> Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

I just uploaded a new version, where I stop logging all HTTP to PHP* files. I would appreciate if you could run "php miele-MQTT.php -D -s" (meaning debug, single run), and send me the output.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-843025657, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMVALP3YBTPHCVAOBNDTOIZYVANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

oklona commented 3 years ago

Perfect! I just uploaded v 3.1.a03, which fixes everything you have shown me, and I also migrated this to Master. Thanks a lot for helping out!

skyrop commented 3 years ago

Hello Ole Thank you very much for your effort 😊

I can confirm, I have no more 350 line errors from the miele-MQTT.php script. Only the 405 / 406 lines error messages from the phpMQTT.php are left. Any Ideas on that issue ?

@.***:~/webfrontend/legacy/miele $ php miele-MQTT.php PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 PHP Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 PHP Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 PHP Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 Notice: Array to string conversion in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 405 PHP Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406 Warning: strlen() expects parameter 1 to be string, array given in /opt/loxberry/webfrontend/legacy/miele/phpMQTT.php on line 406

Von: oklona @.> Gesendet: Dienstag, 18. Mai 2021 15:32 An: oklona/Miele-MQTT @.> Cc: Pascal Roth @.>; Author @.> Betreff: Re: [oklona/Miele-MQTT] PHP Warning message in Version 3.1a01 (#23)

Perfect! I just uploaded v 3.1.a03, which fixes everything you have shown me, and I also migrated this to Master. Thanks a lot for helping out!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/oklona/Miele-MQTT/issues/23#issuecomment-843174263, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2ZEMV75D3W24AQCYRGUIDTOJT4DANCNFSM447GYYBA.

--

This email was Malware checked by UTM 9. http://www.sophos.com

oklona commented 3 years ago

Thank you! After a few days of ensuring that no more error messages with regards to this have been detected, I will now close this issue.