I thought 0xC4 is for the Extended Query and has different data in its payload. I realize I’m stepping in mid conversation so I don’t have all the history/context for your dev work.
I’ve just spent quite a bit of time integrating the two cmds into my Senville XYE Node-Red parser and I’ve been unsuccessful with 0xC4, the payload seems to mostly be static data, I’ve been parsing it based on @Oscar_Calvo’s repo.
In my setup, I’m using Fahrenheit even with 0xC0 but as soon as I issue a 0xC4 query something changes and the setpoint in 0xC0 changes to Celsius. The other reported T temps also increase slightly but I can’t figure out why or how to decode them to match the pre-0xC4 temps. After a power cycle on the indoor air handler (it’s a ducted central air unit) the 0xC0 temps return back to their proper Fahrenheit values.
The difference being that from my initial tests, 0xC0 always returns in C.
If retrieving the set temperature from 0xC4, if you have set it in Fahrenheit (using the offset), it will return it in such. If I remember correctly, 0xC0 does not respect this behavior and is always in C. This is fine for HA which works in C internally anyway…but makes a difference with the unit’s algorithm when working in F.
Oh, nice. Sorry, I missed those changes! I did forget why you had a T1 sensor broken out though, but the rest of it all looks good…I’ll try and pull your patches in.
Does your unit support F or just C? Do you get any funky reading in either mode?
Does anyone have a suggestion of a branch to start experimenting with for a Midea MDV-V230WN1(AU)?
I developed a sytem for controlling the Evap via ESPHome and RS485 so I can do some testing & improvements as necessary. Just need to order some more hardware first.
Not sure about that unit specifically. That looks to be much more advanced than what I have.
That said, I’m going to start publishing tags.
I recommend people change to one of the tags listed below:
** BUG FIXES and NEW TAGS **
mdrobnak-0.1.1 - Legacy stable - Use only if you haven’t updated ESPHome mdrobnak-0.2.1 - Stable code updated for newer ESPHome versions. No AI-assisted code here. mdrobnak-0.3.0 - This has a few new options (defrost state, Fahrenheit switch in the UI, and current actual fan speed). This is the current working units_switch branch. Most people should run this. Use the YAML from Midea A/C via local XYE - #160 by mdrobnak.
(Replace units_switch in - source: github://mdrobnak/esphome@units_switch with mdrobnak-X.Y.Z)
I am pulling some commits from @rymo including some binary sensors to start…I need to understand the context of some of the others first before pulling more. Maybe I’ll have Cursor look over my code
My current dev branch will be units_switch, so follow that if you’d like an adventure at home.
I’ve reverted the outdoor fan / compressor state sensors - they do not work for my AHU. I need to do some more logging again. Currently running mdrobnak-0.2.1.
Edit: Ran Cusror. Found these issues:
-^-^-^-
1. State machine recovery on bad response
On incorrect message length, controlState is now set to STATE_SEND_C0 so the state machine can recover on the next poll.
2. Action OFF vs IDLE when mode is OFF
When mode is OFF, action is set to CLIMATE_ACTION_OFF instead of CLIMATE_ACTION_IDLE.
When mode is updated to OFF, action is set to OFF in the same block.
The else if branch for mode OFF now sets CLIMATE_ACTION_OFF instead of CLIMATE_ACTION_IDLE.
3. C4 response publish_state
Added if (need_publish) this->publish_state(); before ForceReadNextCycle = 0 in the C4 handler so target temperature changes are published.
4. Action for COOL, DRY, FAN_ONLY
Using the same RXData[9] & 0x0F logic as HEAT:
COOL → CLIMATE_ACTION_COOLING when active
DRY → CLIMATE_ACTION_DRYING when active
FAN_ONLY → CLIMATE_ACTION_FAN when active
5. Use this->mode in C4 case
Replaced mode with this->mode in the C4 condition for clarity.
6. Defensive check for empty supported_modes_
Added a check before dereferencing supported_modes_.begin(). If it is empty, last_on_mode_ is set to CLIMATE_MODE_COOL as a fallback.
queuedCommand holds only one value. If control() or setPowerState() queues C3, and then do_follow_me() or set_static_pressure() queues C6 before the first completes, the earlier command is overwritten. The last queued command wins. This is a design limitation rather than a bug, but rapid successive controls can cause commands to be dropped.
No new linter issues were reported. The single-slot command queue (item 7) was left as a design limitation and not changed.
-^-^-^-
Item #4 Is kind of a hack, as was the original implementation. Assuming if fan running = doing the thing. This is not true if you allow cold air using the dip switch…
Hopefully the Midea MDV-V230WN1(AU) is close enough to your unit that I can work from that. Its so much quicker to work from a good base than to start from scratch.
As noted by @rymo and Cursor, my queue design has flaws lol. Fix for the temperature not setting on the first go was fixed for delays / delays_updated branches. Going back to the dev stuff to see how to get this working sanely.
Can you give any pointers,for a newbie to this setup.
I have your ‘units_switch’ branch working,all appears to be correct other than the ‘current’ setting. It is always showing 255 a
Also,made some mods with ChatGPT and have the defrost binary sensor working as well.
Thank you, for your efforts.
I might rip out the PV stuff anyway as I’ve now got a battery, so my new goal isn’t as simple as tracking PV exports.
I tried using EMHASS with a thermal model for each zone, but for me the solar heat gain is equally significant as the difference between inside and outside ambient temperature so I’ve put that back on the shelf for now.
My system is fully kitted out for BTU/h, power and COP telemetry, with temperature probes on both the return and supply plenum, and CT clamp measuring ODU power.
One interesting finding I stumbled on was that T2A (inside coil inlet temp) tracks the actual supply temperature surprisingly well on my system.
If that’s the case on other systems as well, one could easily add an estimated BTU/h sensor to any one of these Midea-xye branches, where return temp could be approximated as T0, and supply temp is T2A. As for CFM, this will change based on user’s AHU size, but that’s all published in submittal sheets, and fan speeds map to known CFM values. If anyone is interested, I might do a PR to @mdrobnak 's repo
Anyone know what protocol is the “TestPort” that is in Midea outdoor units? The Dr Smart tool connects to it labeling it as a “5V interface” and get’s a lot of diagnostic info, and I wonder if it’s also XYE or something else.