Sickboy78 / MMM-Homematic

HomeMatic Module for MagicMirror
GNU General Public License v3.0
12 stars 3 forks source link

Discrepancy in ise_id #16

Closed Lateadapter closed 2 months ago

Lateadapter commented 2 months ago

Hi Sebastian,

meanwhile I'm using the module untouched for many month, even after change to token based XML-API. However, today by chance I found some strange behavior: One of my HmIP Window Sensors was not correctly implemented - just copy/paste error in the config.js of Magic Mirror. So there was a need to redefine the "ise_id". Surprisingly no one of the "ise_id's" used in the config.js was listed after calling of http://x.x.x.x/addons/xmlapi/devicelist.cgi?sid=yyy ... but the module is working! The Id's were selected originally using the old XML-API 1.x

Finally there seems to be always a required difference of "+1" in ise_id.

Sample: XML-API "Fenster Arbeitszimmer ... ise_id="9005" "

`

`

needs to be selected in config.js as id: '9006'

{ id: '9006', name: 'AZ', type: 'window_warn_open', icon: '/modules/MMM-Homematic/icons/open_window.png', iconSize: 'small', warnColor: 'gray', iconPosition: 'left', warnOnly: 'true' },

BTW - selecting the id '9005' in Magig Mirror config.js will result in endless module loading...

So far - I know how to handle the issue, but for someone starting with the module it could become frustrating.

Regards, Steffen

Sickboy78 commented 2 months ago

Hi Steffen,

you forgot to get the ise_id of the datapoint as described in the readme. You took the ise_id of the channel and added 1, which by chance gave you the ise_id of the datapoint. What you actually need to todo is: Get the ise_id of the device from the devicelist, which in your case is 8978. And then get the datapoints via http://x.x.x.x/addons/xmlapi/state.cgi?device_id=8978. There you get ise_id of the desired datapoint, which will be 9006. Hope this helps.

Best regards Sebastian

Lateadapter commented 2 months ago

Hi Sebastian,

many thanks for the quick response. Indeed I was trying in the beginning to follow the readme but it didn't work. So I tried again according the proven way "Wer lesen kann, ist klar im Vorteil!" and again - no success. In the end it goes beyond my software knowledge - there is probably something in the browser setups.

For anyone, who will recognize similar issues, following my findings:

  1. I'm working under Windows 11 and using Opera as standard browser. A xmlapi call from raspberrymatic did open the browser under address http://x.x.x.x/addons/xmlapi/?sid=@oW.....cr5@, where the sid is somehow different coded than listet under "tokenlist.cgi" (there is written <token desc="">IdK......mPg</token>). With http://x.x.x.x/addons/xmlapi/statelist.cgi?sid=@oW.....cr5@ I got the complete list of all states of all components, but never the preselected component with http://x.x.x.x/addons/xmlapi/state.cgi?device_id=8978 resp. http://x.x.x.x/addons/xmlapi/state.cgi?sid=@oW.....cr5@&device_id=8978 as described in xmlapi doc After further trial and errors I found the working command: http://x.x.x.x/addons/xmlapi/state.cgi?device_id=8978&sid=@oW.....cr5@ (device_id and sid in reverse arrangement) Question now: Is it somehow possible to use the token string as originally defined under "tokenlist.cgi" ?
  2. Trying same with Google Chrome .... same result as above
  3. Trying to use Windows cmd and curl commands: curl "http://x.x.x.x/addons/xmlapi/state.cgi?device_id=8978&sid=@oW.....cr5@" --> working curl "http://x.x.x.x/addons/xmlapi/state.cgi?sid=@oW.....cr5@&device_id=8978" --> working curl "http://x.x.x.x/addons/xmlapi/state.cgi?sid=IdK.....mPg&device_id=8978" --> (original token string) working
  4. Trying to use Firefox ..... everything is working as under 3.

Firefox made it! I just don't know, why.

Best regards, Steffen

Sickboy78 commented 2 months ago

Hi Steffen,

I can not reproduce the described behavior. For me it is working with the IdK......mPg sid as well as the @oW.....cr5@ sid in all combinations device_id first, sid second and the other way around, tested in FF, Chrome and IE. Everything works fine. If you have further issues with the XML-API, you could open an issue at https://github.com/homematic-community/XML-API.

Question now: Is it somehow possible to use the token string as originally defined under "tokenlist.cgi" ?

The module uses the token from the config.js defined as ccuXmlApiTokenId.

Best Regards Sebastian

Lateadapter commented 2 months ago

Hi Sebastian,

again, many thanks for the great module and your support effort. Because of your response I also did repeat everything and big surprise (for me) - all combinations are working, as you wrote. I don't know why, but now it seems clear that the problem was sitting in front of the computer! I'm sorry, that I did waste your time - if you agree, I would delete the recent (misleading) comment.

Regards, Steffen

Sickboy78 commented 2 months ago

Hi Steffen, all good, no need to delete. Happy to help. Best Regards Sebastian