The idea of this project is to have a wall mounted tablet running a dashboard to control my home.
The goal is really to have one screen without any menu so I can have a global view of the more important thing in the home: alarm, lights, camera and control them.
For that, as developer, I decided to implement a dashboard with ReactJS, which seems more convenient to me than dealing with lovelace. Also, the hass API in JS is really easy to use.
I don’t know exactly yet how I will run it at the end, but for now I’m using panel_custom, that’s also why I still have the HA sidebar on the left of my screenshot, I have to hide it, but I didn’t think yet how I will run this dashboard at the end that’s why I didn’t focus on these details. If someone has some ideas I’m listening.
As iOS, MacOS user, I chose an iOS/HomeKit inspiration, but it will still evolve a lot to be more accurate.
In the future I will probably extract the Cards/Modals/Components under a separate package so it can be reused more easily by anyone.
June 2020
In date of the June 28th, it’s still under development, here is a quick look of how it looks like for now
Looks amazing my friend! I love what you did to the left sidebar menu. Amazing!
I will have a look asap! I just seriously don’t have a clue (yet) as to how to build this. Guessing its no regulat ui-lovelace but some app? Please keep the updates coming! And hope you can write a little more detailed install guide
Thanks, here is the actual repository for the dashboard (GitHub - william57m/homeassistant-dashboard)
For now I’m running it locally on my Mac but once I’m ready to use it in “production” I will generate a build and put the files directly into my machine running homeassistant. If you follow the README it should be doable but for sure require some development skills to build your own dashboard, even if based on what I did it’s pretty easy to make your own, but I will continue to make that more clean and simple.
I’ve been building something very very similar to thing. Almost the same look too funnily enough
I’m trying to make it dynamic though, loading the configuration from the yaml of panel_custom
I’ve just come back to working on it today, and for some reason though, I can’t get anything to load into my panel
EDIT: Just forked your repo @william57m
I’ve changed Dashboard.js to return just a div with some text in it, but Im also getting just a blank screen on yours too
My local IP at main.js loads up fine, and if i log out on the index.js file it logs out fine too
Is there something Im missing?
EDIT EDIT: Nevermind, got it working. Forgot the name of the panel_custom had to match the name of the custom element you define
@william57m I’ve forked your repo, and have refactored it to use a yaml configuration for the panel, as well as using React Contexts rather than passing props everywhere, and also using i18next for language translations.
Still a WIP, but nearly there
I think there is a bug, or maybe a missing feature in your homekit-react-components though. Seems the icons aren’t getting vertically aligned properly, and the right margin is being ignored
@greghesp Really nice, I didn’t have much time to spend on that but my goal was definitely trying to make something more generic, I didn’t think to the yaml though it’s an elegant way to do it with HA, I also saw you implemented i18n for the text, nice!
Thanks for reporting the homekit-react-components issue, I will take a look.
Think most of it is working now. Just need to implement the other cards you’ve got, and then figure out a way to do overrides where a device might not exist. As an example, my bedroom fan doesn’t actually have a state as its controlled by RF commands
One issue I have noticed though is that for your Thermostat Card, not all climate entities has the same attribute names, so need a way to pass them through
Nice work !
As a developer I’m very interested by building a dashboard with React. I would like to use Typescript / React / Redux.
I looked after your projects and feel like there will have better way, maybe I’m wrong as I do not know about home-assistant dev.
So my question would be: Why do not going out of lovelace by building a complete standalone dashboard using the Rest and Websocket API ?
I was thinking about building something with Next.js (which I never tried right now, but I know quite well React / Redux).
I’m not using lovelace at all, it’s a custom panel (Creating custom panels | Home Assistant Developer Docs), the advantage of such solution is that I directly have access to the HA API through the hass object, this app is served and used by HA directly on my Raspberry Pi. The final goal is to display that on a tablet on a wall so I can easily hide the sidebar from HA if that’s the issue.
The goal is not to run this app standalone, however I guess it would be easily doable by using the REST or Websocket API from HA.
There are always better way to do something and I’m really open to suggestion if you have, it’s still a WIP so it’s not perfectly clean at the moment, but the separation of concerns are pretty clear now, all the logic of dealing with the data from HA is in the hass-homekit-react-components directory (which is going to be extracted in a separate repo), as I said it’s still a WIP and the way I deal with hass could be better at the moment even if I don’t really see the need for Redux. However, dealing with a REST or Websocket API would be more “complex” codewise than a simple function call on the hass object, so, in this case, Redux would indeed makes sense.
Next.js is good if you want to build a more complex application as it comes with a lot of features (routing, i18n, SSR… for example), but there is absolutely no need for a single page app, you have to considerate what you want to build.
My goal is exactly the same as you, but maybe with a difference. I would like to have multiple views.
It was not my idea to said that using a standalone app or something else that you did was better. That was just an idea and I was thinking why you choose this way and not another one
The idea by using Next.js was only in the case of building a complete new “lovelace” app. With exactly what you said, SSR, routes and dealing with HA throw APIs.
I would like to use Redux because I don’t like to work with React context API to manage a complete state. And passing props to children to children to children is for me something that I have to avoid to keep a more understandable app when there is more and more components and sub-component.
I prefer to have a centralised store which is there to manage all state of the app (this is just my own feeling and how I’m habit to work usually with React).
I will try your project and why not, also take part of it
I’m 95% done in implementing the YAML configuration, and using React Contexts for the HA entity information. For such a basic implementation, Redux is a tad overkill imo, as there isn’t really any statement, since HA passes everything through when it updates. HA is really the state engine, you just need a way to grab it so Contexts are perfect.
I will submit a PR if you want @william57m, however I have a few issues with some of the cards from homekit-react-components. Are you able to share how you’re developing it, as I’ve tried several ways, but cannot get the version I build working with the dashboard. I think its something to do with it using its own instance of React, rather than using the one the dashboard is built with.