A Custom Card that provides Browser Setting Sync for Home Assistant Users.
Home Assistant version 0.110.0 or higher is required as of release 1.0.0 of settings-sync
Settings Sync is available in HACS (Home Assistant Community Store).
- Install HACS if you don't have it already
- Open HACS in Home Assistant
- Go to "Frontend" section
- Click 3 dots on top right and custom repository
- Add
https://github.com/ajagnanan/lovelace-settings-sync
with catagoryLovelace
- Search for "Settings Sync" and install
- Download
settings-sync.js
file from thelatest release
. - Put
settings-sync.js
file into yourconfig/www
folder. - Add reference to
settings-sync.js
in Dashboard. There's two way to do that:-
Using UI: Settings → Dashboards → More Options icon → Resources → Add Resource → Set Url as
/local/settings-sync.js
→ Set Resource type asJavaScript Module
. Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile -
Using YAML: Add following code to
lovelace
section.resources: - url: /local/settings-sync.js type: module
-
Name | Type | Requirement | Description |
---|---|---|---|
type | string | Required | custom:settings-sync |
enabled | boolean | Required | Enable card |
sensor | sensor | Required | The Sensor that holds the User Settings JSON retrieved by the REST API |
render_ui | boolean | Required | If the UI should be rendered |
username | string | Optional | Optional Username or default is the Logged In User (this matches up with the JSON) |
This card requires a REST endpoint which will serve the Settings JSON. A REST Sensor will be needed that will then retrieve these settings into Home Assistant. An example of the rest sensor and settings.json are provided. The Key
is the Name
(all lowercase) of the User for whom the Setting is for.
The REST Sensor is needed because Attributes allow a String lenght greater than 255, which is the limit of the State value.
CloudFlare Workers offer a way to host the REST endpoint. See cf_worker.js for a basic example of the worker code. This can be hosted anywhere though, whether on a Cloud or Local service.
type: custom:settings-sync
enabled: true
sensor: sensor.settings_sync
render_ui: true
username: admin