This commit is contained in:
Edward Firmo
2024-01-08 12:35:59 +01:00
parent eff58b978a
commit a056106a9f
2 changed files with 44 additions and 20 deletions

View File

@@ -1,7 +1,8 @@
# ESPHome
### Logging
Avoid excessive log, or at least avoid excessive log at DEBUG level, but if you look around this project, many of the functionalities will log like this:
## Logging
Avoid excessive log, or at least avoid excessive log at DEBUG level,
but if you look around this project, many of the functionalities will log like this:
```yaml
sensor:
@@ -18,8 +19,12 @@ sensor:
}
```
### Page opened
When a new page is opened, a script name `page_changed` (whith a parameter `page` containing a string with the page name) is called and that one will call a page specific script named `page_<page_name>`. In addition, pages with multiple pages (entitypageXX, buttonpageXX and weatherXX) will also call a generic page named `page_entitypage`, `page_buttonpage` or `page_weather` with a parameter `page_number` containing the number of the page called.
## Page opened
When a new page is opened, a script name `page_changed` (whith a parameter `page` containing a
string with the page name) is called and that one will call a page specific script named `page_<page_name>`.
In addition, pages with multiple pages (entitypageXX, buttonpageXX and weatherXX) will also call
a generic page named `page_entitypage`, `page_buttonpage` or `page_weather` with a parameter
`page_number` containing the number of the page called.
If you want to execute expecific code when a page is opened, you can extend the functionality of that specific page:
@@ -42,11 +47,13 @@ script:
# Code to run when buttonpage02 is opened
```
#### Managing conflicts with Upload TFT
The TFT upload is the most resource conmsuming task in this project and should have all the resources available, so when creating something, please take in account:
## Managing conflicts with Upload TFT
The TFT upload is the most resource conmsuming task in this project and should have all the resources available,
so when creating something, please take in account:
#### Stop your scripts before the upload starts
If you create a new script that should be stopped previous a Upload TFT starts, please add your script to the `stop_all` script like this:
### Stop your scripts before the upload starts
If you create a new script that should be stopped previous a Upload TFT starts,
please add your script to the `stop_all` script like this:
```yaml
script:
@@ -55,8 +62,9 @@ script:
- script.stop: my_new_script_id
```
#### Check for upload status before starting any action
There is a global `is_uploading_tft` which will be true when the upload TFT process starts, so you can use this in your code like this:
### Check for upload status before starting any action
There is a global `is_uploading_tft` which will be true when the upload TFT process starts,
so you can use this in your code like this:
```yaml
sensor:

View File

@@ -1,13 +1,21 @@
# Alarm Control Panel
You can control an Alarm Control Panel from your NSPanel, which will allow you to set the alarm mode between the standard modes supported by Home Assistant (Home, Away, Night, Vacation or Custom bypass) or disarm the alarm.
You can control an Alarm Control Panel from your NSPanel,
which will allow you to set the alarm mode between the standard modes supported by
Home Assistant (Home, Away, Night, Vacation or Custom bypass) or disarm the alarm.
Currently, only alarms without a code or alarms with a numeric code will be supported. If your alarm requires a text code, you will still be able to display it on your NSPanel, however, when you click in any button it will send services calls to Home Assistant without the code and it will fail for the calls where a code is required.
Currently, only alarms without a code or alarms with a numeric code will be supported.
If your alarm requires a text code, you will still be able to display it on your NSPanel,
however, when you click in any button it will send services calls to Home Assistant
without the code and it will fail for the calls where a code is required.
### Security advisory
By default, the communication between your NSPanel (ESPHome) and Home Assistant (HA) is not encrypted, which means a person with access to your network could potentially monitor the communication between your panel and HA and replicate the service calls.
Although this is not a big issue for most of the service calls (turn-on a light, close a curtain, etc.), it can be a problem when controlling your alarm system.<br>
By default, the communication between your NSPanel (ESPHome) and Home Assistant (HA) is not encrypted,
which means a person with access to your network could potentially monitor the communication between your panel and HA and replicate the service calls.
Although this is not a big issue for most of the service calls (turn-on a light,
close a curtain, etc.), it can be a problem when controlling your alarm system.
Based on that, we hardly reccoment the use of API encryption for all users controlling an Alarm system via a NSPanel.
You can easily enable this by following the ["API encryption" example available here](customization.md#api-encryption).
@@ -15,8 +23,13 @@ You can easily enable this by following the ["API encryption" example available
### Allow the device to make Home Assistant service calls
First, you have to configure your Home Assistant to allow your panel to make service calls. All other services are called from the Blueprint, however this requires the ESPHome to send an event containing in plain text all the information needed to the service call, which could be a security issue, so all the alarm calls will be driven by the panel to ensure a safer environment.<br>
To enable this option, go to your ESPHome integrations panel (Settings > Devices and Services > ESPHome) and click "Configure" next to the entry related to your panel:
First, you have to configure your Home Assistant to allow your panel to make service calls.
All other services are called from the Blueprint, however this requires the ESPHome to send
an event containing in plain text all the information needed to the service call,
which could be a security issue, so all the alarm calls will be driven by the panel to ensure a safer environment.
To enable this option, go to your ESPHome integrations panel (Settings > Devices and Services > ESPHome)
and click "Configure" next to the entry related to your panel:
![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/37bfc622-c0cd-4941-a397-3eeb2ddbe6a2)
@@ -26,14 +39,16 @@ Then check the option "Allow the device to make Home Assistant service calls":
### Blueprint settings
Open the automation based on the NSPanel Blueprint and look for a section related to "Alarm Control Panel".<br>
Open the automation based on the NSPanel Blueprint and look for a section related to "Alarm Control Panel".
Select your alarm control panel entity, click "Save", and your are done. :sunglasses:
![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/859d3f4b-9a05-4694-9e2c-c32ab3a5e22f)
## Controlling your alarm from your panel
When an alarm control panel is set in your Blueprint automation, you will see the alarm icon on your panel's Home page.
When an alarm control panel is set in your Blueprint automation,
you will see the alarm icon on your panel's Home page.
This icon will change following the alarm state as described in the table below.
A click on that icon will show the Alarm Control Panel page:
@@ -41,7 +56,8 @@ A click on that icon will show the Alarm Control Panel page:
![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/bc312981-3d5a-42c7-b0b4-203457ff549f)
You can change your alarm settings with a single click on the button related to the new state you want to set your alarm to, or close the page to go back to Home page.
You can change your alarm settings with a single click on the button related to the new state
you want to set your alarm to, or close the page to go back to Home page.
### Description of states shown with the alarm icon
@@ -57,4 +73,4 @@ pending | Amber |![shield-outline](https://github.com/Blackymas/NSPanel_HA_Bluep
arming | Amber |![shield-outline](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/31bcd613-04d6-455a-a443-3299211d487e)| mdi:shield-outline | The alarm is arming.
disarming | Amber |![shield-off-outline](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/37c02584-dd65-4575-8d95-c7346de599e4)| mdi:shield-off-outline | The alarm is disarming.
triggered | Red |![shield-alert-outline](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/ee1ec55b-e671-4aa0-9baa-77eb2a8c8c7f)| mdi:shield-alert-outline | The alarm is triggered.
unknown / unavailable | White |![shield-alert-outline](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/a382e5ab-2e16-453c-bc9b-b3dcd3825de7)| mdi:shield-alert-outline | The alarm state is unknown or unavailable
unknown / unavailable | White |![shield-alert-outline](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/a382e5ab-2e16-453c-bc9b-b3dcd3825de7)| mdi:shield-alert-outline | The alarm state is unknown or unavailable.