Skip to content

Commit

Permalink
added scripts.yaml + latest backup
Browse files Browse the repository at this point in the history
  • Loading branch information
escomputers committed May 4, 2023
1 parent 5cd2c23 commit 16b41ce
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ Denkovi USB 8CH relay board
| ----------- | ---------- |
| USB-B | USB |

Home Assistant `configuration.yaml` contains configuration for controlling USB relay board,
## HOME ASSISTANT CONFIGURATION

Home Assistant `homeassistant-configuration/configuration.yaml` contains configuration for controlling USB relay board,
using [RESTful Binary Sensor](https://www.home-assistant.io/integrations/binary_sensor.rest).
To get it working, an API service must be started within raspbian OS.
Here's the repo: [usbAPI](https://github.com/escomputers/usbAPI)
In this case, the relay board is controlled by a jar file but it can be adapted to any other board by editing the commands to run.

While `homeassistant-configuration/scripts.yaml` contains entities for controlling previously created API relays.

## POWER

| DEVICE | REQUIRED POWER SOURCES |
Expand Down
Binary file added homeassistant-configuration/backups/39d8ff26.tar
Binary file not shown.
File renamed without changes.
File renamed without changes.
216 changes: 216 additions & 0 deletions homeassistant-configuration/scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
usbrelay1_control:
alias: usbrelay1_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay1
state: 'off'
then:
- service: rest_command.usbrelay1_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay1 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay1
state: 'on'
then:
- service: rest_command.usbrelay1_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay1 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay2_control:
alias: usbrelay2_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay2
state: 'off'
then:
- service: rest_command.usbrelay2_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay2 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay2
state: 'on'
then:
- service: rest_command.usbrelay2_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay2 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay3_control:
alias: usbrelay3_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay3
state: 'off'
then:
- service: rest_command.usbrelay3_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay3 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay3
state: 'on'
then:
- service: rest_command.usbrelay3_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay3 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay4_control:
alias: usbrelay4_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay4
state: 'off'
then:
- service: rest_command.usbrelay4_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay4 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay4
state: 'on'
then:
- service: rest_command.usbrelay4_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay4 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay5_control:
alias: usbrelay5_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay5
state: 'off'
then:
- service: rest_command.usbrelay5_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay5 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay5
state: 'on'
then:
- service: rest_command.usbrelay5_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay5 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay6_control:
alias: usbrelay6_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay6
state: 'off'
then:
- service: rest_command.usbrelay6_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay6 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay6
state: 'on'
then:
- service: rest_command.usbrelay6_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay6 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay7_control:
alias: usbrelay7_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay7
state: 'off'
then:
- service: rest_command.usbrelay7_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay7 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay7
state: 'on'
then:
- service: rest_command.usbrelay7_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay7 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch
usbrelay8_control:
alias: usbrelay8_control
sequence:
- if:
- condition: state
entity_id: binary_sensor.usbrelay8
state: 'off'
then:
- service: rest_command.usbrelay8_on
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay8 ON
title: Growbox Notify
- if:
- condition: state
entity_id: binary_sensor.usbrelay8
state: 'on'
then:
- service: rest_command.usbrelay8_off
data: {}
- service: notify.mobile_app_s62_pro
data:
message: usbrelay8 OFF
title: Growbox Notify
mode: single
icon: mdi:light-switch

0 comments on commit 16b41ce

Please sign in to comment.