From 74a9509b0be9cf85a5835e77fabef2d02ca4af84 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Mon, 26 Feb 2024 06:29:09 +0800 Subject: [PATCH] Checked README.md --- README.md | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 2bb6d20a0..63886e6c8 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,16 @@ ## lovelace adapter for ioBroker -With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI. +With this adapter, you can build visualization for ioBroker with Home Assistant Lovelace UI. [Deutsche Dokumentation](docs/de/README.md) ## Instance objects -In the folder instances there are some objects that can be used to control the UI. For every browser a new subfolder will -be created with a random ID. This ID is stored in the client browser's web storage. If you delete the web storage a new +In the folder instances, there are some objects that can be used to control the UI. For every browser, a new subfolder will +be created with a random ID. This ID is stored in the client browser's web storage. If you delete the web storage, a new instance will be created. If you use Fully Kiosk Browser make sure the function `Delete webstorage on reload` is **disabled**. -This functionality uses browser_mod, which is installed and updated by the adapter. Do not add your own version of browser_mod as custom card. +This functionality uses browser_mod, which is installed and updated by the adapter. Do not add your own version of browser_mod as a custom card. ## Configuration There are two ways how the entities could be configured: @@ -35,7 +35,7 @@ In auto mode the similar process will be applied like for `google home` or `mate You can define friendly names and this will be used in entities. ### Manual -The objects can be defined manually in object tree like sql or histroy. The type of entity must be provided and optionally the name of object. +The objects can be defined manually in an object tree like sql or histroy. The type of entity must be provided and optionally the name of object. With this method only simple entities, like input_number, input_text or input_boolean could be created. It may not have more than one state or attribute. ## Panels @@ -96,8 +96,8 @@ common: { ``` ### Select input -This can be done manually if input_select entity type in custom dialog is selected. -The list of options to select from should be provide in standard commom.states object: +This can be done manually if `input_select` entity type in custom dialog is selected. +The list of options to select from should be provided in a standard `common.states` object: ``` "common": { @@ -115,10 +115,10 @@ The list of options to select from should be provide in standard commom.states o } } ``` -in other words in should also be input select in IoB. +in other words, there should also be select input in IoB. ### Timer -Timer could be simulated by following script: +Timer could be simulated by the following script: ``` createState( @@ -202,11 +202,11 @@ createState( ``` ### Weather -Tested with yr and daswetter. One or more of following objects must have `Function=Weather` and `Room=Any` set to be available in configuration: -- daswetter.0.NextDays.Location_1 -- yr.0.forecast +Tested with `yr` and `daswetter`. One or more of the following objects must have `Function=Weather` and `Room=Any` set to be available in configuration: +- `daswetter.0.NextDays.Location_1` +- `yr.0.forecast` -Tested with AccuWeather driver v1.1.0 https://github.com/iobroker-community-adapters/ioBroker.accuweather. +Tested with `AccuWeather` driver v1.1.0 https://github.com/iobroker-community-adapters/ioBroker.accuweather. Custom Lovelace card created in support of accuweather forecast - https://github.com/algar42/IoB.lovelace.accuweather-card ### Shopping list @@ -235,7 +235,7 @@ createState('location', '39.5681295;2.6432632', false, { }); ``` -or this two objects: +or these two objects: ``` createState('location.longitude', 2.6432632, false, { @@ -257,7 +257,7 @@ createState('location.latitude', 39.5681295, false, { ``` ### Picture entity -You can use static picture for it or use any state that delivers URL as state. +You can use static picture for it or use any state that delivers URL as a state. E.g.: ``` @@ -275,34 +275,34 @@ E.g.: } ``` -or just set manually the entity type to `camera` and write URL into it. +or just manually set the entity type to `camera` and write URL into it. ### Markdown You can use bindings in markdown like in [iobroker.vis](https://github.com/ioBroker/ioBroker.vis#bindings-of-objects). -E.g. Text `Admin adapter is {a:system.adapter.admin.0.alive;a === true || a === 'true' ? ' ' : 'not '} *alive*.` will produce text `Admin adapter is alive` in markdown panel. +E.g., Text `Admin adapter is {a:system.adapter.admin.0.alive;a === true || a === 'true' ? ' ' : 'not '} *alive*.` will produce text `Admin adapter is alive` in a markdown panel. ## Custom cards ### Upload of custom cards -To upload the custom card write following: +To upload the custom card, write the following: ```iobroker file write PATH_TO_FILE\bignumber-card.js /lovelace.0/cards/``` After restart of lovelace adapter it will include all files from the `cards` directory automatically. -Following custom cards could be tested successfully: -- bignumber-card: https://github.com/custom-cards/bignumber-card/blob/master/bignumber-card.js -- simple-thermostat: https://github.com/nervetattoo/simple-thermostat/releases (take the latest release) -- thermostat: https://github.com/ciotlosm/custom-lovelace/tree/master/thermostat-card (both files .js and .lib.js are required) +The following custom cards could be tested successfully: +- `bignumber-card`: https://github.com/custom-cards/bignumber-card/blob/master/bignumber-card.js +- `simple-thermostat`: https://github.com/nervetattoo/simple-thermostat/releases (take the latest release) +- `thermostat`: https://github.com/ciotlosm/custom-lovelace/tree/master/thermostat-card (both files .js and .lib.js are required) I found this link https://github.com/jimz011/homeassistant as an interesting resource for custom cards. -Often the custom cards are stored on github as sources and must be compiled before use. -You should check the `Releases` menu on github and try to find compiled files there. +Often the custom cards are stored on GitHub as sources and must be compiled before use. +You should check the `Releases` menu on GitHub and try to find compiled files there. Like this one: [https://github.com/kalkih/mini-graph-card/releases](https://github.com/kalkih/mini-graph-card/releases) (Look for the file `mini-graph-card-bundle.js`) ## Own images -The custom images (e.g. for background) could be loaded via the same configuration dialog like the custom cards. And use it like this: +The custom images (e.g., for a background) could be loaded via the same configuration dialog like the custom cards. And use it like this: `background: center / cover no-repeat url("/cards/background.jpg") fixed` @@ -310,10 +310,10 @@ or `background: center / cover no-repeat url("/local/custom_ui/background.jpg") fixed` -in lovelace configuration file. Read more about background in lovelace [here](https://www.home-assistant.io/lovelace/views/#background). +in lovelace configuration file. Read more about the background in lovelace [here](https://www.home-assistant.io/lovelace/views/#background). ## Themes -The themes can be defined in configuration dialog of ioBroker. +The themes can be defined in the configuration dialog of ioBroker. Paste something like: ``` midnight: @@ -386,7 +386,7 @@ midnight: taken from [here](https://community.home-assistant.io/t/midnight-theme/28598/2). ## Icons -Use icons in form `mdi:NAME`, like 'mdi:play-network'. Names can be taken from here: https://materialdesignicons.com/ +Use icons in form `mdi:NAME`, like `mdi:play-network`. Names can be taken from here: https://materialdesignicons.com/ ## Notifications You can add notifications via `sendTo` functionality or by writing the state into `lovelace.X.notifications.add`: @@ -419,14 +419,14 @@ on({id: 'lovelace.0.conversation', ack: false, change: 'any'}, obj => { ## Trouble Shooting If you messed up the YAML Code and see a blank page but still have the top menu, you can enable edit mode (if not already enabled) from the menu and then open the menu again to access the "RAW Yaml Editor" in which you see the complete YAML code and can clean it up. -If that does not help, you can open the object lovelace.*.configuration in raw-editor in ioBroker and have a look there. +If that does not help, you can open the object `lovelace.*.configuration` in raw-editor in ioBroker and have a look there. You can also restore that object from a backup. It contains the complete configuration of your visualization. ## Original sources for lovelace Used sources are here https://github.com/GermanBluefox/home-assistant-polymer . ## Todo -Security must be taken from current user and not from default_user +Security must be taken from the current user and not from default_user ## Development ### Version @@ -434,7 +434,7 @@ Used version of home-assistant-frontend@20231208.2 Version of Browser Mod: 2.3.0 ### How to build the new Lovelace version -First of all the actual https://github.com/home-assistant/frontend (dev branch) must be **manually** merged into https://github.com/GermanBluefox/home-assistant-polymer.git (***iob*** branch!). +First of all, the actual https://github.com/home-assistant/frontend (dev branch) must be **manually** merged into https://github.com/GermanBluefox/home-assistant-polymer.git (***iob*** branch!). All changes for ioBroker are marked with comment `// IoB`. For now (20231208.2) following files were modified: @@ -443,14 +443,14 @@ For now (20231208.2) following files were modified: - `src/data/weather.ts` - add support to display weather icon from url. - `src/dialogs/more-info/const.ts` - remove weather state & history - `src/dialogs/more-info/ha-more-info-dialog.ts` - remove entity settings button and tab -- `src/dialogs/more-info/ha-more-info-history.ts` - remove 'show more' link in history +- `src/dialogs/more-info/ha-more-info-history.ts` - remove `show more` link in history - `src/dialogs/more-info/controls/more-info-weather.ts` - add support to display weather icon from url. - `src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts` - disable configuration of voice assistants - `src/entrypoints/core.ts` - modified authentication process - `src/panels/lovelace/cards/hui-weather-forecast-card.ts` - add support to display weather icon from url. - `src/panels/lovelace/entity-rows/hui-weather-entity-row.ts` - add support to display weather icon from url with auth. - `src/panels/lovelace/hui-root.ts` - added notifications and voice control -- `src/util/documentation-url.ts` - for link to iobroker help instead of homeassistant. +- `src/util/documentation-url.ts` - for link to iobroker help instead of home assistant. - `.gitignore` - add `.idea` ignore - `.husky/pre-commit` - remove git commit hooks. - `package.json` - remove husky commit hook @@ -465,12 +465,12 @@ After that checkout modified version in `./build` folder. Then. 6. `gulp build-app` for release or `gulp develop-iob` for the debugging version. To build web after changes you can call `webpack-dev-app` for faster build, but you need to call `build-app` anyway after the version is ready for use. 7. copy all files from `./build/home-assistant-polymer/hass_frontend` into `./hass_frontend` in this repo 8. Run `gulp rename` task multiple times (until no changes happen). -9. Update Version in Readme and also in server.js VERSION constant. +9. Update version in `README.md` and also in `server.js` the `VERSION` constant. ## Changelog ### 4.1.4 (2024-02-10)