Hi guys. I am trying to make a controller for air compressor. It will consist of two parts: one device with pushbutton and it will send http command to another device which has pressure sensor on A0 and binary output on GPIO2. I have pasted a current code here, which monitors air pressure. But i don’t know how to make so when i send command “turn on”, it would read sensor and command GPIO2 accordingly. And when i send command “turn off”, it would still monitor pressure, but keep GPIO2 off. Any help much appreciated, thank you.
output:
- platform: gpio
pin: GPIO2
id: led_1
light:
- platform: binary
name: "pressure"
id: light_1
output: led_1
- platform: adc
pin: A0
filters:
- multiply: 3.3
update_interval: 10s
id: pressure
on_value_range:
- below: 2.55
then:
- light.turn_on: light_1
- above: 3.26
then:
- light.turn_off: light_1