Hi,
Trying to set up a unl2003 stepper and a d1 mini with Esphome. However I keep receiving an error when attempting to use the automation.
The Error:
2019-10-11 14:07:09 INFO (MainThread) [homeassistant.components.automation] Executing Write Stepper Value to ESP
2019-10-11 14:07:09 INFO (MainThread) [homeassistant.helpers.script] Script Write Stepper Value to ESP: Running script
2019-10-11 14:07:09 INFO (MainThread) [homeassistant.helpers.script] Script Write Stepper Value to ESP: Executing step call service
2019-10-11 14:07:09 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.write_stepper_value_to_esp. Service not found for call_service at pos 1: Unable to find service esphome/stepper_test_control_stepper
Iāve been through all the threadās (I believe) referring to using a stepper with Esphome. however Iām hitting this hurdle and could use a hand in spotting my error please.
My configās:
Automatons.yaml:
- id: stepper_test_1
alias: Write Stepper Value to ESP
trigger:
platform: state
entity_id: input_number.stepper_control
action:
# Replace esphome."*"_control_stepper with the name you gave the ESP
- service: esphome.stepper_test_control_stepper
data_template:
target: '{{ trigger.to_state.state | int }}'
My input_number.yaml:
#stepper test control
stepper_control:
name: Stepper Control
initial: 0
min: -1000
max: 1000
step: 1
mode: slider
My Esphome stepper_test.yaml:
esphome:
name: stepper_test
platform: ESP8266
board: d1_mini_lite
wifi:
ssid: "[redacted]"
password: "[redacted]"
# Enable logging
logger:
# Enable Home Assistant API
api:
services:
- service: control_stepper
variables:
target: int
then:
- stepper.set_target:
id: my_stepper
target: !lambda 'return target;'
ota:
password: "[redacted]"
#commented out, read https://github.com/esphome/issues/issues/683
#web_server:
# port: 80
stepper:
- platform: uln2003
id: my_stepper
pin_a: D0
pin_b: D1
pin_c: D2
pin_d: D3
max_speed: 250 steps/s
step_mode: FULL_STEP #HALF_STEP,WAVE_DRIVE
sleep_when_done: true
# Optional:
acceleration: inf
deceleration: inf
Esphome log of device:
INFO Reading configuration...
INFO Starting log output from stepper_test.local using esphome API
INFO Connecting to stepper_test.local:6053 (192.168.0.55)
INFO Successfully connected to stepper_test.local
[14:41:38][I][app:096]: esphome version 1.13.6 compiled on Oct 11 2019, 02:42:28
[14:41:38][C][wifi:372]: WiFi:
[14:41:38][C][wifi:254]: SSID: [redacted]
[14:41:38][C][wifi:255]: IP Address: 192.168.0.55
[14:41:38][C][wifi:257]: BSSID: [redacted]
[14:41:38][C][wifi:258]: Hostname: 'stepper_test'
[14:41:38][C][wifi:262]: Signal strength: -57 dB āāāā
[14:41:38][C][wifi:263]: Channel: 6
[14:41:38][C][wifi:264]: Subnet: 255.255.255.0
[14:41:38][C][wifi:265]: Gateway: 192.168.0.1
[14:41:38][C][wifi:266]: DNS1: 192.168.0.1
[14:41:38][C][wifi:267]: DNS2: 0.0.0.0
[14:41:38][C][uln2003.stepper:039]: ULN2003:
[14:41:38][C][uln2003.stepper:040]: Pin A: GPIO16 (Mode: OUTPUT)
[14:41:38][C][uln2003.stepper:041]: Pin B: GPIO5 (Mode: OUTPUT)
[14:41:38][C][uln2003.stepper:042]: Pin C: GPIO4 (Mode: OUTPUT)
[14:41:38][C][uln2003.stepper:043]: Pin D: GPIO0 (Mode: OUTPUT)
[14:41:38][C][uln2003.stepper:044]: Sleep when done: YES
[14:41:38][C][uln2003.stepper:057]: Step Mode: FULL STEP
[14:41:38][C][logger:137]: Logger:
[14:41:38][C][logger:138]: Level: DEBUG
[14:41:38][C][logger:139]: Log Baud Rate: 115200
[14:41:38][C][logger:140]: Hardware UART: UART0
[14:41:38][C][web_server:125]: Web Server:
[14:41:38][C][web_server:126]: Address: stepper_test.local:80
[14:41:38][C][ota:029]: Over-The-Air Updates:
[14:41:38][C][ota:030]: Address: stepper_test.local:8266
[14:41:38][C][ota:032]: Using Password.
[14:41:38][C][api:103]: API Server:
[14:41:38][C][api:104]: Address: stepper_test.local:6053
I can log on to the web server of the device at ether āhttp://stepper_test/ā or āhttp://192.168.0.55/ā. However Iām not sure why in the logs it seems to be looking for the device at āstepper_test.localā?
Hope someone can spot where Iām falling short.
Thanks.