Add automation to connect octoprint automatically
This commit is contained in:
parent
244e1424c0
commit
3eaff26ea0
@ -1,6 +1,5 @@
|
||||
- id: 3dprinter-off
|
||||
alias: '[3D Printer] Turn off'
|
||||
description: ''
|
||||
mode: single
|
||||
trigger:
|
||||
- type: value
|
||||
@ -21,3 +20,13 @@
|
||||
- service: switch.turn_off
|
||||
data: { }
|
||||
entity_id: switch.3d_printer_switch
|
||||
- id: 3dprinter-on
|
||||
alias: '[3D Printer] Turn on'
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: switch.3d_printer_switch
|
||||
to: 'on'
|
||||
for: '00:00:05'
|
||||
action:
|
||||
- service: rest_command.octoprint_connect
|
||||
|
@ -26,7 +26,7 @@ zwave:
|
||||
network_key: !secret zwave_network_key
|
||||
|
||||
octoprint:
|
||||
host: prusa.lan
|
||||
host: 192.168.50.6
|
||||
port: 5000
|
||||
api_key: !secret octoprint_api_key
|
||||
number_of_tools: 1
|
||||
@ -74,6 +74,18 @@ spotify:
|
||||
shell_command:
|
||||
poweroff_pc: 'ssh -i /config/.ssh/id_rsa -o UserKnownHostsFile=/config/.ssh/known_hosts home-assistant@hulk.lan sudo /sbin/poweroff'
|
||||
|
||||
rest_command:
|
||||
octoprint_connect:
|
||||
url: 'http://192.168.50.6:5000/api/connection'
|
||||
method: post
|
||||
content_type: 'application/json'
|
||||
headers:
|
||||
X-Api-Key: !secret octoprint_api_key
|
||||
payload: |
|
||||
{
|
||||
"command": "connect"
|
||||
}
|
||||
|
||||
tplink:
|
||||
discovery: true
|
||||
switch:
|
||||
|
Loading…
Reference in New Issue
Block a user