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

Additional Support for Devices #16

Closed meteo88 closed 3 years ago

meteo88 commented 3 years ago

Hi,

can you please add support to following devices? Here is the output of

php miele-MQTT.php -d

array(4) { ["000175656735"]=> array(2) { ["ident"]=> array(4) { ["type"]=> array(3) { ["key_localized"]=> string(10) "Devicetype" ["value_raw"]=> int(15) ["value_localized"]=> string(10) "Steam Oven" } ["deviceName"]=> string(0) "" ["deviceIdentLabel"]=> array(5) { ["fabNumber"]=> string(12) "000175656735" ["fabIndex"]=> string(2) "00" ["techType"]=> string(6) "DG7240" ["matNumber"]=> string(8) "11106390" ["swids"]=> array(14) { [0]=> string(4) "4978" [1]=> string(5) "20487" [2]=> string(5) "25228" [3]=> string(4) "4974" [4]=> string(5) "25307" [5]=> string(5) "25248" [6]=> string(5) "20506" [7]=> string(5) "25225" [8]=> string(4) "4977" [9]=> string(5) "20441" [10]=> string(5) "25209" [11]=> string(4) "5215" [12]=> string(5) "20366" [13]=> string(5) "20462" } } ["xkmIdentLabel"]=> array(2) { ["techType"]=> string(5) "EK037" ["releaseVersion"]=> string(5) "03.85" } } ["state"]=> array(19) { ["ProgramID"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(10) "Program Id" } ["status"]=> array(3) { ["value_raw"]=> int(1) ["value_localized"]=> string(3) "Off" ["key_localized"]=> string(5) "State" } ["programType"]=> array(3) { ["value_raw"]=> int(1) ["value_localized"]=> string(11) "Own program" ["key_localized"]=> string(12) "Program type" } ["programPhase"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(5) "Phase" } ["remainingTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["startTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["targetTemperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["temperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["signalInfo"]=> bool(false) ["signalFailure"]=> bool(false) ["signalDoor"]=> bool(false) ["remoteEnable"]=> array(3) { ["fullRemoteControl"]=> bool(true) ["smartGrid"]=> bool(false) ["mobileStart"]=> bool(false) } ["light"]=> int(2) ["elapsedTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["spinningSpeed"]=> array(4) { ["unit"]=> string(3) "rpm" ["value_raw"]=> NULL ["value_localized"]=> NULL ["key_localized"]=> string(14) "Spinning Speed" } ["dryingStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(12) "Drying level" } ["ventilationStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(11) "Power Level" } ["plateStep"]=> array(0) { } ["ecoFeedback"]=> NULL } } ["000105315635"]=> array(2) { ["ident"]=> array(4) { ["type"]=> array(3) { ["key_localized"]=> string(10) "Devicetype" ["value_raw"]=> int(7) ["value_localized"]=> string(10) "Dishwasher" } ["deviceName"]=> string(0) "" ["deviceIdentLabel"]=> array(5) { ["fabNumber"]=> string(12) "000105315635" ["fabIndex"]=> string(2) "65" ["techType"]=> string(5) "G7365" ["matNumber"]=> string(8) "11071040" ["swids"]=> array(11) { [0]=> string(4) "5221" [1]=> string(5) "20492" [2]=> string(5) "25166" [3]=> string(5) "25293" [4]=> string(5) "25337" [5]=> string(4) "4875" [6]=> string(5) "20366" [7]=> string(5) "20462" [8]=> string(4) "4928" [9]=> string(5) "20475" [10]=> string(5) "25266" } } ["xkmIdentLabel"]=> array(2) { ["techType"]=> string(5) "EK037" ["releaseVersion"]=> string(5) "03.65" } } ["state"]=> array(19) { ["ProgramID"]=> array(3) { ["value_raw"]=> int(1) ["value_localized"]=> string(11) "Pots & Pans" ["key_localized"]=> string(10) "Program Id" } ["status"]=> array(3) { ["value_raw"]=> int(1) ["value_localized"]=> string(3) "Off" ["key_localized"]=> string(5) "State" } ["programType"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(14) "Operation mode" ["key_localized"]=> string(12) "Program type" } ["programPhase"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(5) "Phase" } ["remainingTime"]=> array(2) { [0]=> int(2) [1]=> int(59) } ["startTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["targetTemperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["temperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["signalInfo"]=> bool(false) ["signalFailure"]=> bool(false) ["signalDoor"]=> bool(false) ["remoteEnable"]=> array(3) { ["fullRemoteControl"]=> bool(true) ["smartGrid"]=> bool(false) ["mobileStart"]=> bool(true) } ["light"]=> int(0) ["elapsedTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["spinningSpeed"]=> array(4) { ["unit"]=> string(3) "rpm" ["value_raw"]=> NULL ["value_localized"]=> NULL ["key_localized"]=> string(14) "Spinning Speed" } ["dryingStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(12) "Drying level" } ["ventilationStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(11) "Power Level" } ["plateStep"]=> array(0) { } ["ecoFeedback"]=> NULL } } ["007117505336"]=> array(2) { ["ident"]=> array(4) { ["type"]=> array(3) { ["key_localized"]=> string(10) "Devicetype" ["value_raw"]=> int(21) ["value_localized"]=> string(14) "Fridge-freezer" } ["deviceName"]=> string(0) "" ["deviceIdentLabel"]=> array(5) { ["fabNumber"]=> string(12) "007117505336" ["fabIndex"]=> string(2) "37" ["techType"]=> string(12) "KFN 37682 iD" ["matNumber"]=> string(8) "09360070" ["swids"]=> array(2) { [0]=> string(4) "3600" [1]=> string(1) "0" } } ["xkmIdentLabel"]=> array(2) { ["techType"]=> string(6) "EK044W" ["releaseVersion"]=> string(5) "02.72" } } ["state"]=> array(19) { ["ProgramID"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(10) "Program Id" } ["status"]=> array(3) { ["value_raw"]=> int(5) ["value_localized"]=> string(6) "In use" ["key_localized"]=> string(5) "State" } ["programType"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(14) "Operation mode" ["key_localized"]=> string(12) "Program type" } ["programPhase"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(5) "Phase" } ["remainingTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["startTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["targetTemperature"]=> array(2) { [0]=> array(3) { ["value_raw"]=> int(700) ["value_localized"]=> float(7) ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-1800) ["value_localized"]=> float(-18) ["unit"]=> string(7) "Celsius" } } ["temperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(700) ["value_localized"]=> float(7) ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-1800) ["value_localized"]=> float(-18) ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["signalInfo"]=> bool(false) ["signalFailure"]=> bool(false) ["signalDoor"]=> bool(false) ["remoteEnable"]=> array(3) { ["fullRemoteControl"]=> bool(true) ["smartGrid"]=> bool(false) ["mobileStart"]=> bool(false) } ["light"]=> int(0) ["elapsedTime"]=> array(0) { } ["spinningSpeed"]=> array(4) { ["unit"]=> string(3) "rpm" ["value_raw"]=> NULL ["value_localized"]=> NULL ["key_localized"]=> string(14) "Spinning Speed" } ["dryingStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(12) "Drying level" } ["ventilationStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(11) "Power Level" } ["plateStep"]=> array(0) { } ["ecoFeedback"]=> NULL } } ["000138122848"]=> array(2) { ["ident"]=> array(4) { ["type"]=> array(3) { ["key_localized"]=> string(10) "Devicetype" ["value_raw"]=> int(12) ["value_localized"]=> string(4) "Oven" } ["deviceName"]=> string(0) "" ["deviceIdentLabel"]=> array(5) { ["fabNumber"]=> string(12) "000138122848" ["fabIndex"]=> string(2) "00" ["techType"]=> string(7) "H7264BP" ["matNumber"]=> string(8) "11104260" ["swids"]=> array(12) { [0]=> string(4) "4778" [1]=> string(5) "20487" [2]=> string(5) "25228" [3]=> string(4) "4898" [4]=> string(5) "25300" [5]=> string(5) "25307" [6]=> string(5) "25247" [7]=> string(5) "20417" [8]=> string(5) "25224" [9]=> string(4) "4875" [10]=> string(5) "20366" [11]=> string(5) "20462" } } ["xkmIdentLabel"]=> array(2) { ["techType"]=> string(5) "EK037" ["releaseVersion"]=> string(5) "03.85" } } ["state"]=> array(19) { ["ProgramID"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(10) "Program Id" } ["status"]=> array(3) { ["value_raw"]=> int(1) ["value_localized"]=> string(3) "Off" ["key_localized"]=> string(5) "State" } ["programType"]=> array(3) { ["value_raw"]=> int(1) ["value_localized"]=> string(11) "Own program" ["key_localized"]=> string(12) "Program type" } ["programPhase"]=> array(3) { ["value_raw"]=> int(0) ["value_localized"]=> string(0) "" ["key_localized"]=> string(5) "Phase" } ["remainingTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["startTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["targetTemperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["temperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } } ["signalInfo"]=> bool(false) ["signalFailure"]=> bool(false) ["signalDoor"]=> bool(false) ["remoteEnable"]=> array(3) { ["fullRemoteControl"]=> bool(true) ["smartGrid"]=> bool(false) ["mobileStart"]=> bool(false) } ["light"]=> int(0) ["elapsedTime"]=> array(2) { [0]=> int(0) [1]=> int(0) } ["spinningSpeed"]=> array(4) { ["unit"]=> string(3) "rpm" ["value_raw"]=> NULL ["value_localized"]=> NULL ["key_localized"]=> string(14) "Spinning Speed" } ["dryingStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(12) "Drying level" } ["ventilationStep"]=> array(3) { ["value_raw"]=> NULL ["value_localized"]=> string(0) "" ["key_localized"]=> string(11) "Power Level" } ["plateStep"]=> array(0) { } ["ecoFeedback"]=> NULL } } }

Thank you!!

oklona commented 3 years ago

Thanks! I will try to add this today :-)

oklona commented 3 years ago

Hmm... Funny! With your four devices, I notice that the different devices all ouptut the same parameters. Quite funny that rotating speed is reported for a freezer :-D (Obviously it was set to 0 rpm). I am seriously considering just blindly returning all the data, instead of distinguishing between different device types. This would allow for the end user to specify which data is relevant for his/her devices.

meteo88 commented 3 years ago

Hi,

thank you so much!!

Dominik

oklona commented 3 years ago

Hello, Dominik. All added now, please test, and report back :-)

meteo88 commented 3 years ago

Hi, i tested it a bit and it is working great. I just wanted to aks why there are 2 Target Temperatures for the fridge, but not the actual temperature?

In the Miele@Home App i can see both acutal and target temperatures, is it possible to get all Temperature variables?

Thanks

meteo88 commented 3 years ago

Another question from my side: Is it possible to show the Power disk status and the rinse status for the dishwasher, because in the app i can see those aswell!

Best regards

meteo88 commented 3 years ago

Ok, i think i see it. There are crazy values for the actual Temperatures in the output from above:

["temperature"]=> array(3) { [0]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [1]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } [2]=> array(3) { ["value_raw"]=> int(-32768) ["value_localized"]=> NULL ["unit"]=> string(7) "Celsius" } }

meteo88 commented 3 years ago

Ok, i found it out. In the php you had:

$currentTemperature1 = $appliance['state']['Temperature'][0]['value_localized']; $currentTemperature2 = $appliance['state']['Temperature'][1]['value_localized'];

but it should be:

$currentTemperature1 = $appliance['state']['temperature'][0]['value_localized']; $currentTemperature2 = $appliance['state']['temperature'][1]['value_localized'];

now it is working!

Best regards

oklona commented 3 years ago

Thanks! I will update the code accordingly.

With regards to the Power disk status and rinse status, I cannpt see any values that would amount to that? Here are the values you sent me for the dishwasher, after adding some line feeds and such: ["000105315635"]=> array(2)
{      ["ident"]=> array(4)      {          ["type"]=> array(3)          {              ["key_localized"]=>             string(10) "Devicetype"              ["value_raw"]=> int(7)              ["value_localized"]=>             string(10) "Dishwasher"          }          ["deviceName"]=> string(0) ""          ["deviceIdentLabel"]=> array(5)          {              ["fabNumber"]=> string(12)             "000105315635"              ["fabIndex"]=> string(2) "65"              ["techType"]=> string(5)             "G7365"              ["matNumber"]=> string(8)             "11071040"              ["swids"]=> array(11)              {                  [0]=> string(4) "5221"                  [1]=> string(5) "20492"                  [2]=> string(5) "25166"                  [3]=> string(5) "25293"                  [4]=> string(5) "25337"                  [5]=> string(4) "4875"                 [6]=>string(5) "20366"                  [7]=> string(5) "20462"                  [8]=> string(4) "4928"                  [9]=> string(5) "20475"                  [10]=> string(5) "25266"              }          }          ["xkmIdentLabel"]=> array(2)          {              ["techType"]=> string(5) "EK037"              ["releaseVersion"]=> string(5) "03.65"          }      }      ["state"]=> array(19)      {          ["ProgramID"]=> array(3)          {              ["value_raw"]=> int(1)              ["value_localized"]=> string(11) "Pots & Pans"              ["key_localized"]=> string(10) "Program Id"          }          ["status"]=> array(3)          {              ["value_raw"]=> int(1)              ["value_localized"]=> string(3) "Off"              ["key_localized"]=> string(5) "State"          }          ["programType"]=> array(3)              {              ["value_raw"]=> int(0)              ["value_localized"]=> string(14) "Operation mode"              ["key_localized"]=> string(12) "Program type"          }          ["programPhase"]=> array(3)          {              ["value_raw"]=> int(0)              ["value_localized"]=> string(0) ""              ["key_localized"]=> string(5) "Phase"          }          ["remainingTime"]=> array(2)          {              [0]=> int(2)              [1]=> int(59)          }          ["startTime"]=> array(2)          {              [0]=> int(0)              [1]=> int(0)          }          ["targetTemperature"]=> array(3)          {              [0]=> array(3)              {                  ["value_raw"]=> int(-32768)                  ["value_localized"]=> NULL                  ["unit"]=> string(7) "Celsius"              }              [1]=> array(3)              {                  ["value_raw"]=> int(-32768)                  ["value_localized"]=> NULL                  ["unit"]=> string(7) "Celsius"              }              [2]=> array(3)              {                  ["value_raw"]=> int(-32768)                  ["value_localized"]=> NULL                  ["unit"]=> string(7) "Celsius"              }          }          ["temperature"]=> array(3)          {              [0]=> array(3)              {                  ["value_raw"]=> int(-32768)                  ["value_localized"]=> NULL                  ["unit"]=> string(7) "Celsius"              }              [1]=> array(3)              {                  ["value_raw"]=> int(-32768)                  ["value_localized"]=> NULL                  ["unit"]=> string(7) "Celsius"              }              [2]=> array(3)              {                  ["value_raw"]=> int(-32768)                  ["value_localized"]=> NULL                  ["unit"]=> string(7) "Celsius"              }          }          ["signalInfo"]=> bool(false)          ["signalFailure"]=> bool(false)          ["signalDoor"]=> bool(false)          ["remoteEnable"]=> array(3)          {              ["fullRemoteControl"]=> bool(true)              ["smartGrid"]=> bool(false)              ["mobileStart"]=> bool(true)          }          ["light"]=> int(0)          ["elapsedTime"]=> array(2)          {              [0]=> int(0)              [1]=> int(0)          }          ["spinningSpeed"]=> array(4)          {              ["unit"]=> string(3) "rpm"              ["value_raw"]=> NULL              ["value_localized"]=> NULL              ["key_localized"]=> string(14) "Spinning Speed"          }          ["dryingStep"]=> array(3)          {              ["value_raw"]=> NULL              ["value_localized"]=> string(0) ""              ["key_localized"]=> string(12) "Drying level"          }          ["ventilationStep"]=> array(3)          {              ["value_raw"]=> NULL              ["value_localized"]=> string(0) ""              ["key_localized"]=> string(11) "Power Level"          }          ["plateStep"]=> array(0)          {          }          ["ecoFeedback"]=> NULL      } }

Best regards,

Ole

CaptainBernde commented 3 years ago

Hi Ole,

Would it be possible to add the "Combi Steam Oven" as well? Thank you in advance.

Best regards

Bernd

oklona commented 3 years ago

Hi. Of course we can add the Combi Steam Oven :-) In order to do that, I need the output from running the script with the "-d" parameter, so I can see what properties and values are reported for the oven.

Regards,

Ole

CaptainBernde commented 3 years ago

Hi Ole,

Thank you so much for your help and all the time that you are spending on these things!

Please find attached the file with the log.

miele-MQTT log.txt

Best regards

Bernd

oklona commented 3 years ago

Hello! I have now added this. Could you please download the "development" branch of the script, and verify whether it works?

It seems Miele have standardized values for all kinds of devices, so I am seriously considering making this script more universal, by not querying for specific device types. This means that interpreting the data may need some conversions to be readable, but I believe it will be just like today, except all devices will work :-)

oklona commented 3 years ago

I have now updated the script, and return data regardless of the name of the device. Please test the "Development" branch to verify. After Easter, I expect to merge Development to Master.