-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from EverythingSmartHome/SEN0609
Add support for SEN0609
- Loading branch information
Showing
8 changed files
with
353 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,284 @@ | ||
binary_sensor: | ||
- platform: gpio | ||
name: mmWave | ||
id: mmwave | ||
device_class: occupancy | ||
pin: | ||
number: GPIO17 | ||
mode: INPUT_PULLDOWN | ||
|
||
uart: | ||
id: uart_bus | ||
tx_pin: GPIO14 | ||
rx_pin: GPIO13 | ||
baud_rate: 9600 | ||
debug: | ||
direction: BOTH | ||
dummy_receiver: true | ||
after: | ||
delimiter: "\n" | ||
sequence: | ||
- lambda: UARTDebug::log_string(direction, bytes); | ||
|
||
light: | ||
- platform: binary | ||
name: mmWave LED | ||
restore_mode: RESTORE_DEFAULT_OFF | ||
output: mmwave_led_output | ||
entity_category: config | ||
disabled_by_default: False | ||
|
||
output: | ||
- platform: template | ||
id: mmwave_led_output | ||
type: binary | ||
write_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- if: | ||
condition: | ||
lambda: !lambda return state; | ||
then: | ||
- uart.write: "setLedMode 1 0" | ||
else: | ||
- uart.write: "setLedMode 1 1" | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 3s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
switch: | ||
- platform: template | ||
name: mmWave sensor | ||
id: mmwave_sensor | ||
disabled_by_default: True | ||
entity_category: config | ||
optimistic: true | ||
restore_mode: RESTORE_DEFAULT_ON | ||
turn_on_action: | ||
- uart.write: "sensorStart" | ||
- delay: 1s | ||
turn_off_action: | ||
- uart.write: "sensorStop" | ||
- delay: 1s | ||
|
||
- platform: template | ||
name: UART presence output | ||
id: uart_presence_output | ||
entity_category: config | ||
disabled_by_default: true | ||
optimistic: true | ||
turn_on_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: "setUartOutput 1 1" | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 3s | ||
- switch.turn_on: mmwave_sensor | ||
turn_off_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: "setUartOutput 1 0" | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 3s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
- platform: template | ||
name: UART target output | ||
id: uart_target_output | ||
entity_category: config | ||
disabled_by_default: true | ||
optimistic: true | ||
assumed_state: false | ||
turn_on_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: "setUartOutput 2 1 1 1" | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 3s | ||
- switch.turn_on: mmwave_sensor | ||
turn_off_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: "setUartOutput 2 0" | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 3s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
number: | ||
- platform: template | ||
id: mmwave_distance_min | ||
name: mmWave Minimum Distance | ||
icon: mdi:arrow-left-right | ||
entity_category: config | ||
min_value: 0 | ||
max_value: 25 | ||
initial_value: 0 | ||
optimistic: true | ||
step: 0.1 | ||
restore_value: true | ||
unit_of_measurement: m | ||
mode: slider | ||
- platform: template | ||
id: mmwave_distance_max | ||
name: mmWave Max Distance | ||
icon: mdi:arrow-left-right | ||
entity_category: config | ||
min_value: 0 | ||
max_value: 25 | ||
initial_value: 12 | ||
optimistic: true | ||
step: 0.1 | ||
restore_value: true | ||
unit_of_measurement: m | ||
mode: slider | ||
- platform: template | ||
id: mmwave_range_reduced | ||
name: mmWave Range Reduced | ||
icon: mdi:arrow-left-right | ||
entity_category: config | ||
min_value: 0 | ||
max_value: 25 | ||
initial_value: 0.8 | ||
optimistic: true | ||
step: 0.1 | ||
restore_value: true | ||
unit_of_measurement: m | ||
mode: slider | ||
set_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: !lambda | ||
std::string ms = "setRangeReduced " + to_string(x); | ||
return std::vector<unsigned char>(ms.begin(), ms.end()); | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 1s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
- platform: template | ||
name: mmWave off latency | ||
icon: mdi:clock-end | ||
entity_category: config | ||
id: mmwave_off_latency | ||
min_value: 1 | ||
max_value: 600 | ||
initial_value: 15 | ||
optimistic: true | ||
step: 5 | ||
restore_value: true | ||
unit_of_measurement: seconds | ||
mode: slider | ||
set_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: !lambda |- | ||
std::string mss = "setLatency " + to_string(id(mmwave_on_latency).state) + " " + to_string(id(mmwave_off_latency).state); | ||
return std::vector<unsigned char>(mss.begin(), mss.end()); | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 1s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
- platform: template | ||
name: mmWave on latency | ||
icon: mdi:clock-start | ||
id: mmwave_on_latency | ||
entity_category: config | ||
min_value: 0 | ||
max_value: 2 | ||
initial_value: 0 | ||
optimistic: true | ||
step: 0.25 | ||
restore_value: true | ||
unit_of_measurement: seconds | ||
mode: slider | ||
set_action: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: !lambda |- | ||
std::string mss = "setLatency " + to_string(id(mmwave_on_latency).state) + " " + to_string(id(mmwave_off_latency).state); | ||
return std::vector<unsigned char>(mss.begin(), mss.end()); | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 1s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
- platform: template | ||
name: mmWave Sustain Sensitivity | ||
icon: mdi:target-variant | ||
id: mmwave_sensitivity | ||
entity_category: config | ||
min_value: 0 | ||
max_value: 9 | ||
initial_value: 7 | ||
optimistic: true | ||
step: 1 | ||
restore_value: true | ||
|
||
- platform: template | ||
name: mmWave Trigger Sensitivity | ||
icon: mdi:target-variant | ||
id: mmwave_trigger_sensitivity | ||
entity_category: config | ||
min_value: 0 | ||
max_value: 9 | ||
initial_value: 5 | ||
optimistic: true | ||
step: 1 | ||
restore_value: true | ||
|
||
button: | ||
- platform: template | ||
name: "Set Distance" | ||
id: set_distance | ||
entity_category: config | ||
on_press: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: !lambda | ||
std::string ms = "setRange " + to_string(id(mmwave_distance_min).state) + " " + to_string(id(mmwave_distance_max).state); | ||
return std::vector<unsigned char>(ms.begin(), ms.end()); | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 1s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
- platform: template | ||
name: "Set Sensitivity" | ||
id: set_sensitivity | ||
entity_category: config | ||
on_press: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: | ||
!lambda std::string mss = "setSensitivity " + to_string(id(mmwave_sensitivity).state) + " " + to_string(id(mmwave_trigger_sensitivity).state); | ||
return std::vector<unsigned char>(mss.begin(), mss.end()); | ||
- delay: 1s | ||
- uart.write: "saveConfig" | ||
- delay: 1s | ||
- switch.turn_on: mmwave_sensor | ||
|
||
- platform: template | ||
name: Restart mmWave Sensor | ||
id: restart_mmwave | ||
entity_category: config | ||
internal: true | ||
on_press: | ||
- uart.write: "resetSystem" | ||
- platform: template | ||
name: Factory Reset mmWave | ||
icon: mdi:cog-counterclockwise | ||
id: factory_reset_mmwave | ||
disabled_by_default: true | ||
entity_category: config | ||
on_press: | ||
- switch.turn_off: mmwave_sensor | ||
- delay: 1s | ||
- uart.write: "resetCfg" | ||
- delay: 3s | ||
- switch.turn_on: mmwave_sensor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
substitutions: | ||
name: "everything-presence-one" | ||
friendly_name: "Everything Presence One" | ||
project_name: "Everything Smart Technology.Everything Presence One" | ||
project_version: "1.2.3" | ||
temperature_offset: "-3" | ||
humidity_offset: "5" | ||
temperature_update_interval: "60s" | ||
illuminance_update_interval: "2s" | ||
hidden_ssid: "false" | ||
factory_reset_disabled: "true" | ||
uart_target_output_disabled: "true" | ||
uart_presence_output_disabled: "true" | ||
log_level: "ERROR" | ||
|
||
dashboard_import: | ||
package_import_url: github://everythingsmarthome/everything-presence-one/everything-presence-one-sen0609-ble.yaml@main | ||
import_full_config: false | ||
|
||
packages: | ||
device_base: !include common/everything-presence-one-base.yaml | ||
bluetooth_base: !include common/bluetooth-base.yaml | ||
sen0395_base: !include common/sen0609-common.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
substitutions: | ||
name: "everything-presence-one" | ||
friendly_name: "Everything Presence One" | ||
project_name: "Everything Smart Technology.Everything Presence One" | ||
project_version: "1.2.3" | ||
temperature_offset: "-3" | ||
humidity_offset: "5" | ||
temperature_update_interval: "60s" | ||
illuminance_update_interval: "2s" | ||
hidden_ssid: "false" | ||
factory_reset_disabled: "true" | ||
uart_target_output_disabled: "true" | ||
uart_presence_output_disabled: "true" | ||
log_level: "ERROR" | ||
|
||
dashboard_import: | ||
package_import_url: github://everythingsmarthome/everything-presence-one/everything-presence-one-sen0609.yaml@main | ||
import_full_config: false | ||
|
||
packages: | ||
device_base: !include common/everything-presence-one-base.yaml | ||
sen0395_base: !include common/sen0609-common.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters