molobrakos / tellsticknet

Interface to a Tellstick Net device on the local network
MIT License
32 stars 15 forks source link

Create integration to https://github.com/home-assistant/home-assistant #7

Closed fredrike closed 6 years ago

fredrike commented 7 years ago

It would be great to use this library together with the interface of home-assistant.

There already exist a telldus-live plugin, but that suffers for the issues with telldus live and by using the tellstick-net directly with a local interface the live issues can be eliminated.

Here are some documentation on how to integrate plugins to home-assistant https://home-assistant.io/developers/add_new_platform/

molobrakos commented 7 years ago

I agree! (actually I wrote the current Telldus Live component in Home Assistant). I just haven't had time to integrate this into Home Assistant. :-( I am aware of the shortcomings of the current polling based implementation.

Also, Telldus seem to have published Python-versions of the various protocol decocoders here: https://github.com/telldus/tellstick-server/tree/master/rf433/src/rf433, they probably should be used instead of https://github.com/molobrakos/tellsticknet/tree/master/tellsticknet/protocols

Would you like to contribute, then we could discuss in some other channel?

fredrike commented 7 years ago

I've created a chatroom in gitter for future discussions: https://gitter.im/tellsticknet/

molobrakos commented 6 years ago

Main issues for integrating into HA.

  1. Integrate protocol definitions from https://github.com/telldus/tellstick-server/tree/master/rf433/src/rf433 Let's just keep the current protocol definitions. Accept new protocols later as PRs if needed by anyone.
  2. Decide / find out how to map local sensor id to server id, we probably need to add a mapping section to configuration.yaml that needs to be edited manually. (This can actually be optional. It would be possible for the implementation to decided the mapping itself by comparing sensor values for most sensors - at least in case there is only one sensor with same value reported by the server. Logic: 1) receive sensor reading over udp 2) check already known mappings, including user provided, if found call the update callback 3) check if there exists exactly one sensor reported by the server with same values (all values/scales), if so add to known mapping and call the update callback 4) log unknown sensor reading).
  3. Decide / find out how to map a device on LAN to a device from the API (cloud or local). From the API we only get clientId and name, no IP/MAC. We probably need a mapping section in configuration.yamlfor this as well. The constructor (in tellduslive) could accept (in additon to the device mapping) a value listen_local_udp_broadcast (default False), if set to True, use autodiscover, if set to host name / ip, just use it. Also default True if local API is enabled (then we know we are on the same network).
molobrakos commented 6 years ago

Moving issue here: https://github.com/molobrakos/tellduslive/issues/8