New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native ESPHome API service call feature #19401

merged 2 commits into from Dec 17, 2018


None yet
4 participants
Copy link

OttoWinter commented Dec 17, 2018


One of the features that ESPHome will finally be able to solve with the native API is the problem of inter-device automations. Up until now, if the user wanted an automation that interacts with anything else the user would have to use HA automations for this.

With this change, users can add something like this to their ESPHome automations:

- platform: gpio
  pin: D1
  # On-device automation
  - switch.turn_on: my_switch
  - delay: 1s
  # HA service call
  - homeassistant.service:
      service: notify.html5
        title: Button was pressed
        message: The humidity is {{ my_variable }}%.
        my_variable: 'return id(my_sensor).state;'


  • This calls services directly using I've seen the Context class used in several places in the HA codebase. Should this integration also use Contexts? If so, how should that be done? CC @balloob


  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

This comment has been minimized.

Copy link

balloob commented Dec 17, 2018

OttoWinter added some commits Dec 17, 2018

@OttoWinter OttoWinter force-pushed the OttoWinter:esphome-service-call branch from 01a8df6 to 62106b4 Dec 17, 2018

@OttoWinter OttoWinter merged commit 4ffacec into home-assistant:dev Dec 17, 2018

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Hound 5 violations found.
WIP ready for review
cla-bot Everyone involved has signed the CLA

@OttoWinter OttoWinter deleted the OttoWinter:esphome-service-call branch Dec 17, 2018

dshokouhi added a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018

Add native ESPHome API service call feature (home-assistant#19401)
* Add native ESPHome API service call feature

* 🚑 Fix

@balloob balloob referenced this pull request Jan 10, 2019


0.85.0 #19897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment