Open bunjg opened 1 week ago
I started typing this up a couple days ago and now see that issue #121 is similar to mine. I'll try adding "id" to my sensor code and update the logger info, then report back.
Another oddity, I had to completely wipe the esp32 in order to get it working again. Just removing the sensor automation and re-installing didn't resolve HA reporting 0 C current temperature. I'm new to esp32, but that didn't make sense to me.
Might be a longshot, but are you sure your automation isn't sending the wrong datatype, like a string? I've always had an input variable on the temperature update service that converts the value to float before sending it to the heatpump. You might be able to check your automation traces to see what is being sent to the service as well.
services:
- service: set_remote_temperature
variables:
temperature: float
then:
- lambda: 'id(hp).set_remote_temperature(temperature);'
- service: use_internal_temperature
then:
- lambda: 'id(hp).set_remote_temperature(0);'
Still no luck. I used a ESP8266 unit this time and I can see in the logs that 0 C was stated as the current temperature, but it never re-connected with Home Assistant. I had to wipe it clean and start with a new build without the external temperature code.
substitutions:
name: esphome-web-5284e0
friendly_name: Leah Heat Pump
esphome:
name: ${name}
friendly_name: ${friendly_name}
name_add_mac_suffix: false
project:
name: esphome.web
version: '1.0'
esp8266:
board: esp01_1m
uart:
id: HP_UART
baud_rate: 2400
tx_pin: 1
rx_pin: 3
# Enable logging
logger:
hardware_uart: UART1
level: DEBUG
logs:
EVT_SETS : DEBUG
WIFI : INFO
MQTT: INFO
WRITE_SETTINGS: INFO
SETTINGS: DEBUG
STATUS: INFO
CN105Climate: WARN
CN105: INFO
climate: WARN
sensor: WARN
chkSum: INFO
WRITE : WARN
READ : WARN
ACK : DEBUG
Header: INFO
Decoder : DEBUG
CONTROL WANTED_SETTINGS: INFO
UPDT ITVL: DEBUG
CYCLE: DEBUG
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
#Pull room temperature from Home Assistant
sensor:
- platform: homeassistant
name: "Temperature Sensor From Home Assistant"
id: current_temp
internal: true
entity_id: sensor.esphome_web_f6207c_leah_room_temperature
on_value:
then:
- lambda: 'id(hp).set_remote_temperature((x);'
filters:
- heartbeat: 10s
# Allow provisioning Wi-Fi via serial
#improv_serial:
wifi:
# Set up a wifi access point
ap: {}
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:
dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
import_full_config: true
# To have a "next url" for improv serial
web_server:
external_components:
- source: github://bunjg/MitsubishiCN105ESPHome
climate:
- platform: cn105
id: hp
name: "Leah Heat Pump"
icon: mdi:heat-pump
internal: true
visual:
min_temperature: 15
max_temperature: 31
temperature_step:
target_temperature: 1
current_temperature: 0.1
I noticed in the logs that the external temperature was coming in as Fahrenheit, so I tried to convert it in the lambda line:
- lambda: 'id(hp).set_remote_temperature((x - 32.0) * (5.0 / 9.0))
Still no success, but I can see that the conversion worked correctly.
I've tried to add remote temperature using the sensor automation and the api service and both result in setting my heat pump current temperature to 0 C/32 F. I could call the api service, but it would revert back to 0 C seconds later. Heat pump works correctly, in auto mode the cooling will turn on below the actual room temperature. I rolled back to the code without the remote temperature code and it works (with internal temperature) normally now.
YAML
I've tried the same sensor automation code on a esp8266 unit with the same results. Any thoughts on how to resolve?