I have made a test automation to try sending and receiving ints to and from a script. I use a helper to trigger an automation that call the script.
alias: Test
description: A test automation written in the horrible YAML
triggers:
- trigger: numeric_state
entity_id:
- input_number.test
above: 1
conditions: []
actions:
- variables:
test_send: "{{ states('input_number.test') | int }}"
- action: script.value_plus_five
metadata: {}
data:
value: test_send
response_variable: result
- variables:
test_return: "{{ result.value }}"
- if:
- condition: template
value_template: "{{ test_result > 3 }}"
then:
- action: fan.toggle
metadata: {}
target:
entity_id: fan.office_fan
data: {}
mode: single
alias: Value_plus_five
description: more horrible YAML
sequence:
- variables:
value_plus_five: "{{ input_int + 5 }}"
return_dict: "{{ {'value': value_plus_five} }}"
- stop: returning value + 5
response_variable: return_dict
fields:
input_int:
selector:
number:
min: 1
max: 100
required: true
I work with C, C++, Object C, Java and even some Python, ... . I find markup languages like programing languages with all of the good stuff removed and replaced with bad syntax. I have tried IA but none of the returned examples work as you can see from above, meaning the web does not contain accurate information on YAML. The YouTube videos do not use ints, just strings and many of those examples do not work also. Is YAML syntax changing weekly? The hardest part is the "single quotes, double quotes, {, {{, (, : ...". It seems almost random to me. I would like to pass variables to and from scripts (I use as subroutines) with out making a helper (global), which is how I do it now. Wow would I like a terminal, a print statement and a syntax checker. The syntax checker is now: I save, exit, and open again, things just change with out warning (ex: [object:object]: null). Tried developer tool documentation but the made YAML documentation look good.
I like Home Assistant but wish there was a "C" or Unix like version. fi is looking better every day.
History of "C", it was the third try, "A" and "B" did not work. Seems YAML has an A in it. Can't wait for YCML.
Sorry about all of the complaining, but this is taking me longer than adding on the fly bit width changes to the jpeg-6b library (call jpeg-6c).