esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
404 stars 26 forks source link

Automation between nodes #52

Open FrengerH opened 5 years ago

FrengerH commented 5 years ago

Is your feature request related to a problem/use-case? Please describe.

I have two EspHome nodes. One node is a wifi light bulb configured to control the light. The other node is behind my wall switch and configured as input boolean/switch to control the light using an automation in homeassistant.
The problem is: when for some reason homeassistant is not running/responding, I can't switch the light anymore.
When the light and the switch were configured on one EspHome node I could have used an automation in EspHome to still be able to control the light.

Describe the solution you'd like:

I would love to have the possibility to create an automation in EspHome between different nodes.

Additional context:

Example:

Node1 (light):

esphomeyaml:
  name: example_light

light:
  - platform: cwww
    id: main_light
    name: "Main light"
    cold_white: output_cold
    warm_white: output_warm
    cold_white_color_temperature: 153 mireds
    warm_white_color_temperature: 500 mireds

output:
  - platform: esp8266_pwm
    pin: GPIO4
    frequency: 1000 Hz
    id: output_cold

  - platform: esp8266_pwm
    pin: GPIO5
    frequency: 1000 Hz
    id: output_warm

Node2 (switch):

esphomeyaml:
  name: example_switch

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO5
    name: "Light button"
    on_state:
      - light.toggle: example_light.main_light
RoganDawes commented 10 months ago

I suspect I have missed a detail, in that the PeerMessage would need to have a field for the NOISE protocol handshake message, since those don't seem to be defined in the protobuf API. But that should not be too tricky to figure out.

nagyrobi commented 3 weeks ago

Tadaaaaam: https://github.com/esphome/esphome/pull/6865

"Works On Everything" (TM).

nagyrobi commented 3 weeks ago

See https://esphome.io/cookbook/http_request_sensor.html showing how to retrieve sensor data directly from one node to another. Similarly could build up automating POST requests to toggle switches like above.

When the component linked above will be merged, this cookbook entry will be removed.