Hello,
i try to set the fan-speed .
i try a function but the payload what i send is wrong.
i get the error (in Node-Red)
“Call-service error. Service not found.”
when I go to the debug mode of the web interface, I see that speed_level is sent there when I increase the power of the fan.
Is there something wrong with my names in the function code?
Node-Red function Code
if (msg.payload["sensor.temperatur_an_kronendach"] < (msg.payload["input_number.temperatur_min_max"] - msg.payload["input_number.temperatur_toleranz"])){
msg.payload = {
"service": "on",
data:
{ "speed": "50" }
}
return [msg,msg];
}
else if (msg.payload["sensor.temperatur_an_kronendach"] > (msg.payload["input_number.temperatur_min_max"] + msg.payload["input_number.temperatur_toleranz"])) {
msg.payload = {
"service": "on",
data:
{ "speed": "50" }
}
return [msg, msg];
}
ESPhome Code
substitutions:
devicename: "air-con-service-esp8266"
upper_devicename: AirController_ESP8266_D1Mini
device_location: Kueche
device_description: Anzuchtbox Steuerung platform using ESPhome firmware
ipaddress: 192.168.2.110
esp_board: d1_mini
last_update: "2023-05-06 22:54:12"
esphome:
name: $devicename
friendly_name: AirController_ESP8266_D1Min
platform: ESP8266
board: d1_mini
web_server:
port: 80
auth:
username: admin
password: admin
api: # Enable Home Assistant API
encryption:
key: !secret ESPHOME_API_KEY
#mqtt:
# broker: !secret mqtt_broker
# username: !secret mqtt_username
# password: !secret mqtt_password
# topic_prefix: AnzuchtBox
# id: mqtt_client
wifi:
power_save_mode: none # none (default for esp8266), light (default for esp32), high
ssid: !secret WLAN_ASUS_SSID
password: !secret WLAN_ASUS_PASSWORD
manual_ip:
static_ip: !secret D1MINI-TESTESP8266_IP
gateway: !secret WLAN_ASUS_GATEWAY_IP
subnet: !secret WLAN_ASUS_SUBNET
dns1: !secret WLAN_ASUS_DNS1
#fast_connect: on
ap: # Enable fallback hotspot (captive portal) in case wifi connection fails
ssid: "Anzuchtbox Fallback Hotspot"
password: !secret WIFI_AP_PASSWORD
ota:
safe_mode: true
password: !secret HA_OTA_PASSWORD
output:
- platform: esp8266_pwm
pin: GPIO16
inverted: True # 0
frequency: 1000 Hz
#channel: 0
id: fan_output
# Example usage in a light
fan:
- platform: speed
output: fan_output
name: "LTI FAN"
speed_count: 100
# name: ${friendly_name} Override Enable
id: fan_controll_speed # rack_fan_toggle
on_turn_on:
- output.set_level:
id: fan_output
level: 100% # !lambda |-
# return id(fan_speed_override).state/100.0;
# speed: 100%
# Enable logging
logger:
Best reagrds
Achim