jaybz / TP-HomeAssistant

Home Assistant plugin for Touch Portal
MIT License
23 stars 1 forks source link

TP-HomeAssistant

This is a Home Assistant plugin for Touch Portal. I wrote this plugin as I initially had Tuya devices (via OpenAPI) but am now gradually migrating to a different platform as I've had issues dealing with Tuya's API. Due to the complexity of setting up and getting the necessary keys for Tuya's OpenAPI, I won't be releasing that plugin. Instead, you can set up Home Assistant and configure its Tuya integration or use IFTTT to control your Tuya devices.

Important Note

If you are upgrading from 0.9.4 or earlier to 0.9.5 or later, you may run into issues after the upgrade. If you do, first try deleting the plugin, importing the plugin again, then restart Touch Portal. That should fix any upgrade related issues. Your plugin settings should also be retained.

Platform support

Preliminary Mac OS support

Before proceeding, please take note that I do not have ready access to a Mac. I have managed to get it running successfully from a single Mac OS device (Intel-based) and have started to include Mac OS packages for each release. I will try to resolve any Mac OS specific issues whenever possible, but I cannot guarantee that I will be able to address them properly. This version is also not as thoroughly tested as the Windows version and definitely has not been tested on M1 or M2 devices.

Requirements for Mac OS

You need to have the .Net Core 3.1 runtime installed which you can download from this page. Make sure you download the macOS x64 installer for the latest ASP.NET Core Runtime version which is 3.1.32 at the time this README was last updated. It may be possible to run the plugin using a newer .Net version, however, I have not tested this and I cannot provide support for that at this time.

There is a way to run the plugin without the .Net Core 3.1 runtime but this requires the use of a console command that not all users will be familiar with. I can provide instructions for this upon request. I am also currently exploring how I can set things up such that neither the .Net core 3.1 runtime nor the console command will be required, however, I do not know when or if I will be able to do so.

Mac OS Installation

If you have the necessary requirement(s) above, just download and import TP-HomeAssistant-osx-x64-<version>.tpp from the releases page.

Device Support

Most types of devices supported by Home Assistant should be supported by this plugin. That said, I do not have all the different device types available for testing at the moment. Also, support for most attributes, states, and services are very basic at the moment.

Robot Vacuums

This plugin can support various robot vacuums and other devices within the vacuum domain. Unfortunately, support for the vacuum domain on Home Assistant's REST API might not be present. I do not currently have one of these robot vacuums to be able to check.

Configuration

There are two things you need to enter into Touch Portal's plugin settings for Home Assistant:

You can find the appropriate location to place these by going to Touch Portal -> Settings -> Plugins. Then select the Home Assistant Plugin from the drop down list.

State sorting

As of version 0.9.8, states are now sorted using the corresponding entity's name. States for the individual attributes are also sorted except for the Entity ID, Domain, and State, which always comes first for a given entity. This sorting is done by changing the order at which the plugin sends the state creation command to Touch Portal.

Available actions

On Hold actions

The following actions also support On Hold functionality:

Note: If you set a button up to have both On Press and On Hold actions, those actions will run in this order: On Hold button action, released action, regular On Press action(s).

Known issues

Credits

Contributing

If you wish to contribute, simply fork this repository and submit your changes via pull request targeting the develop branch or a feature branch. Please do not target the release branch in your pull requests.

TouchPortalAPI

I'm currently using my own fork of TouchPortalAPI to allow adding support for API features to this plugin that have not yet been merged back into upstream. Any changes applied to my fork will eventually make it back to the upstream as a pull request and I will not be building any releases of the fork other than as part of my own projects. I will only be entertaining issues and pull requests posted at my fork's Github if they involve any plugin(s) that I am using the fork with, including this one. I make no guarantees, however, that changes made to the upstream repo will make it to my fork.