mgcrea / homebridge-tydom

Homebridge plugin to manage Tydom hardware by Delta Dore from Apple HomeKit.
63 stars 14 forks source link

Add support for window shutters #2

Closed 0xRoch closed 4 years ago

0xRoch commented 4 years ago

Window shutter support should be added, they can be controlled by switching position from 0 to 100

{ devices: [ { id: 155839143, endpoints: [Array] } ] } { test: [ { name: 'thermicDefect', validity: 'upToDate', value: false }, { name: 'position', validity: 'upToDate', value: 98 }, { name: 'onFavPos', validity: 'upToDate', value: false }, { name: 'obstacleDefect', validity: 'upToDate', value: false }, { name: 'intrusion', validity: 'upToDate', value: false }, { name: 'battDefect', validity: 'upToDate', value: false } ] }

mgcrea commented 4 years ago

Would need to have the first_usage endpoint field from the config json file to properly auto map them.

You should have something in your homebridge logs like Unsupported usage="XXX" for endpoint with id="YOUR_ID" when running with the env var DEBUG=homebridge-tydom.

Could you check?

Also does the Tydom app supports intermediate positions, like 50% open?

Thanks

0xRoch commented 4 years ago

Yes you can use intermediate pos from 0 to 100, I have tried using tydom-client. There you go, the first usage value is : shutter.

mgcrea commented 4 years ago

I've just release v0.5.1 with 635fd2b that attempts to support shutters. Hard to know if it will work as I can't test/replicate locally. Looking forward to know if it works :)!

0xRoch commented 4 years ago

Thank you so much for the release ! It works well, the only thing we can probably improve is the default status broadcasted when HomeKit reboots is “closing”, after clicking on the shutter it does broadcast the right status.

AE10F9EE-F396-469E-864B-507BC4A797BD B7E503BB-5D63-4C7B-A9FC-A8AF6F722D6F

mgcrea commented 4 years ago

Great news, I have tried something for the missing state in a 0.5.2 release I just pushed.

Underlying issue is probably that in HomeKit there is two states (currentPosition, targetPosition) while on the tydom side I just have a single position variable.

0xRoch commented 4 years ago

Yes it is now fixed ! Thank you !

quizatsaderac commented 4 years ago

Delta dore just updated the Tydom 1.0 box tonight, the plugin no longer works. does anyone also have a malfunction ? IMG_5282

0xRoch commented 4 years ago

Same issue on my end, I hope they didn’t break compatibility on purpose 🧐

quizatsaderac commented 4 years ago

update: the shutters can still be controlled by siri by voice, and in a scene, but not with the touch screen?

mgcrea commented 4 years ago

Do you target your local tydom IP or mediation.tydom.com? Had the same issue after the upgrade today but it quickly went away as last version of the plugin is able to reconnect, maybe you are using an older version? You should make sure you are installing the v0.5.2 version of this plugin and you should try to restart homebridge.

quizatsaderac commented 4 years ago

i target mediation.tydom.com and i using the v0.5.2 version. i restart homebridge ( i run in Hoobs système on raspberry pi) but no result...

mgcrea commented 4 years ago

@quizatsaderac could you try to add DEBUG=homebridge-tydom,tydom-client as an environment vars to enable the plugin debug mode and look at the logs for specific errors?

quizatsaderac commented 4 years ago

I can’t in hoobs system. But in hoobs homepage, all tydom item run correctly ! the problem it’s only on application homekit Maison.I also use application EVE and all run correctly ! ( sorry for my bad english .) 9720FBDE-8F2B-49D4-BBC7-E0AA559B81CF C950E052-8AAA-4EF3-B875-39330667EEE8

mgcrea commented 4 years ago

On peut parler français! A priori la connection au serveur mediation.tydom.com fonctionne bien vu que le plugin arrive a bien lister les devices.

Si tu arrives à bidouiller un peu en javascript tu pourrais essayer d'utiliser https://github.com/mgcrea/node-tydom-client pour essayer d'envoyer des requêtes manuellement sur les devices tydom.

mgcrea commented 4 years ago

@D-Roch Do you still have the non-responding issue or does a homebridge restart fixed it?

0xRoch commented 4 years ago

@mgcrea After reboot I still have the issue on the UI, however voice command works. On my end I use the local IP rather than mediation.tydom.com. I haven't tried changing that yet.

mgcrea commented 4 years ago

@D-Roch strange, tried local IP and I don't have any issues. Had the upgrade prompt but I don't find updated version in the /info endpoint:

  "mainVersionSW": "02.02.53",
  "mainVersionHW": "00.00.01",
  "keyVersionSW": "01.03.03",
  "keyVersionHW": "00.00.01",
  "keyVersionStack": "01.01.03",
  "keyReference": "21260011",
  "bootReference": "P21260012",
  "bootVersion": "01.00.03",

If you have the time, try to run a await client.get('/info'); with node-tydom-client and check if you have the same version numbers.

Also enabling debug mode via env-vars (DEBUG=homebridge-tydom,tydom-client) restarting homebridge and looking at the logs might be your best bet.

mgcrea commented 4 years ago

@D-Roch @quizatsaderac Bon j'ai fini par avoir la mise à jour et j'ai en effet eu le même soucis que vous, rien de bien méchant mais un changement dans leur API, j'ai corrigé cela avec une nouvelle version v0.6.8.

quizatsaderac commented 4 years ago

Super, bravo pour cette mise a jour ! tous fonctionne parfaitement.