Hallo Leute,
ich bin neu hier und hoffe, dass Ihr mir helfen könnt. Ich habe vor ein Servo über esphome und HA ans Laufen zu bekommen. Ich hab dafür die Anleitung von siytek verwendet. Leider funktioniert das so aber nicht. Das Servo bewegt sich nicht…
Hat wer eine Idee, wie ich an das Thema rangehe, um zu prüfen, woran es liegt?
Ich habe folgenden code am esp-home:
esphome:
name: esphome-web-f855a8
friendly_name: ESPHomeAusheizer4
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "nO0stD3hQooFotpnR8XoCdnRG2ng1xxxxxxxxxxxx"
services:
- service: control_servo
variables:
level: float
then:
- servo.write:
id: my_servo
level: !lambda 'return level / 100.0;'
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-F855A8"
password: "xxxxx"
captive_portal:
dallas:
- pin: GPIO19
sensor:
- platform: dallas
address: 0xa30417c1f2xxxxx
name: "TemperaturVL"
- platform: dht
pin: GPIO21
temperature:
name: "Umgebungstemperature"
humidity:
name: "Umgebungsfeuchte"
model: AM2302
update_interval: 60s
servo:
- id: my_servo
output: pwm_output
# Example output platform
# On ESP32, use ledc output
output:
- platform: ledc
id: pwm_output
pin: GPIO18
frequency: 50 Hz'
in der configuration.yaml am HA:
'# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
input_number:
servo_control:
name: Servo Control
initial: 0
min: -100
max: 100
step: 1
mode: slider'
und in der automations.yaml:
'automation:
- alias: Write Servo Value to ESP
trigger:
platform: state
entity_id: input_number.servo_control
action:
- service: esphome.little_wemos_control_servo
data_template:
level: '{{ trigger.to_state.state | int }}''
Danke schon mal für Euren input!
danke
Karl
by HarryP: Codezeilen formatiert (bitte in </> einbinden)