I’ve been working on this for a few months now - I’ve published two npm packages, @hakit/components & @hakit/core. And here’s the repository! (give me a star if you’re interested!)
There’s extensive documentation provided! Here’s a preview of what you can do with hakit:
Easy ThemeProvider to create different themes!
Or, you can do something completely custom: https://www.youtube.com/watch?v=xE_IZP9HeWc
These two packages were designed to make it exceptionally easy to start creating a custom dashboard to interact with home assistant in React, typescript types are available for all services and entity domains, it’s super simple to get going!
<HassConnect hassUrl={URL}>
<ThemeProvider />
</HassConnect>
That’s all you have to do to get authenticated as it will ask you to login, and you only have to login once (per device).
I’ve been pretty active getting this to a state where users can comfortably achieve all they can achieve with lovelace, the components that are supported are;
-
ButtonCard - card similar to home assistant button card, lights/climates have extra popup information
-
ClimateCard - card to control climate entities with a popup for more control
-
EntitiesCard - List of entities and their states
-
FabCard - simple floating action button
-
MediaPlayerCard - full media play card supporting most features
-
VacuumCard - (WIP) - this is in progress
-
PictureCard - simple picture card
-
RoomCard - automates routing via hashes
-
SidebarCard - RoomCards auto populate the sidebar menu items
-
TimeCard - a card to display the time/date based on sensor.time / sensor.date
-
TriggerCard - a card to trigger something once, like an automation or scene or script
-
WeatherCard - displays weather information
Amongst others to help with layout, and shared components (Row, Column, Group, Alert, ControlSlider, ColorPicker, ClimateControls, ColorTempPicker, ThemeProvider, ErrorBoundary, Modal, Ripples & more.
To trigger a request to update an entity if you need to do something out of the box, is super simple as there’s hooks provided to interact with the websocket api which is completely typed with typescript:
const entity = useEntity('climate.air_conditioner');
entity.api.setHvacMode({
hvac_mode: 'cool',
});
I have a bunch of ideas to take this to the next level, such as Masonry layouts, Theme pickers, and lots more custom cards, but as you can appreciate, this has been a lot of work already!
I would appreciate some feedback of what you think of it so far!!