Forgive me… I’m a network guy that dabbles in programming… so I’m probably doing something really stupid. My code is failing when I check the conditions.
Your code is looking good.
But you have issues with some colons and indentation.
I have no computer near me to assist you more formatting your code.
Pay attention in docs how things are indented. Both sensor.in range should be at the same level. Also sensor.in range are the same level so each one needs a - before
And sensor.in range needs a : at the end.
Again look carefully at docs a space or symbol missing and it would not work.
I fixed the spacing… Looks like I had a few tabs in there as well. I had to use Notepad++ to view the tabs, then removed. I believe this fixed the spacing. I will look at the documentation further, in the meantime…
Now getting this:
duplicate key: “-sensor.in_range”
in “/config/esphome/shop_upstairs_dehumidifier.yaml”, line 67, column 0
Ok. Hopefully one more issue… I think I’m causing the compiler to crash.
Error:
INFO Reading configuration...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 11, in <module>
load_entry_point('esphome', 'console_scripts', 'esphome')()
File "/opt/esphome/esphome/__main__.py", line 483, in main
return run_esphome(sys.argv)
File "/opt/esphome/esphome/__main__.py", line 466, in run_esphome
config = read_config(args.verbose)
File "/opt/esphome/esphome/config.py", line 803, in read_config
res = load_config()
File "/opt/esphome/esphome/config.py", line 663, in load_config
return _load_config()
File "/opt/esphome/esphome/config.py", line 651, in _load_config
result = validate_config(config)
File "/opt/esphome/esphome/config.py", line 440, in validate_config
component = get_component(domain)
File "/opt/esphome/esphome/config.py", line 171, in get_component
assert '.' not in domain
AssertionError
On_… means you have to change the … by some trigger like on press button or something else. On_interval seems to work when you’re not sure which events to use.
That was my fear. I was trying to find what my options were, and wasn’t able to find any examples.
I changed to to “on_interval:” and now I get another error.
I’ve tried other variations with the same result. Hope this is something stupid at this point.
Does anyone have an example of a completed project using and / or conditions? I think I was able to see something that works, I’d be able to see what’s wrong. I’m almost positive it due to my spacing.
I have look at the documentation, however it’s hard to understand when there’s snippets of code in th example with no reference of where it needs to be in the project.
I agree. Snippets are fine if you already know YAML and where to put them.
Also, when someone solves a problem, posting the solution would help others who follow with a similar problem.