Skip to content
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

Wave 2 "Temperature set in current mode" entity has the wrong Unit of Measure when the device is set to Fahrenheit #182

Open
ThomasBeavers opened this issue Dec 29, 2024 · 3 comments

Comments

@ThomasBeavers
Copy link

ThomasBeavers commented Dec 29, 2024

Describe the bug
When the Wave 2 is set to Fahrenheit the "Temperature set in current mode" entity is still being set to Celsius in the unit_of_measure property of the discovery object sent to HA. The property is also known as setTemp and number.{serial}_pd_temperature_set_in_current_mode.

To Reproduce
Steps to reproduce the behavior:

  1. Set the Wave 2 to Fahrenheit
  2. Restart the ecoflow-mqtt instance
  3. Check the config data in the HA MQTT at "homeassistant/number/{serial}_pd/setTemp/config"
  4. See that the "unit_of_measurement" == "°C" also that the min and max values are set for Celsius as well.
  5. Additionally the temperature will be converted from a value that is Fahrenheit into Celsius resulting in displaying an incorrect value.

Expected behavior
The unit_of_measurement property needs to change with the value of switch.{serial}_pd_unit_of_temperature ? F : C

Screenshots & Logfiles
The discovery object currently being sent.

{"has_entity_name":true,"unique_id":"{serial}_pd_setTemp","state_topic":"iob_ef/{serial}_pd/setTemp","device":{"identifiers":"{serial}_pd","name":"{serial}_pd","manufacturer":"Ecoflow","model":"WAVE 2 Air Conditioner","via_device":"{serial}_status"},"availability_topic":"iob_ef/{serial}/info/status","payload_available":"online","payload_not_available":"offline","origin":{"name":"iobroker.ecoflow-mqtt","sw_version":"1.0.5"},"name":"Temperature set in current mode","unit_of_measurement":"°C","device_class":"temperature","min":16,"max":30,"step":1,"command_topic":"iob_ef/{serial}/set/pd/setTemp"}

Incorrect value being displayed.
image

Correct value as being displayed in "Set temperature in degrees Fahrenheit" (sensor.{serial}_pd_set_temperature_in_degrees_fahrenheit)
image

Versions:

  • Adapter version: v1.0.5
  • JS-Controller version: 6.0.11
  • Node version: v20.18.1
  • Operating system: Ubuntu 24.04.1 LTS

Additional context
The property is being set for the discovery object here:

if (value.unit_of_measurement) discovery_message['unit_of_measurement'] = value.unit_of_measurement;

Sadly I don't see an easy way to make it dynamic based on the switch.{serial}_pd_unit_of_temperature property.

If I manually push the correct unit to HA's MQTT setTemp/config it will display correctly in HA.

@foxthefox
Copy link
Owner

I anticipated such an issue, since I only made it with °C.

The adapter creates the states before of the first communication, based on the configuration.
I agree, that a dynamic change of the properties will difficult.
Maybe the only way would be a data field in the config °C/°F to preset it.

@ThomasBeavers
Copy link
Author

The data field seems like a reasonable compromise to me. I doubt many people switch the temperature display units often.

@ThomasBeavers
Copy link
Author

I just had a thought a quick and dirty way would be to have two Wave 2 devices to select, one for each of the temperature units.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants