The HAGateway integrates HomeAssistant automation controller Devices and Entities to myServer 6.
One great example is this enables HomeAssistant users to leverage myServer's advanced user interface tools (including the new SmartRemote!) with their HomeAssistant system.
This also allows myServer users to leverage HomeAssistants library of drivers that thousands of third party developers have written and support.
An example is we have a Traeger brand smoker grill. This connects via Wifi to Traeger.com. A developer wrote an integration to Traeger.com for HomeAssistant. Now, with the HAGateway driver, the Traeger grill's temperatures, pellet levels, temperature settings can be viewed and managed within myServer's ecosystem.
To install: Select the HAGateway driver in myServer's Software Updater and install. Ensure you clear cache on all myServer browser devices.
If you don't currently have HomeAssistant installed, you can install it directly on a myServer 6 Raspberry Pi. There is a command in the HAGateway's command builder to install HomeAssistant.
The easiest way
to do this is using curl to upload the files to the server.
The basic curl command is
curl http://<<MYSERVER IPADDR>>/api/uploadfile
-F files=@/home/allonis/applications/homeassistnt/config/.storage/core.entity_registry
-F "files=@/home/allonis/applications/homeassistant/config/.storage/core.device_registry"
Obviously change the file paths to those applicable for your system.
Devices are imported from Home Assistant first. The second pass then looks for all entities associated with the device.
The entities for each device are stored in the members field in the devices table. It appears as Entities in Dashboard.
Room names are imported from Home Assistant.
In theory this release will fully support Lighting, Climate, Sensor, and AV devices.
We have tested against, Lutron, Ecobee, Roku, AppleTV, Shield and Denon devices. Seems to work fine.
To see what commands are available please reference the command builder interface.
If you want to ignore an imported device from Home Assistant simply disable the device in the driver. If the device is disabled you cannot send commands to it nor will any server variables be created for it.
Disabled devices do not count as devices in server licensing.
Pay attention to server variable naming conventions. I’ve tried to normalize against a common set we currently use while also maintaining HA entity names.
- Server variables can have periods in them. Spaces are still illegal and will remain so for eternity.
Update your projects with appropriate cache flushing.
- Server commands can now be created from IDs, Names, and aliases. Consider the following lighting device.
Lighting|144~Toggle
Lighting|Main Bath Fixture~Toggle
Main Bath Fixture|Toggle
light.main_bath_fixture|Toggle
Are ALL valid commands that perform the same task.
- Bridging. In the context of the HAGateway two sets of server variables are maintained. One, the traditional Allonis myServer way and the other the Home Assistant way.
See the following images. myServer view vs. Home Assistant view.
Meaning {{climate_6_aux_heat}} and {{climate.main_floor_aux_heat}} will track the same data.
This makes myServer not solely reliant on Home Assistant. But rather give a Home Assistant user freedom to build creative user interfaces and allow us to implement Home Assistant integrations, e.g., Lutron RA3, when time and expertise does not allow us the option of rolling our own.
Old:
Create a Long Term Access Token within HomeAssistant
From HomeAssistant Dashboard:
Click on User (lower left corner in Lovelace default UI for HomeAssistant)
Scroll down to bottom of the panel that opens.
Turn on Advanced Mode (might not be relevant)
Long Lived Access Tokens - Create Token
Name this token: "myServer"
Click OK
Copy the access token text (CtrlA / copy)
Go into myServer 6 Dashboard
go into HomeAssistant Gateway driver
configure
Run the AddHost command
HAGateway|AddHost~Name~IP Address~8123~Token~Equipment
Copy your Access token from Home Assistant to replace "Token"
Enter your HomeAssistant IP address to replace "IP Address"
port 8123 is default
Example:
HAGateway|AddHost~HA~192.168.0.100~8123~xyzhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzNDA4MDAwOWZkYjI0NzFiOTM1NmEyYzcwMDNlZDcyYyIsImlhdCI6MTY3NjQ4MTI2NywiZXhwIjoxOTkxODQxMjY3fQ.jdG3k0n7P-_R9mvCeBdNoxRYF8UlOClXUB7jgAmFX2A~Equipment
Run that command
After the Host has been configured, run the Discovery command: HAGateway|Discover
The HomeAssistant Entities will be added to myServer 6's list of Devices. Hopefully myServer understands your device and it should have imported the devices in myServer's "family" classes. This will make it much easier to "out of the box" control devices.
If HomeAssistant is also using same Z-Wave radio:
If the Z-Wave radio is installed on the myServer 6 Pi:
Click on Settings on bottom left
Devices and Services
bottom right - Add Integration
Search for ZWave
select Z-Wave (not Z-Wave.me)
Add Z-Wave
Deselect Supervisor Add-on (this will install the Server that is not necessary...we only need the "client")
Type in ws://192.168.1.218:3000 (the address of myServer 6 Pi that has the Z-Wave Hat installed)
Submit
You should see "Success!" and you can then click Finish