|
1 | 1 | [](https://github.com/custom-components/hacs) |
2 | 2 | [](https://github.com/crownstone/crownstone-home-assistant/releases) |
3 | 3 | [](https://github.com/RicArch97) |
4 | | - |
5 | 4 |
|
6 | 5 | # Crownstone Home Assistant Integration |
7 | 6 |
|
8 | | -This is the HACS repository for the Crownstone Home Assistant integration! |
| 7 | +<img src="images/crownstone_home_assistant.png" width="1628" height="763.5" /> |
9 | 8 |
|
10 | | -This repo contains files that are not available yet in Home Assistant Core. The main purpose is to make the integration available for testing. If you're using this integration and encounted a bug, please post an issue with the problem so we can resolve it. |
| 9 | +# Features |
| 10 | + |
| 11 | +Welcome to the Crownstone integration, a very advanced integration for Home Assistant! |
| 12 | + |
| 13 | +The supreme versatility and user friendliness of the Crownstones is reflected into this integration by the following features: |
11 | 14 |
|
12 | | -Also, if you have any great ideas to make the integration even better, let us know! |
| 15 | +* Extremely easy to set up |
| 16 | +* Instant updates for switch states and data |
| 17 | +* Dynamically adding and removing devices/entities |
| 18 | +* Real-time power usage measurements using the Crownstone USB |
| 19 | +* Keeps track of **who** is in which room! |
| 20 | +* Custom advanced presence triggers to make your whole home react to your presence! |
13 | 21 |
|
14 | | -<img src="images/dashboard.jpg" width="216" height="468" /> <img src="images/device_triggers.jpg" width="216" height="468" /> <img src="images/trigger_config.jpg" width="216" height="468" /> |
| 22 | +This integration stays in one line with the Crownstone app. When data is updated, Crownstones added/deleted or Locations added/deleted, the changes are **instantly** made in Home Assistant as well, thanks to our amazing Server Send Event service! |
15 | 23 |
|
16 | 24 | # Installation |
17 | 25 |
|
18 | 26 | ## HACS |
19 | 27 |
|
20 | 28 | Visit the [HACS installation page](https://hacs.xyz/docs/installation/manual) to set up HACS in your Home Assistant. |
21 | 29 |
|
22 | | -Click the 3 dots button in the top right corner, and click custom respositories. Select category integration, and add the link of this repository. In the HACS store, click the "+" button in the bottom right corner, and search for Crownstone. |
| 30 | +Click the 3 dots button in the top right corner, and click custom repositories. Select category integration, and add the link of this repository. In the HACS store, click the "+" button in the bottom right corner, and search for Crownstone. |
23 | 31 |
|
24 | 32 | ## Manually |
25 | 33 |
|
26 | 34 | Copy all files from custom_components/crownstone/ to custom_components/crownstone inside your HA config folder. |
27 | 35 |
|
28 | | -# Features |
29 | | - |
30 | | -The Crownstone integration currently supports the following features: |
31 | | - |
32 | | -## Switching and dimming Crownstones |
| 36 | +# Crownstones |
33 | 37 |
|
34 | | -Crownstone are respresented in the light platform. You can create a card in the overview and add your Crownstone entities to have a nice overview of your Crownstones! If a Crownstone supports dimming, there will be a brightness slider to dim your Crownstone. |
| 38 | +Crownstone are represented in the light platform, and can switch or dim. You can create a card in the overview and add your Crownstone entities to have a nice overview of your Crownstones! If a Crownstone supports dimming, there will be a brightness slider to dim your Crownstone. |
35 | 39 |
|
36 | | -The default communication method to switch and dim Crownstones, is the cloud. Using a cloud, it can take 1-3 seconds before a crownstone switches. However, we added support for the Crownstone USB in Home Assistant. Plug the USB in and start Home Assistant, it should automatically start switching using the USB. Since the latencies are so low using the USB, switching and dimming will be instant! |
| 40 | +When the ability state of **dimming** is changed through the Crownstone app, your config entry will reload to process the change in supported features. This means that some states may be different, and the power usage is likely back to 0W. |
37 | 41 |
|
38 | | -### Crownstone ability updates |
| 42 | +Crownstone entities have some state attributes to provide more information about the Crownstone. To see this information, simply click on the entity. This information is: |
| 43 | +* Switch method (Crownstone Cloud or Crownstone USB Dongle) |
| 44 | +* Dimming (Enabled or Disabled) |
| 45 | +* Tap To Toggle (Enabled or Disabled) |
| 46 | +* Switchcraft (Enabled or Disabled) |
39 | 47 |
|
40 | | -Currently, the Crownstone integration supports updating a Crownstone's ability during runtime. Once changed in the app, Home Assistant will reload your config entry, and re-initialize all your Crownstone entities. |
| 48 | +<img src="images/crownstone_entity.png" width="390" height="385" /> |
41 | 49 |
|
42 | | -## Presence sensor |
| 50 | +# Presence |
43 | 51 |
|
44 | 52 | The unique selling point of Crownstone, the presence on room level, is also available in Home Assistant! |
45 | 53 |
|
46 | | -The state sensor is a string of the first names of the people who are in the room. It is possbile for multiple people to be in the same room, the names of the users is separated by a comma. |
| 54 | +The state sensor is a string of the first names of the people who are in the room. It is possible for multiple people to be in the same room, the names of the users is separated by a comma. |
47 | 55 |
|
48 | | -Apart from the room presence there is also sphere presence. this shows who is currently in the sphere (house, apartement). If a user is at home (in the sphere), the user's name will be shown in sphere presence and one of the room presence entities. |
| 56 | +Apart from the room presence there is also sphere presence. this shows who is currently in the sphere (house, apartment). If a user is at home (in the sphere), the user's name will be shown in sphere presence and one of the room presence entities. |
49 | 57 |
|
50 | 58 | The Crownstone app is leading the presence functionality, for any issues with your presence detection make sure to go to your Crownstone app and retrain your rooms. 4 Crownstones are required for the localisation on room level. If you don't have 4 Crownstones, it will only show your presence in the sphere (house). |
51 | 59 |
|
@@ -74,16 +82,74 @@ Note that these triggers are `event based`. Multiple users and all users trigger |
74 | 82 |
|
75 | 83 | The events are registered, which means that if a user enters a room, but leaves shortly after, the event for entered stays registered. If the other 2 users in the trigger then enter the room, the action will STILL execute. Make sure you select the correct trigger for the occasion. Using a single user trigger to execute an action will always be the safest option. |
76 | 84 |
|
77 | | -# Troubleshooting |
| 85 | +<img src="images/device_triggers.jpg" width="216" height="468" /> <img src="images/trigger_config.jpg" width="216" height="468" /> |
| 86 | + |
| 87 | +# Power usage |
| 88 | + |
| 89 | +Crownstone's live power usage streaming is also available in Home Assistant. Because of the constant updates, this functionality is only available when using the [Crownstone USB dongle](#crownstone-usb-dongle). |
| 90 | + |
| 91 | +The power usage for each Crownstone updates every minute, or instantly for a particular Crownstone when switching it. It can take some time before the correct power usage is displayed. |
| 92 | + |
| 93 | +## Power usage device triggers |
| 94 | + |
| 95 | +Power usage entities use the default device triggers from sensor for power usage sensors. The following triggers are available: |
| 96 | +- Crownstone Power usage energy changes |
| 97 | + |
| 98 | +For `Crownstone Power usage changes` there are 3 options: |
| 99 | +- Above a certain value |
| 100 | +- Below a certain value |
| 101 | +- Duration of the change in hh/mm/ss |
| 102 | + |
| 103 | +You can have other devices react to peaks in power usage, send an event or notification, whatever you like! |
| 104 | + |
| 105 | +<img src="images/power_usage.png" width="356" height="479" /> |
| 106 | + |
| 107 | +# Comparison |
| 108 | + |
| 109 | +The integration works with the Crownstone Cloud and the Crownstone USB dongle. The differences between the two are only relevant for the Crownstones. The integration uses the Crownstone Cloud by default, to use the Crownstone USB you'll have to purchase one from the Crownstone store. |
| 110 | + |
| 111 | +Presence updates and data updates are always done using the Crownstone Cloud. |
| 112 | + |
| 113 | +## Crownstone Cloud |
| 114 | + |
| 115 | +- [x] Switching Crownstones |
| 116 | +- [x] Dimming Crownstones |
| 117 | +- [x] State updates in Home Assistant when switching from Crownstone app |
| 118 | +- [x] Can switch multiple Crownstones at once |
| 119 | +- [ ] No delay when switching Crownstones |
| 120 | +- [ ] State updates in Home Assistant when using lightswitch with Switchcraft |
| 121 | +- [ ] Can switch Crownstones independently (no smartphone in proximity required) |
| 122 | +- [ ] Can use power usage entities |
| 123 | + |
| 124 | +## Crownstone USB Dongle |
| 125 | + |
| 126 | +- [x] Switching Crownstones |
| 127 | +- [x] Dimming Crownstones |
| 128 | +- [x] State updates in Home Assistant when switching from Crownstone app |
| 129 | +- [x] Can switch multiple Crownstones at once |
| 130 | +- [x] No delay when switching Crownstones |
| 131 | +- [x] State updates in Home Assistant when using lightswitch with Switchcraft |
| 132 | +- [x] Can switch Crownstones independently (no smartphone in proximity required) |
| 133 | +- [x] Can use power usage entities |
| 134 | + |
| 135 | +Get your Crownstone USB dongle [here](https://shop.crownstone.rocks/products/crownstone-usb-dongle) and enhance your Home Assistant experience! |
78 | 136 |
|
79 | | -1. When I switch my Crownstone using the app, the change isn't visible in Home Assistant, why? |
| 137 | +# Testing |
80 | 138 |
|
81 | | -We chose not to update the state in Home Assistant externally because the state isn't always known. When using switchcraft for example, the state of the Crownstone is not updated in the cloud. The safest option is to only let Home Assistant change the state of it's entities. The Crownstone entities use assumed state which means you will ALWAYS be able to switch your Crownstones using Home Assistant, independed of the state in the app. |
| 139 | +To ensure the best possibly experience with the Crownstone Home Assistant integration, thoroughly testing is required. You can find a test rapport [here](test_rapport.md). |
82 | 140 |
|
83 | | -2. I updated some data / Crownstone firmware in the Crownstone app, but it is not updated in Home Assistant |
| 141 | +This rapport shows exactly what tests have been done, and what the result was. |
| 142 | +If you like to contribute test results of tests that have not been done by us yet, you can post an issue with the test & the result. We will adjust the rapport accordingly including credit. |
84 | 143 |
|
85 | | -Dynamically updating data is not yet supported for the Crownstone integration. To register the changes in HA, you'll have to restart. |
| 144 | +# Roadmap |
86 | 145 |
|
87 | | -3. Will there be an option to use power usage as trigger in Home Assistant? |
| 146 | +- [ ] Publish initial Crownstone integration to Home Assistant Core (in progress) |
| 147 | +- [x] Optimize configuration flow for easier setup |
| 148 | +- [x] Create device triggers for Presence devices |
| 149 | +- [x] Add power usage entities to Crownstone devices |
| 150 | +- [x] Fix state updates coming from the Crownstone app not being done in Home Assistant |
| 151 | +- [x] Dynamically update data & add/remove Crownstone and Location devices without restarting or reloading |
| 152 | +- [ ] Create device conditions for Presence devices |
| 153 | +- [ ] Optimize power usage accuracy by implementing new UART protocol |
88 | 154 |
|
89 | | -The power usage feature is on the roadmap for upcoming updates. Likely this will come whenever the Crownstone hub is finished. |
| 155 | +Any ideas for future updates? Let us [know](mailto:ask@crownstone.rocks?subject=[GitHub]%20Crownstone%20Home%20Assistant%20Integration)! |
0 commit comments