An open API service indexing awesome lists of open source software.

https://github.com/hacksore/react-ha-iframe

Running react in a Home Assistant lovelace card
https://github.com/hacksore/react-ha-iframe

docker home-assistant lovelace-card lovelace-ui react

Last synced: 3 months ago
JSON representation

Running react in a Home Assistant lovelace card

Awesome Lists containing this project

README

          

# react-ha-iframe
Test using react in a lovelace iframe powered by [home-assistant-js-websocket](https://github.com/home-assistant/home-assistant-js-websocket) for the data connection.

## Demo
Pass a long lived `apiToken` query string param and `host` if your host differs than the default.

Example card

![example](https://i.imgur.com/gMm7f5S.png)

Start the docker container to expose port 3000 then configure the webpage card.

```
docker run -p 3000:80 hacksore/react-ha-iframe
```

Configure the card

![Imgur](https://i.imgur.com/0LlobYF.png)

### Final thoughts
This is probably not practical to spawn a new socket connection for every card. Maybe you could use message posting to try and only use one socket.

This is just a POC so take what you want from this 😎