automations.yaml, zigbee2mqtt/state.json
This commit is contained in:
1 parent
86ba055b6a
commit
3b54a69653
2 files changed
+45
-19
No files matched your search
+33
-7
@@ -3541,8 +3541,9 @@
|
|||||||
- id: '1787462157568'
|
- id: '1787462157568'
|
||||||
alias: 3D Print Early Layers Snapshot
|
alias: 3D Print Early Layers Snapshot
|
||||||
description: Telegram-only snapshots from all 3 printer cameras. Fires when Z crosses
|
description: Telegram-only snapshots from all 3 printer cameras. Fires when Z crosses
|
||||||
1.0 mm, then again at 25%, 50% and 75% print progress. Re-asserts the SparkX i7
|
1.0 mm, then again at 25%, 50% and 75% print progress. Lights the SparkX i7 and
|
||||||
light and bedroom lamp before capturing so the photos are lit.
|
bedroom lamp only if they are currently off, then restores whatever state they
|
||||||
|
were in before capturing.
|
||||||
triggers:
|
triggers:
|
||||||
- above: 1
|
- above: 1
|
||||||
entity_id: sensor.sparkx_i7_position_z
|
entity_id: sensor.sparkx_i7_position_z
|
||||||
@@ -3562,6 +3563,7 @@
|
|||||||
state: printing
|
state: printing
|
||||||
actions:
|
actions:
|
||||||
- variables:
|
- variables:
|
||||||
|
bedroom_needs_light: '{{ not is_state(''light.bedroom_lamp_2'', ''on'') }}'
|
||||||
message: '{% set file = state_attr(''sensor.sparkx_i7_print_status'', ''file'')
|
message: '{% set file = state_attr(''sensor.sparkx_i7_print_status'', ''file'')
|
||||||
or '''' %} {% set name = ''Print'' if file in ['''', none, ''unknown'', ''unavailable'']
|
or '''' %} {% set name = ''Print'' if file in ['''', none, ''unknown'', ''unavailable'']
|
||||||
else file.split(''/'')[-1].replace(''.gcode'', '''') %} {% set pct = states(''sensor.sparkx_i7_print_progress'')
|
else file.split(''/'')[-1].replace(''.gcode'', '''') %} {% set pct = states(''sensor.sparkx_i7_print_progress'')
|
||||||
@@ -3572,19 +3574,25 @@
|
|||||||
layers (Z {{ trigger.to_state.state | float(1) }} mm) {% elif trigger.to_state.state
|
layers (Z {{ trigger.to_state.state | float(1) }} mm) {% elif trigger.to_state.state
|
||||||
| float(0) >= 75 %} 75% complete {% elif trigger.to_state.state | float(0)
|
| float(0) >= 75 %} 75% complete {% elif trigger.to_state.state | float(0)
|
||||||
>= 50 %} 50% complete {% else %} 25% complete {% endif %}'
|
>= 50 %} 50% complete {% else %} 25% complete {% endif %}'
|
||||||
|
sparkx_needs_light: '{{ not is_state(''light.sparkx_i7_light'', ''on'') }}'
|
||||||
tag: '{% if trigger.entity_id == ''sensor.sparkx_i7_position_z'' %} z1 {% else
|
tag: '{% if trigger.entity_id == ''sensor.sparkx_i7_position_z'' %} z1 {% else
|
||||||
%} p{{ trigger.above | int }} {% endif %}'
|
%} p{{ trigger.above | int }} {% endif %}'
|
||||||
- if:
|
- if:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: '{{ not is_state(''light.sparkx_i7_light'', ''on'') or not is_state(''light.bedroom_lamp_2'',
|
value_template: '{{ sparkx_needs_light }}'
|
||||||
''on'') }}'
|
|
||||||
then:
|
then:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
continue_on_error: true
|
continue_on_error: true
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id: light.sparkx_i7_light
|
||||||
- light.sparkx_i7_light
|
- if:
|
||||||
- light.bedroom_lamp_2
|
- condition: template
|
||||||
|
value_template: '{{ bedroom_needs_light }}'
|
||||||
|
then:
|
||||||
|
- action: light.turn_on
|
||||||
|
continue_on_error: true
|
||||||
|
target:
|
||||||
|
entity_id: light.bedroom_lamp_2
|
||||||
- delay:
|
- delay:
|
||||||
seconds: 3
|
seconds: 3
|
||||||
- parallel:
|
- parallel:
|
||||||
@@ -3603,6 +3611,24 @@
|
|||||||
filename: /config/www/ender_cam2_{{ tag }}.jpg
|
filename: /config/www/ender_cam2_{{ tag }}.jpg
|
||||||
target:
|
target:
|
||||||
entity_id: camera.endercamera2_duckdns_org
|
entity_id: camera.endercamera2_duckdns_org
|
||||||
|
- delay:
|
||||||
|
seconds: 2
|
||||||
|
- if:
|
||||||
|
- condition: template
|
||||||
|
value_template: '{{ sparkx_needs_light }}'
|
||||||
|
then:
|
||||||
|
- action: light.turn_off
|
||||||
|
continue_on_error: true
|
||||||
|
target:
|
||||||
|
entity_id: light.sparkx_i7_light
|
||||||
|
- if:
|
||||||
|
- condition: template
|
||||||
|
value_template: '{{ bedroom_needs_light }}'
|
||||||
|
then:
|
||||||
|
- action: light.turn_off
|
||||||
|
continue_on_error: true
|
||||||
|
target:
|
||||||
|
entity_id: light.bedroom_lamp_2
|
||||||
- action: telegram_bot.send_media_group
|
- action: telegram_bot.send_media_group
|
||||||
data:
|
data:
|
||||||
caption: '{{ message }}'
|
caption: '{{ message }}'
|
||||||
|
|||||||
+12
-12
@@ -27,7 +27,7 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"power": 2,
|
"power": 1.9,
|
||||||
"current": 0.09,
|
"current": 0.09,
|
||||||
"energy": 50.9,
|
"energy": 50.9,
|
||||||
"power_factor": 0.17,
|
"power_factor": 0.17,
|
||||||
@@ -45,9 +45,9 @@
|
|||||||
"state": "ON",
|
"state": "ON",
|
||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"voltage": 119.8,
|
"voltage": 119.3,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"energy": 96.41,
|
"energy": 96.42,
|
||||||
"power_factor": 0.88,
|
"power_factor": 0.88,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
"latest_release_notes": null
|
"latest_release_notes": null
|
||||||
},
|
},
|
||||||
"linkquality": 145,
|
"linkquality": 145,
|
||||||
"power": 85.4,
|
"power": 85.2,
|
||||||
"current": 0.85,
|
"current": 0.85,
|
||||||
"power_on_behavior": "on"
|
"power_on_behavior": "on"
|
||||||
},
|
},
|
||||||
@@ -78,9 +78,9 @@
|
|||||||
"state": "ON",
|
"state": "ON",
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"energy": 198.9,
|
"energy": 198.9,
|
||||||
"power": 95.2,
|
"power": 0.8,
|
||||||
"current": 0.85,
|
"current": 0.05,
|
||||||
"power_factor": 0.94,
|
"power_factor": 0.39,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
"installed_version": 268513381,
|
"installed_version": 268513381,
|
||||||
@@ -95,11 +95,11 @@
|
|||||||
"led_brightness": 100,
|
"led_brightness": 100,
|
||||||
"countdown_to_turn_off": 0,
|
"countdown_to_turn_off": 0,
|
||||||
"countdown_to_turn_on": 0,
|
"countdown_to_turn_on": 0,
|
||||||
"voltage": 120.1,
|
"voltage": 119.6,
|
||||||
"energy": 96.08,
|
"energy": 96.08,
|
||||||
"state": "ON",
|
"state": "ON",
|
||||||
"power": 10.7,
|
"power": 16.5,
|
||||||
"current": 0.18,
|
"current": 0.26,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"power_factor": 0.58,
|
"power_factor": 0.58,
|
||||||
"update": {
|
"update": {
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
"energy": 13.31,
|
"energy": 13.31,
|
||||||
"current": 0.01,
|
"current": 0.01,
|
||||||
"power": 0.1,
|
"power": 0.1,
|
||||||
"power_factor": 0.2,
|
"power_factor": 0.11,
|
||||||
"linkquality": 116,
|
"linkquality": 116,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
"state": "ON",
|
"state": "ON",
|
||||||
"current": 0.02,
|
"current": 0.02,
|
||||||
"ac_frequency": 60,
|
"ac_frequency": 60,
|
||||||
"power": 0.4,
|
"power": 0.3,
|
||||||
"power_factor": 0.14,
|
"power_factor": 0.14,
|
||||||
"update": {
|
"update": {
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
|
|||||||
Reference in new issue
Block a user