DomiStyle / esphome-panasonic-ac

Open source alternative for Panasonic air condition wifi adapters that works locally without the Comfort Cloud
MIT License
254 stars 63 forks source link

Support for Panasonic CZ-TACG1 wifi adaptor #1

Closed stibbzy closed 3 years ago

stibbzy commented 4 years ago

Hi there. Is there any chance that the Panasonic CZ-TACG1 wifi adaptor could be supported with this? It'd be great to be able to get it out of the cloud!

DomiStyle commented 4 years ago

@stibbzy Unfortunately I don't have a CZ-TACG1 to test with.

From my tests I couldn't get the AC to respond on the CN-CNT connector but that could also very well be because it gets disabled if CN-WLAN is used.

If someone can take a look if the protocol is the same between both modules I'm sure it could work.

stibbzy commented 3 years ago

Hi me again. I found someone who has done some work decoding the protocol from the CN-CNT connector. You can see their work here: https://github.com/hotswapster/panasonic-aircon-wifi/blob/master/decoding.md

Does this look the same as the data coming directly from the CN-WLAN? Cheers!

DomiStyle commented 3 years ago

@stibbzy The protocol that's used in that project looks different, you can find all the protocol decoding and raw captures I have done here:

https://github.com/DomiStyle/esphome-panasonic-ac/tree/master/protocol

DomiStyle commented 3 years ago

@stibbzy Did you ever open up your unit and check if your device has the CN-WLAN connector?

There should be nothing stopping you from disconnecting the wifi adapter on CN-CNT and connecting an ESP to the CN-WLAN connector if there is one on the mainboard, you will have to lay some cables to the outside of course.

It should be on the smaller sub board for the indoor unit: Screenshot from 2021-06-20 01-31-32

stibbzy commented 3 years ago

Hi @DomiStyle No, I haven't had a chance to open it, but willing to try. Does it involve taking apart the AC, or can I see it when just opening the cover? I'll try to have a look this arvo!

DomiStyle commented 3 years ago

Which model do you have exactly? I have the service manual for the these indoor units (European/Turkish version):

CS-Z20VKEW
CS-Z25VKEW
CS-Z35VKEW
CS-Z42VKEW
CS-Z50VKEW
CS-Z71VKEW
CS-XZ20VKEW
CS-XZ25VKEW
CS-XZ35VKEW
CS-XZ50VKEW

If you have a different one you might check in the service manual if that connector is there before disassembling your unit.

There's a disassembly video here: https://www.youtube.com/watch?v=TfQ_1lMjxu8

The sub board hopefully should be inside of the same metal cage on top like the main board is, it's connected via 3 connectors (CN-DATA1, CN-DATA2, CN-DATA3). I do think only the more modern units have them though.

Screenshot_20210620-092215_Xodo_Docs

The main PCB should look like this:

Screenshot_20210620-093233_Xodo_Docs

stibbzy commented 3 years ago

@DomiStyle Looks like I am out of luck. My model is a CS/CU-Z35VKR, and I can see the wiring diagram on the chassis when I open the dust cover. It looks almost identical to the wiring and electrical diagrams I've attached here. No CNT-WLAN connector unfortunately :(

IMG_1955 IMG_1954

DomiStyle commented 3 years ago

Well that's unfortunate but it was worth a try.

I don't have time to take on a new project right now but I will see if I can get my hands on a CZ-TACG1 soon. The protocol looks a lot simpler than the one DNSK-P11 uses, so it might not be that hard to integrate.

stibbzy commented 3 years ago

Thanks anyway @DomiStyle Your efforts are appreciated! If there is anything else I can do, just let me know :)

crispie commented 3 years ago

I do have a CZ-TACG1 connected to my CS-Z25UFEAW. Does this esphome solution replace the CZ-TACG1, meaning the ESP board will be connected to the same port the CZ-TACG1 is currently using?

DomiStyle commented 3 years ago

@AndreKuester This project does not support the protocol the CZ-TACG1 uses (yet). Only the DNSK-P11 is supported for now.

However, I ordered a CZ-TACG1 today so maybe I can get it working as well.

DomiStyle commented 3 years ago

I got my CZ-TACG1 today and did some digging and I can confirm that it matches the protocol info posted here. Assuming nothing goes wrong it shouldn't be that hard to implement.

I can't get my timer LED to stop blinking but that might just be because it's looking for the other wifi adapter. Commands are working fine.

It also seems like Comfort Cloud hasn't gotten any faster over the last year.

crispie commented 3 years ago

That’s great to hear. This means your solution could work for me as well. Just one question - does this work in combination with the CZ-TACG1 by soldering it to some point on the AC board or would I unplug the CZ-TACG1 and plug-in the ESP board to the existing connectors?

DomiStyle commented 3 years ago

@AndreKuester You can just unplug your CZ-TACG1 and plug in an ESP with logic converter. If you do not want to break any of the original connectors there's a list of connectors here.

stibbzy commented 3 years ago

@AndreKuester @DomiStyle This is fantastic news! So now, I should be good to go with following the instructions and possibly obtaining a different connector. Thanks so much for the effort here!

DomiStyle commented 3 years ago

Initial support for the CZ-TACG1 is available in this dev branch: https://github.com/DomiStyle/esphome-panasonic-ac/tree/dev-cztacg1

No instructions available yet, pinout for the CN-CNT connector (top to bottom):

1: +5V 2: TX 3: RX 4: +12V (do not connect) 5: GND

Needs a logic converter just like the other wifi unit (3.3V to 5V).

Working:

Not working yet:

edit: Connectors can be bought online so it can be installed nondestructive: https://github.com/Egyras/HeishaMon#where-to-get-connectors

flybrys commented 3 years ago

Thanks @DomiStyle I've just tested this and confirmed working. I LOVE how instant this now is. NOTE: Saying the pinout from top to bottom could fry someone's board, because my connector on my unit is upside down. Maybe better to say from lock tab facing up, left to right. Which will be 5v, RX, TX, 12v(nc), GND

Powerful mode seems to work for me (shows up as boost). My unit doesn't have horizontal swing or nanoex so perhaps detecting this and excluding it from the component would be handy.

Not directly related to this however for my unit (CS-RZ25WKRW), the Eco preset seems to control the Quiet mode. This is the same when using the comfort cloud integration from HACS. Setting it doesn't make the eco light come on, but the compressor winds down and the fan speed seems to mimic quiet mode. Using Eco in the Panasonic app turns the eco light on but not quiet mode.

I'm getting the following errors in the logs however it doesn't seem to cause any problems.

[10:00:39][W][esppac:438]: Received unknown vertical swing mode [10:00:39][W][esppac:484]: Received unknown mild dry value

Will continue testing while working from home today and post my findings

DomiStyle commented 3 years ago

NOTE: Saying the pinout from top to bottom could fry someone's board, because my connector on my unit is upside down. Maybe better to say from lock tab facing up, left to right. Which will be 5v, RX, TX, 12v(nc), GND

Good to know, will add a picture in the readme to make it more clear.

Powerful mode seems to work for me (shows up as boost). Not directly related to this however for my unit (CS-RZ25WKRW), the Eco preset seems to control the Quiet mode. However, the nanoex toggle (once implemented) will probably toggle your eco mode.

I currently mapped powerful to boost and quiet to eco. I didn't know there's a separate eco mode on older units.

My unit doesn't have horizontal swing or nanoex so perhaps detecting this and excluding it from the component would be handy.

Depending on what the AC sends I might be able to detect this.

Can you enable verbose logging and post the RX/TX debug lines when you see warnings like unknown vertical swing mode? Also, can you enable eco mode via IR/cloud and once again post the RX/TX debug lines when it's enabled and when it's disabled?

flybrys commented 3 years ago

I didn't know there's a separate eco mode on older units.

This unit was installed new about 3 months ago

This snippet is 2 polls with eco Enabled. Interestingly, the "Received unknown dry/mild state" warning disappeared after doing so.

` [17:11:52][V][esppac:268]: Polling AC

[17:11:52][V][esppac:259]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86 [17:11:52][V][esppac:259]: RX: 70 20 44 2A 80 A0 30 00 00 40 40 00 4C 2C 00 00 00 00 16 10 FF 17 10 FF 80 80 FF 80 C2 01 0B C1 38 14 15 [17:11:52][W][esppac:438]: Received unknown vertical swing mode [17:11:52][D][climate:369]: 'lounge_ac' - Sending state: [17:11:52][D][climate:372]: Mode: HEAT [17:11:52][D][climate:374]: Action: HEATING [17:11:52][D][climate:377]: Fan Mode: AUTO [17:11:52][D][climate:383]: Preset: NONE [17:11:52][D][climate:389]: Swing Mode: OFF [17:11:52][D][climate:392]: Current Temperature: 22.00°C [17:11:52][D][climate:398]: Target Temperature: 21.00°C [17:11:57][V][esppac:268]: Polling AC [17:11:57][V][esppac:259]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86 [17:11:57][V][esppac:259]: RX: 70 20 44 2A 80 A0 30 00 00 40 40 00 4C 2C 00 00 00 00 16 10 FF 17 10 FF 80 80 FF 80 EC 01 0C 80 85 71 81 [17:11:57][W][esppac:438]: Received unknown vertical swing mode [17:11:57][D][climate:369]: 'lounge_ac' - Sending state: [17:11:57][D][climate:372]: Mode: HEAT [17:11:57][D][climate:374]: Action: HEATING [17:11:57][D][climate:377]: Fan Mode: AUTO [17:11:57][D][climate:383]: Preset: NONE [17:11:57][D][climate:389]: Swing Mode: OFF [17:11:57][D][climate:392]: Current Temperature: 22.00°C [17:11:57][D][climate:398]: Target Temperature: 21.00°C `

DomiStyle commented 3 years ago

This unit was installed new about 3 months ago

And yours did not come with the newer wifi unit? Strange.

Can you do one more with eco off? The eco setting might be stored in the dry/mild state byte.

flybrys commented 3 years ago

And yours did not come with the newer wifi unit? Strange.

Don't know if it is country specific, but the CZ-TACG1 is the only wifi unit I can seem to find in Australia for panasonic units

Eco off:

` [17:19:33][V][esppac:268]: Polling AC

[17:19:33][V][esppac:259]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86 [17:19:33][V][esppac:259]: RX: 70 20 04 2E 80 40 F0 00 00 40 00 00 00 2E 00 00 00 00 17 10 FF 17 10 FF 80 80 FF 80 33 00 01 C0 00 00 61 [17:19:33][W][esppac:438]: Received unknown vertical swing mode [17:19:33][D][climate:369]: 'lounge_ac' - Sending state: [17:19:33][D][climate:372]: Mode: HEAT_COOL [17:19:33][D][climate:374]: Action: COOLING [17:19:33][D][climate:377]: Fan Mode: MEDIUM [17:19:33][D][climate:383]: Preset: NONE [17:19:33][D][climate:389]: Swing Mode: VERTICAL [17:19:33][D][climate:392]: Current Temperature: 23.00°C [17:19:33][D][climate:398]: Target Temperature: 23.00°C [17:19:38][V][esppac:268]: Polling AC [17:19:38][V][esppac:259]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86 [17:19:38][V][esppac:259]: RX: 70 20 04 2E 80 40 F0 00 00 40 00 00 00 2E 00 00 00 00 17 10 FF 17 10 FF 80 80 FF 80 33 00 01 C1 38 14 14 [17:19:38][W][esppac:438]: Received unknown vertical swing mode [17:19:38][D][climate:369]: 'lounge_ac' - Sending state: [17:19:38][D][climate:372]: Mode: HEAT_COOL [17:19:38][D][climate:374]: Action: COOLING [17:19:38][D][climate:377]: Fan Mode: MEDIUM [17:19:38][D][climate:383]: Preset: NONE [17:19:38][D][climate:389]: Swing Mode: VERTICAL [17:19:38][D][climate:392]: Current Temperature: 23.00°C [17:19:38][D][climate:398]: Target Temperature: 23.00°C `

The dry mild state error isn't coming back. I'm wondering if it is a residual incorrect setting from the previous integration from HACS

DomiStyle commented 3 years ago

Thanks, will check these out once I get time.

The dry mild state error isn't coming back. I'm wondering if it is a residual incorrect setting from the previous integration from HACS

The Panasonic AC protocols are very prone to setting incorrect byte values. My powerful/quiet mode is currently broken and can't be set anymore until I reboot the unit, for example. Not the first time something like this has happened during testing.

DomiStyle commented 3 years ago

@brywithawhy Can you enable eco mode together with powerful or quiet via the IR remote or is it a toggle?

flybrys commented 3 years ago

@brywithawhy Can you enable eco mode together with powerful or quiet via the IR remote or is it a toggle?

You can enable Eco/Powerfull with Quiet. One button toggles between eco/powerfull. Fan speed cycles through auto, 1, 2, 3, 4, 5, quiet.

Below is eco and quiet together:

[19:26:22][V][esppac:268]: Polling AC
[19:26:22][V][esppac:259]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[19:26:22][V][esppac:259]: RX: 70 20 04 2E 80 A0 F0 04 00 40 40 00 4C 30 00 00 00 00 14 0E FF 14 0E FF 80 80 FF 80 AC 00 06 C1 38 14 AE
[19:26:22][W][esppac:438]: Received unknown vertical swing mode
[19:26:22][D][climate:369]: 'lounge_ac' - Sending state:
[19:26:22][D][climate:372]:   Mode: HEAT_COOL
[19:26:22][D][climate:374]:   Action: HEATING
[19:26:22][D][climate:377]:   Fan Mode: AUTO
[19:26:22][D][climate:383]:   Preset: ECO
[19:26:22][D][climate:389]:   Swing Mode: VERTICAL
[19:26:22][D][climate:392]:   Current Temperature: 20.00°C
[19:26:22][D][climate:398]:   Target Temperature: 23.00°C
[19:26:27][V][esppac:268]: Polling AC
[19:26:27][V][esppac:259]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[19:26:27][V][esppac:259]: RX: 70 20 04 2E 80 A0 F0 04 00 40 40 00 4C 30 00 00 00 00 14 0E FF 14 0E FF 80 80 FF 80 AC 00 06 80 85 71 45
[19:26:27][W][esppac:438]: Received unknown vertical swing mode
[19:26:27][D][climate:369]: 'lounge_ac' - Sending state:
[19:26:27][D][climate:372]:   Mode: HEAT_COOL
[19:26:27][D][climate:374]:   Action: HEATING
[19:26:27][D][climate:377]:   Fan Mode: AUTO
[19:26:27][D][climate:383]:   Preset: ECO
[19:26:27][D][climate:389]:   Swing Mode: VERTICAL
[19:26:27][D][climate:392]:   Current Temperature: 20.00°C
[19:26:27][D][climate:398]:   Target Temperature: 23.00°C
DomiStyle commented 3 years ago

Eco mode, powerful/quiet should work now. Horizontal swing should show as unsupported now.

You can enable the new sensors and disable nanoeX as shown in the ac.yaml.example.

Only manual swing sensors are missing, the rest should work.

flybrys commented 3 years ago

Hmmm doesn't seem to work.

I thought Quiet should go under fan speeds rather than presets since you can't have high fan speed and quiet mode at the same time. The preset menu should have Powerfull or eco in the preset menu as you cycle between those options on the remote. Is this possible? There's also a mild dry switch now but I don't have any such feature on my air con. What is this for?

I can't get the eco light to come on the unit using any combination of settings. Here is a post of the log with Heat/Cool enabled with Eco

[07:55:57][V][esppac:287]: Polling AC
[07:55:57][V][esppac:297]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[07:55:57][V][esppac:297]: RX: 70 20 04 2E 80 A0 30 00 00 40 00 00 4C 33 00 00 00 00 14 07 FF 17 07 FF 80 80 FF 80 E6 03 16 80 85 71 04
[07:55:57][D][climate:369]: 'lounge_ac' - Sending state:
[07:55:57][D][climate:372]:   Mode: HEAT_COOL
[07:55:57][D][climate:374]:   Action: HEATING
[07:55:57][D][climate:377]:   Fan Mode: AUTO
[07:55:57][D][climate:386]:   Custom Preset: None
[07:55:57][D][climate:389]:   Swing Mode: OFF
[07:55:57][D][climate:392]:   Current Temperature: 20.00°C
[07:55:57][D][climate:398]:   Target Temperature: 23.00°C

And this is with the eco toggle off and eco mode on using the IR remote

[07:57:32][V][esppac:287]: Polling AC
[07:57:32][V][esppac:297]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[07:57:33][V][esppac:297]: RX: 70 20 04 2E 80 A0 F0 00 00 40 40 00 4C 33 00 00 00 00 14 07 FF 16 07 FF 80 80 FF 80 C5 03 15 C0 00 00 DD
[07:57:33][D][climate:369]: 'lounge_ac' - Sending state:
[07:57:33][D][climate:372]:   Mode: HEAT_COOL
[07:57:33][D][climate:374]:   Action: HEATING
[07:57:33][D][climate:377]:   Fan Mode: AUTO
[07:57:33][D][climate:386]:   Custom Preset: None
[07:57:33][D][climate:389]:   Swing Mode: VERTICAL
[07:57:33][D][climate:392]:   Current Temperature: 20.00°C
[07:57:33][D][climate:398]:   Target Temperature: 23.00°C

The Quiet preset works but as mentioned, when using the remote this is an option cycling through the fan speed buttons. The fan speeds also have 'middle' and 'focus' in the menu now which don't make a lot of sense to me.

image

Let me know if you need anything further

flybrys commented 3 years ago

On another note, the comfort cloud integration reported back power usage stats too. Would be cool if this was available as well.

DomiStyle commented 3 years ago

I thought Quiet should go under fan speeds rather than presets since you can't have high fan speed and quiet mode at the same time.

Quiet/powerful is a toggle switch on most ACs I have seen so far. When you switch back from Powerful/Quiet to Normal mode it should use your previous set fan speed since it's not overwritten. Eco mode is not available on my unit.

Just for reference, this is what my remote looks like: https://user-images.githubusercontent.com/975131/122646463-90e43b80-d11f-11eb-9d27-977b41d4bbbc.jpg

There's also a mild dry switch now but I don't have any such feature on my air con. What is this for?

You can disable it by removing the sensor and the corresponding function call in your config (same for nanoeX). It's a feature on mine to reduce how much humidity it removes from the room.

I can't get the eco light to come on the unit using any combination of settings. Here is a post of the log with Heat/Cool enabled with Eco

Can you post the log as you go back and forth on the eco mode switch? Make sure you have this line not commented:

ac->set_eco_switch(id(ac01_eco_switch));

The fan speeds also have 'middle' and 'focus' in the menu now which don't make a lot of sense to me.

Those are the presets Home Assistant provides and yes, they are non-descriptive.

However, since ESPHome 1.20.1 released today I can finally use custom presets and rename them to something more understandable. A verson which implements this should be done in a few hours.

On another note, the comfort cloud integration reported back power usage stats too. Would be cool if this was available as well.

I use external methods of monitoring energy usage so I'm not interested to implement this for now (same with the timer and sleep features). But feel free to create a feature request for it.

flybrys commented 3 years ago

Make sure you have this line not commented:

ac->set_eco_switch(id(ac01_eco_switch));

I missed this in the config file previously - sorry!. I just uncommented it and reuploaded. Now when I toggle the Eco switch, it turns itself back off straight away.

Here is the logs from toggling eco on and off with my remote. It contains setting powerfull too as I have to cycle through powerful first to get to eco. Everything else is on Auto for reference.

[17:27:26][V][esppac:287]: Polling AC
[17:27:26][V][esppac:297]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[17:27:27][V][esppac:297]: RX: 70 20 04 2E 80 A0 F0 00 00 40 00 00 4C 2A 00 00 00 00 16 10 FF 17 10 FF 80 80 FF 80 14 02 0C C1 38 14 7F
[17:27:27][D][climate:369]: 'lounge_ac' - Sending state:
[17:27:27][D][climate:372]:   Mode: HEAT_COOL
[17:27:27][D][climate:374]:   Action: COOLING
[17:27:27][D][climate:377]:   Fan Mode: AUTO
[17:27:27][D][climate:386]:   Custom Preset: None
[17:27:27][D][climate:389]:   Swing Mode: VERTICAL
[17:27:27][D][climate:392]:   Current Temperature: 22.00°C
[17:27:27][D][climate:398]:   Target Temperature: 23.00°C
[17:27:31][V][esppac:287]: Polling AC
[17:27:32][V][esppac:297]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[17:27:32][V][esppac:297]: RX: 70 20 04 2E 80 A0 F0 02 00 40 00 00 4C 32 00 00 00 00 16 10 FF 17 10 FF 80 80 FF 80 3A 02 0D 80 85 71 E5
[17:27:32][D][climate:369]: 'lounge_ac' - Sending state:
[17:27:32][D][climate:372]:   Mode: HEAT_COOL
[17:27:32][D][climate:374]:   Action: COOLING
[17:27:32][D][climate:377]:   Fan Mode: AUTO
[17:27:32][D][climate:386]:   Custom Preset: Powerful
[17:27:32][D][climate:389]:   Swing Mode: VERTICAL
[17:27:32][D][climate:392]:   Current Temperature: 22.00°C
[17:27:32][D][climate:398]:   Target Temperature: 23.00°C
[17:27:37][V][esppac:287]: Polling AC
[17:27:37][V][esppac:297]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[17:27:37][V][esppac:297]: RX: 70 20 04 2E 80 A0 F0 00 00 40 40 00 0C 2A 00 00 00 00 16 10 FF 17 10 FF 80 80 FF 80 58 02 0E C0 00 00 86
[17:27:37][D][climate:369]: 'lounge_ac' - Sending state:
[17:27:37][D][climate:372]:   Mode: HEAT_COOL
[17:27:37][D][climate:374]:   Action: COOLING
[17:27:37][D][climate:377]:   Fan Mode: AUTO
[17:27:37][D][climate:386]:   Custom Preset: None
[17:27:37][D][climate:389]:   Swing Mode: VERTICAL
[17:27:37][D][climate:392]:   Current Temperature: 22.00°C
[17:27:37][D][climate:398]:   Target Temperature: 23.00°C
[17:27:42][V][esppac:287]: Polling AC
[17:27:42][V][esppac:297]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86
[17:27:42][V][esppac:297]: RX: 70 20 04 2E 80 A0 F0 00 00 40 00 00 0C 2A 00 00 00 00 16 10 FF 17 10 FF 80 80 FF 80 70 02 0E C1 38 14 61
[17:27:42][D][climate:369]: 'lounge_ac' - Sending state:
[17:27:42][D][climate:372]:   Mode: HEAT_COOL
[17:27:42][D][climate:374]:   Action: COOLING
[17:27:42][D][climate:377]:   Fan Mode: AUTO
[17:27:42][D][climate:386]:   Custom Preset: None
[17:27:42][D][climate:389]:   Swing Mode: VERTICAL
[17:27:42][D][climate:392]:   Current Temperature: 22.00°C
[17:27:42][D][climate:398]:   Target Temperature: 23.00°C

Here's a pic of my remote for reference

20210726_192712

I use external methods of monitoring energy usage so I'm not interested to implement this for now (same with the timer and sleep features). But feel free to create a feature request for it.

Happy to prioritise getting everything working first, but it would be good to add this later. Where I live we have a silly "demand usage" metering scheme, so I've got home assistant to prevent things turning on consecutively so we get a cheaper bill. I'll add a feature request later.

daggy72 commented 3 years ago

great work guys and in particular @DomiStyle and @brywithawhy !!!

I have 8 Panasonic Etherea units (CS-ZxxTKEW) in my home and office which are all connected via CZ-TACG1-modules to Panasonic Comfort Cloud (PCC). Which is turning out to be quite problematic lately. About 5 "server unreachables" in the last month.

Since I am fasing out all cloud-based solutions for local HA-controlled alternatives the aircons were high on my wish list.

Is there anything I can do to help/support? Where shall I start?

by the way: the HACS-PCC integration never managed to visualise the NanoeX function my aircon has. Not even the original PanasonicCC App supports it, so I am hoping for this project to finally get me my nanoex support ;-)

DomiStyle commented 3 years ago

Now when I toggle the Eco switch, it turns itself back off straight away.

Wrong byte, should hopefully work now. You can also try turning it on/off via the remote and the button in Home Assistant should update automatically after 5 seconds or so.

Here's a pic of my remote for reference Looks like a few things are switched around there. Does the AC remember your previous fan power when cycling through Powerful/Eco/Normal or does it reset to normal speed?

About 5 "server unreachables" in the last month.

That's the reason I wrote this, their app and server is horrible.

Is there anything I can do to help/support? Where shall I start?

You can try switching one of your units over to an ESP and help with testing. Also, you can post a picture of your remote so we can see the layout for your AC.

Not even the original PanasonicCC App supports it, so I am hoping for this project to finally get me my nanoex support

It does! My AC supports nanoeX and I can toggle it from my library just like normal. Probably just their laziness to not support it for CZ-TACG1 since it is supported on DNSK-P11.

flybrys commented 3 years ago

Quiet/powerful is a toggle switch on most ACs I have seen so far. When you switch back from Powerful/Quiet to Normal mode it should use your previous set fan speed since it's not overwritten

Also you're right. Was just trying different things and even though I use the fan speed button to toggle quiet, the quiet mode turns off when changing to powerfull. However I can run Eco and Quiet mode at the same time.

Does the AC remember your previous fan power when cycling through Powerful/Eco/Normal or does it reset to normal speed?

Seems to, but I'm not certain if that is the remote remembering it and sending the last speed when I turn off or if the aircon itself is.

Will test and report back shortly.

flybrys commented 3 years ago

Confirmed - Eco mode is now working.

flybrys commented 3 years ago

Does the AC remember your previous fan power when cycling through Powerful/Eco/Normal or does it reset to normal speed?

I can't think of an effective way to test this, however I suspect the remote remembers the last setting and re-sends it when turning it off.

DomiStyle commented 3 years ago

I can't think of an effective way to test this, however I suspect the remote remembers the last setting and re-sends it when turning it off.

You can try from Home assistant: Set the fan speed to high then set the preset to powerful and then back to none/normal again. Now you can check what fan mode is showing.

However I can run Eco and Quiet mode at the same time.

Yes, so Quiet/Powerful being a preset and Eco being a switch should work for both cases.

flybrys commented 3 years ago

You can try from Home assistant: Set the fan speed to high then set the preset to powerful and then back to none/normal again. Now you can check what fan mode is showing.

I'm embarrassed at how much sense that made. Sleep deprived over here 😫 Yes - fan speed setting is persistant between preset changes for both powerfull and quiet. Awesome!

One thing I'm noticing is that the connection to the esp32 sometimes times out but it reconnects straight away. This is causing the entities to become unavailable momentarily. Could this be changed to say, have 3-5 consecutive timeouts before declaring it as unavailable?

image

DomiStyle commented 3 years ago

Yes - fan speed setting is persistant between preset changes for both powerfull and quiet. Awesome!

Sounds good, will leave it as is for now. Should work for the majority of ACs.

One thing I'm noticing is that the connection to the esp32 sometimes times out but it reconnects straight away.

Spotty wifi connection? I don't think you can choose any sort of timeout in the ESPHome API or in the Home Assistant ESPHome component.

Your best chance might be adding a IoT SSID with a less used frequency for IoT devices. These devices don't need a high bandwidth so you can reduce the channel width to a minimum to reduce interference at the cost of speed. Other than that maybe adding a wifi repeater or another access point could help.

flybrys commented 3 years ago

Sounds good, will leave it as is for now. Should work for the majority of ACs.

Great, thanks for all your help getting this working. Let me know if you need any further testing.

Spotty wifi connection?

I've got a pretty decent mesh network with unifi hardware, and all my smart devices are on a dedicated 2.4ghz IoT SSID. The nearest access point is literally a metre away from the esp32. Never mind though, not a big deal. I'm getting a pretty crappy ping to it where other devices are fine so I'll look into the esp32 side of things to rectify that.

Thanks again

DomiStyle commented 3 years ago

Does anybody here have a picture of the original CZ-TACG1 installed in the AC I can use for the readme? And maybe one of the installed ESP with logic converter?

Also, is the wifi LED on the unit blinking, lit or off?

crispie commented 3 years ago

image

All three LEDs of constantly on. No picture from the installed ESP yet, I get a python syntax error when doing esphome ac.yaml run. See below output. Any idea?

Processing ac01 (board: nodemcu-32s; board_build.partitions: partitions.csv; build_flags: - DESPHOME_LOG_LEVEL=ESPHOME_LOG_LEVEL_DEBUG, -Wno-sign-compare, -Wno-unused-but-set-variable, -Wno-unused-variable, -fno-exceptions; framework: arduino; lib_deps: esphome/AsyncTCP-esphome@1.2.2, ESPmDNS, Hash; platform: platformio/espressif32@3.2.0; upload_speed: 115200)

File "/usr/local/lib/python3.9/site-packages/asyncio/base_events.py", line 296

future = tasks.async(future, loop=self)

              ^                                                                                                                                                                                                                                                                                                                                                                              

SyntaxError: invalid syntax

flybrys commented 3 years ago

Here's mine. I don't have a neat little pocket for it so mine is stuck to the side. All 3 lights are on and Link blinks when commands are sent like an activity LED on a network card. Also my current ESP32 is just hanging from the wire until the proper JST PA connectors arrive. I've opened the CZ-TACG1 case and unclipped the connector in order to use it until then.

20210730_091457

20210730_091245

20210730_092555

DomiStyle commented 3 years ago

Thanks for the pictures, hopefully I will get everything cleaned up with instructions over the weekend and push the new version to master.

There is still a pending bug in Home Assistant that prevents the custom fan speeds from working but it should be done soon.

@crispie

I get a python syntax error when doing esphome ac.yaml run. See below output. Any idea?

Interesting, never saw that error before.

What is the output of esphome version? What is the output of python --version and python3 --version? Can you post the entire log? What does your folder structure look like and did you make any changes to the ac.yaml? Did you pull the dev branch?

flybrys commented 3 years ago

Looking forward to it. Any progress on manual swing positions working?

DomiStyle commented 3 years ago

@brywithawhy Done already, I'm just waiting for the Home Assistant update.

crispie commented 3 years ago

@DomiStyle

What is the output of esphome version? bash-5.1# esphome version
Version: 1.20.1

What is the output of python --version and python3 --version? bash-5.1# python --version
Python 3.9.5

bash-5.1# python3 --version
Python 3.9.5

Can you post the entire log? [33mWARNING Calling ESPHome with the configuration before the command is deprecated and will be removed in the future. [[0m
[[33mWARNING Please instead use:[[0m
[[33mWARNING esphome -v run ac.yaml[[0m
[[32mINFO Reading configuration ac.yaml...[[0m
[[32mINFO Generating C++ source...[[0m
[[36mDEBUG Running to_code in esphome.components.async_tcp (num 17)[[0m
[[36mDEBUG Adding: // async_tcp:[[0m
[[36mDEBUG Adding library: <esphome.core.Library object at 0x7f687614f3d0>[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.core.config (num 0)[[0m
[[36mDEBUG Adding: // esphome:[[0m
[[36mDEBUG Adding: // name: ac01
// platform: ESP32
// board: nodemcu-32s
// includes:
// - ./esphome-panasonic-ac
// arduino_version: platformio/espressif32@3.2.0
// build_path: ac01
// platformio_options: {}
// libraries: []
// name_add_mac_suffix: false[[0m
[[36mDEBUG Adding global: using namespace esphome;[[0m
[[36mDEBUG Adding: App.pre_setup("ac01", DATE ", " TIME, false);[[0m
[[36mDEBUG Adding build flag: -fno-exceptions[[0m
[[36mDEBUG Adding build flag: -Wno-unused-variable[[0m
[[36mDEBUG Adding build flag: -Wno-unused-but-set-variable[[0m
[[36mDEBUG Adding build flag: -Wno-sign-compare[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f6876155610>[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.text_sensor (num 8)[[0m
[[36mDEBUG Adding: // text_sensor:[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f6876144ac0>[[0m
[[36mDEBUG Adding global: using namespace text_sensor;[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running tocode in esphome.components.switch (num 11)[[0m
[[36mDEBUG Adding: // switch:[[0m
[[36mDEBUG Adding global: using namespace switch
;[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f6876148ee0>[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.climate (num 15)[[0m
[[36mDEBUG Adding: // climate:[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f6876153610>[[0m
[[36mDEBUG Adding global: using namespace climate;[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.logger (num 2)[[0m
[[36mDEBUG Adding: // logger:[[0m
[[36mDEBUG Adding: // level: DEBUG
// id: logger_logger
// baud_rate: 115200
// tx_buffer_size: 512
// hardware_uart: UART0
// logs: {}[[0m
[[36mDEBUG Adding global: logger::Logger *logger_logger;[[0m
[[36mDEBUG Adding: logger_logger = new logger::Logger(115200, 512, logger::UART_SELECTION_UART0);[[0m
[[36mDEBUG Registered variable logger_logger of type logger::Logger[[0m
[[36mDEBUG Adding: logger_logger->pre_setup();[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f68761550d0>[[0m
[[36mDEBUG Adding build flag: -DESPHOME_LOG_LEVEL=ESPHOME_LOG_LEVEL_DEBUG[[0m
[[36mDEBUG Adding: App.register_component(logger_logger);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.wifi (num 1)[[0m
[[36mDEBUG Adding: // wifi:[[0m
[[36mDEBUG Adding: // networks:
// - ssid: xxxx
// password: xxx
// id: wifi_wifiap
// priority: 0.0
// use_address: ac01.fritz.box
// id: wifi_wificomponent
// enable_mdns: true
// domain: .local
// reboot_timeout: 15min
// power_save_mode: LIGHT
// fast_connect: false[[0m
[[36mDEBUG Adding global: wifi::WiFiComponent *wifi_wificomponent;[[0m
[[36mDEBUG Adding: wifi_wificomponent = new wifi::WiFiComponent();[[0m
[[36mDEBUG Registered variable wifi_wificomponent of type wifi::WiFiComponent[[0m
[[36mDEBUG Adding: wifi_wificomponent->set_use_address("ac01.fritz.box");[[0m
[[36mDEBUG Adding: wifi::WiFiAP wifi_wifiap = wifi::WiFiAP();[[0m
[[36mDEBUG Registered variable wifi_wifiap of type wifi::WiFiAP[[0m
[[36mDEBUG Adding: wifi_wifiap.set_ssid("xxxx");[[0m
[[36mDEBUG Adding: wifi_wifiap.set_password("xxxx");[[0m
[[36mDEBUG Adding: wifi_wifiap.set_priority(0.0f);[[0m
[[36mDEBUG Adding: wifi_wificomponent->add_sta(wifi_wifiap);[[0m
[[36mDEBUG Adding: wifi_wificomponent->set_reboot_timeout(900000);[[0m
[[36mDEBUG Adding: wifi_wificomponent->set_power_save_mode(wifi::WIFI_POWER_SAVE_LIGHT);[[0m
[[36mDEBUG Adding: wifi_wificomponent->set_fast_connect(false);[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f68760825e0>[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f6876088160>[[0m
[[36mDEBUG Adding library: <esphome.core.Library object at 0x7f68760881f0>[[0m
[[36mDEBUG Adding: App.register_component(wifi_wificomponent);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.ota (num 4)[[0m
[[36mDEBUG Adding: // ota:[[0m
[[36mDEBUG Adding: // password: '1234'
// id: ota_otacomponent
// safe_mode: true
// port: 3232
// reboot_timeout: 5min
// num_attempts: 10[[0m
[[36mDEBUG Adding global: ota::OTAComponent ota_otacomponent;[[0m
[[36mDEBUG Adding: ota_otacomponent = new ota::OTAComponent();[[0m
[[36mDEBUG Registered variable ota_otacomponent of type ota::OTAComponent[[0m
[[36mDEBUG Adding: ota_otacomponent->set_port(3232);[[0m
[[36mDEBUG Adding: ota_otacomponent->set_auth_password("1234");[[0m
[[36mDEBUG Adding: App.register_component(ota_otacomponent);[[0m
[[36mDEBUG Adding: if (ota_otacomponent->should_enter_safe_mode(10, 300000)) return;[[0m
[[36mDEBUG Adding library: <esphome.core.Library object at 0x7f6876144730>[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.api (num 3)[[0m
[[36mDEBUG Adding: // api:[[0m
[[36mDEBUG Adding: // password: '1234'
// id: api_apiserver
// port: 6053
// reboot_timeout: 15min[[0m
[[36mDEBUG Adding global: api::APIServer
api_apiserver;[[0m
[[36mDEBUG Adding: api_apiserver = new api::APIServer();[[0m
[[36mDEBUG Registered variable api_apiserver of type api::APIServer[[0m
[[36mDEBUG Adding: App.register_component(api_apiserver);[[0m
[[36mDEBUG Adding: api_apiserver->set_port(6053);[[0m
[[36mDEBUG Adding: api_apiserver->set_password("1234");[[0m
[[36mDEBUG Adding: api_apiserver->set_reboot_timeout(900000);[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f68761621c0>[[0m
[[36mDEBUG Adding global: using namespace api;[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.sensor (num 6)[[0m
[[36mDEBUG Adding: // sensor:[[0m
[[36mDEBUG Adding define: <esphome.core.Define object at 0x7f687614d610>[[0m
[[36mDEBUG Adding global: using namespace sensor;[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running _add_automations in esphome.core.config (num 18)[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.uart (num 5)[[0m
[[36mDEBUG Adding: // uart:[[0m
[[36mDEBUG Adding: // tx_pin: 17
// rx_pin: 16
// id: ac_uart
// baud_rate: 9600
// parity: EVEN
// rx_buffer_size: 256
// invert: false
// stop_bits: 1
// data_bits: 8[[0m
[[36mDEBUG Adding global: using namespace uart;[[0m
[[36mDEBUG Adding global: uart::UARTComponent *ac_uart;[[0m
[[36mDEBUG Adding: ac_uart = new uart::UARTComponent();[[0m
[[36mDEBUG Registered variable ac_uart of type uart::UARTComponent[[0m
[[36mDEBUG Adding: App.register_component(ac_uart);[[0m
[[36mDEBUG Adding: ac_uart->set_baud_rate(9600);[[0m
[[36mDEBUG Adding: ac_uart->set_tx_pin(17);[[0m
[[36mDEBUG Adding: ac_uart->set_rx_pin(16);[[0m
[[36mDEBUG Adding: ac_uart->set_rx_buffer_size(256);[[0m
[[36mDEBUG Adding: ac_uart->set_invert(false);[[0m
[[36mDEBUG Adding: ac_uart->set_stop_bits(1);[[0m
[[36mDEBUG Adding: ac_uart->set_data_bits(8);[[0m
[[36mDEBUG Adding: ac_uart->set_parity(uart::UART_CONFIG_PARITY_EVEN);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.template.sensor (num 7)[[0m
[[36mDEBUG Adding: // sensor.template:[[0m
[[36mDEBUG Adding: // platform: template
// id: ac01_outside_temperature
// name: ac01_outside_temperature
// unit_of_measurement: °C
// accuracy_decimals: 0
// force_update: false
// updateinterval: 60s[[0m
[[36mDEBUG Adding global: template
::TemplateSensor *ac01_outside_temperature;[[0m
[[36mDEBUG Adding: ac01_outsidetemperature = new template::TemplateSensor();[[0m
[[36mDEBUG Registered variable ac01_outsidetemperature of type template::TemplateSensor[[0m
[[36mDEBUG Adding: ac01_outside_temperature->set_update_interval(60000);[[0m
[[36mDEBUG Adding: App.register_component(ac01_outside_temperature);[[0m
[[36mDEBUG Adding: App.register_sensor(ac01_outside_temperature);[[0m
[[36mDEBUG Adding: ac01_outside_temperature->set_name("ac01_outside_temperature");[[0m
[[36mDEBUG Adding: ac01_outside_temperature->set_unit_of_measurement("\302\260C");[[0m
[[36mDEBUG Adding: ac01_outside_temperature->set_accuracy_decimals(0);[[0m
[[36mDEBUG Adding: ac01_outside_temperature->set_force_update(false);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.homeassistant.text_sensor (num 9)[[0m
[[36mDEBUG Adding: // text_sensor.homeassistant:[[0m
[[36mDEBUG Adding: // platform: homeassistant
// id: ac01_vertical_swing
// name: ac01_vertical_swing
// entity_id: input_select.ac01_vertical_swing
// on_value:
// - then:
// - homeassistant.service:
// service: input_select.select_option
// data_template:
// entity_id: input_select.ac01_vertical_swing
// option: '{{ swing }}'
// variables:
// variables:
// swing: !lambda |-
// return id(ac01_vertical_swing).state;
// id: api_apiserver
// data: {}
// type_id: api_homeassistantservicecallaction
// automation_id: automation
// trigger_id: text_sensor_textsensorstatetrigger[[0m
[[36mDEBUG Adding global: homeassistant::HomeassistantTextSensor ac01_vertical_swing;[[0m
[[36mDEBUG Adding: ac01_vertical_swing = new homeassistant::HomeassistantTextSensor();[[0m
[[36mDEBUG Registered variable ac01_vertical_swing of type homeassistant::HomeassistantTextSensor[[0m
[[36mDEBUG Adding: App.register_component(ac01_vertical_swing);[[0m
[[36mDEBUG Adding: App.register_text_sensor(ac01_vertical_swing);[[0m
[[36mDEBUG Adding: ac01_vertical_swing->set_name("ac01_vertical_swing");[[0m
[[36mDEBUG Adding global: text_sensor::TextSensorStateTrigger
text_sensor_textsensorstatetrigger;[[0m
[[36mDEBUG Adding: text_sensor_textsensorstatetrigger = new text_sensor::TextSensorStateTrigger(ac01_vertical_swing);[[0m
[[36mDEBUG Registered variable text_sensor_textsensorstatetrigger of type text_sensor::TextSensorStateTrigger[[0m
[[36mDEBUG Adding global: Automation automation;[[0m
[[36mDEBUG Adding: automation = new Automation(text_sensor_textsensorstatetrigger);[[0m
[[36mDEBUG Registered variable automation of type Automation[[0m
[[36mDEBUG Adding global: api::HomeAssistantServiceCallAction
api_homeassistantservicecallaction;[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction = new api::HomeAssistantServiceCallAction(api_apiserver, false);[[0m
[[36mDEBUG Registered variable api_homeassistantservicecallaction of type api::HomeAssistantServiceCallAction[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction->set_service("input_select.select_option");[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction->add_data_template("entity_id", "input_select.ac01_vertical_swing");[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction->add_data_template("option", "{{ swing }}");[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction->add_variable("swing", [=](std::string x) {

line 55 "ac.yaml"

return ac01_vertical_swing->state;
});[[0m
[[36mDEBUG Adding: automation->add_actions({api_homeassistantservicecallaction});[[0m
[[36mDEBUG Adding: ac01_vertical_swing->set_entity_id("input_select.ac01_vertical_swing");[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.homeassistant.text_sensor (num 10)[[0m
[[36mDEBUG Adding: // text_sensor.homeassistant:[[0m
[[36mDEBUG Adding: // platform: homeassistant
// id: ac01_horizontal_swing
// name: ac01_horizontal_swing
// entity_id: input_select.ac01_horizontal_swing
// on_value:
// - then:
// - homeassistant.service:
// service: input_select.select_option
// data_template:
// entity_id: input_select.ac01_horizontal_swing
// option: '{{ swing }}'
// variables:
// swing: !lambda |-
// return id(ac01_horizontal_swing).state;
// id: api_apiserver
// data: {}
// type_id: api_homeassistantservicecallaction_2
// automation_id: automation_2
// trigger_id: text_sensor_textsensorstatetrigger_2[[0m
[[36mDEBUG Adding global: homeassistant::HomeassistantTextSensor ac01_horizontal_swing;[[0m
[[36mDEBUG Adding: ac01_horizontal_swing = new homeassistant::HomeassistantTextSensor();[[0m
[[36mDEBUG Registered variable ac01_horizontal_swing of type homeassistant::HomeassistantTextSensor[[0m
[[36mDEBUG Adding: App.register_component(ac01_horizontal_swing);[[0m
[[36mDEBUG Adding: App.register_text_sensor(ac01_horizontal_swing);[[0m
[[36mDEBUG Adding: ac01_horizontal_swing->set_name("ac01_horizontal_swing");[[0m
[[36mDEBUG Adding global: text_sensor::TextSensorStateTrigger
text_sensor_textsensorstatetrigger_2;[[0m
[[36mDEBUG Adding: text_sensor_textsensorstatetrigger_2 = new text_sensor::TextSensorStateTrigger(ac01_horizontal_swing);[[0m
[[36mDEBUG Registered variable text_sensor_textsensorstatetrigger_2 of type text_sensor::TextSensorStateTrigger[[0m
[[36mDEBUG Adding global: Automation automation_2;[[0m
[[36mDEBUG Adding global: Automation
automation_2;[[0m
[[36mDEBUG Adding: automation_2 = new Automation(text_sensor_textsensorstatetrigger_2);[[0m
[[36mDEBUG Registered variable automation_2 of type Automation[[0m
[[36mDEBUG Adding global: api::HomeAssistantServiceCallAction *api_homeassistantservicecallaction_2;[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction_2 = new api::HomeAssistantServiceCallAction(api_apiserver, false);[[0m
[[36mDEBUG Registered variable api_homeassistantservicecallaction_2 of type api::HomeAssistantServiceCallAction[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction_2->set_service("input_select.select_option");[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction_2->add_data_template("entity_id", "input_select.ac01_horizontal_swing");[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction_2->add_data_template("option", "{{ swing }}");[[0m
[[36mDEBUG Adding: api_homeassistantservicecallaction_2->add_variable("swing", [=](std::string x) {

line 68 "ac.yaml"

return ac01_horizontal_swing->state;
});[[0m
[[36mDEBUG Adding: automation_2->add_actions({api_homeassistantservicecallaction_2});[[0m
[[36mDEBUG Adding: ac01_horizontal_swing->set_entity_id("input_select.ac01_horizontal_swing");[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.template.switch (num 12)[[0m
[[36mDEBUG Adding: // switch.template:[[0m
[[36mDEBUG Adding: // platform: template
// id: ac01_nanoex_switch
// name: ac01_nanoex_switch
// optimistic: true
// assumed_state: false
// restorestate: false[[0m
[[36mDEBUG Adding global: template
::TemplateSwitch ac01_nanoex_switch;[[0m
[[36mDEBUG Adding: ac01_nanoexswitch = new template::TemplateSwitch();[[0m
[[36mDEBUG Registered variable ac01_nanoexswitch of type template::TemplateSwitch[[0m
[[36mDEBUG Adding: App.register_component(ac01_nanoex_switch);[[0m
[[36mDEBUG Adding: App.register_switch(ac01_nanoex_switch);[[0m
[[36mDEBUG Adding: ac01_nanoex_switch->set_name("ac01_nanoex_switch");[[0m
[[36mDEBUG Adding: ac01_nanoex_switch->set_optimistic(true);[[0m
[[36mDEBUG Adding: ac01_nanoex_switch->set_assumed_state(false);[[0m
[[36mDEBUG Adding: ac01_nanoex_switch->set_restore_state(false);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.template.switch (num 13)[[0m
[[36mDEBUG Adding: // switch.template:[[0m
[[36mDEBUG Adding: // platform: template
// id: ac01_eco_switch
// name: ac01_eco_switch
// optimistic: true
// assumed_state: false
// restorestate: false[[0m
[[36mDEBUG Adding global: template
::TemplateSwitch
ac01_eco_switch;[[0m
[[36mDEBUG Adding: ac01_ecoswitch = new template::TemplateSwitch();[[0m
[[36mDEBUG Registered variable ac01_ecoswitch of type template::TemplateSwitch[[0m
[[36mDEBUG Adding: App.register_component(ac01_eco_switch);[[0m
[[36mDEBUG Adding: App.register_switch(ac01_eco_switch);[[0m
[[36mDEBUG Adding: ac01_eco_switch->set_name("ac01_eco_switch");[[0m
[[36mDEBUG Adding: ac01_eco_switch->set_optimistic(true);[[0m
[[36mDEBUG Adding: ac01_eco_switch->set_assumed_state(false);[[0m
[[36mDEBUG Adding: ac01_eco_switch->set_restore_state(false);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.template.switch (num 14)[[0m
[[36mDEBUG Adding: // switch.template:[[0m
[[36mDEBUG Adding: // platform: template
// id: ac01_mild_dry_switch
// name: ac01_mild_dry_switch
// optimistic: true
// assumed_state: false
// restorestate: false[[0m
[[36mDEBUG Adding global: template
::TemplateSwitch *ac01_mild_dry_switch;[[0m
[[36mDEBUG Adding: ac01_mild_dryswitch = new template::TemplateSwitch();[[0m
[[36mDEBUG Registered variable ac01_mild_dryswitch of type template::TemplateSwitch[[0m
[[36mDEBUG Adding: App.register_component(ac01_mild_dry_switch);[[0m
[[36mDEBUG Adding: App.register_switch(ac01_mild_dry_switch);[[0m
[[36mDEBUG Adding: ac01_mild_dry_switch->set_name("ac01_mild_dry_switch");[[0m
[[36mDEBUG Adding: ac01_mild_dry_switch->set_optimistic(true);[[0m
[[36mDEBUG Adding: ac01_mild_dry_switch->set_assumed_state(false);[[0m
[[36mDEBUG Adding: ac01_mild_dry_switch->set_restore_state(false);[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running to_code in esphome.components.custom.climate (num 16)[[0m
[[36mDEBUG Adding: // climate.custom:[[0m
[[36mDEBUG Adding: // platform: custom
// lambda: !lambda |-
// For DNSK-P11
// auto ac = new ESPPAC::WLAN::PanasonicACWLAN(id(ac_uart));
//
// For CZ-TACG1
// auto ac = new ESPPAC::CNT::PanasonicACCNT(id(ac_uart));
//
// ac->set_outside_temperature_sensor(id(ac01_outside_temperature));
// ac->set_vertical_swing_sensor(id(ac01_vertical_swing));
// ac->set_horizontal_swing_sensor(id(ac01_horizontal_swing));
//
// Enable as needed
// ac->set_nanoex_switch(id(ac01_nanoex_switch));
// ac->set_eco_switch(id(ac01_eco_switch));
// ac->set_mild_dry_switch(id(ac01_mild_dry_switch));
//
// App.register_component(ac);
// return {ac};
// climates:
// - id: ac01
// name: ac01
// visual: {}
// id: custom_customclimateconstructor[[0m
[[36mDEBUG Adding: custom::CustomClimateConstructor custom_customclimateconstructor = custom::CustomClimateConstructor([=]() -> std::vector<climate::Climate *> {

line 90 "ac.yaml"

ac->set_outside_temperature_sensor(ac01_outside_temperature);                                                                                                                                                                                                                                                                                                                                 
ac->set_vertical_swing_sensor(ac01_vertical_swing);                                                                                                                                                                                                                                                                                                                                           
ac->set_horizontal_swing_sensor(ac01_horizontal_swing);                                                                                                                                                                                                                                                                                                                                       

App.register_component(ac);                                                                                                                                                                                                                                                                                                                                                                   
return {ac};                                                                                                                                                                                                                                                                                                                                                                                  

});[[0m
[[36mDEBUG Registered variable custom_customclimateconstructor of type custom::CustomClimateConstructor[[0m
[[36mDEBUG Adding global: climate::Climate *ac01;[[0m
[[36mDEBUG Adding: ac01 = custom_customclimateconstructor.get_climate(0);[[0m
[[36mDEBUG Registered variable ac01 of type climate::Climate[[0m
[[36mDEBUG Adding: App.register_climate(ac01);[[0m
[[36mDEBUG Adding: ac01->set_name("ac01");[[0m
[[36mDEBUG -> finished[[0m
[[36mDEBUG Running add_includes in esphome.core.config (num 19)[[0m
[[36mDEBUG Adding global: #include "esphome-panasonic-ac/esppac.h"[[0m
[[36mDEBUG Adding global: #include "esphome-panasonic-ac/esppac_cnt.h"[[0m
[[36mDEBUG Adding global: #include "esphome-panasonic-ac/esppac_commands_cnt.h"[[0m
[[36mDEBUG Adding global: #include "esphome-panasonic-ac/esppac_commands_wlan.h"[[0m
[[36mDEBUG Adding global: #include "esphome-panasonic-ac/esppac_wlan.h"[[0m
[[36mDEBUG -> finished[[0m
[[32mINFO Compiling app...[[0m
[[32mINFO Running: platformio run -d ac01 -v[[0m
File "/usr/local/lib/python3.9/site-packages/asyncio/base_events.py", line 296

future = tasks.async(future, loop=self)                                                                                                                                                                                                                                                                                                                                                       

               ^                                                                                                                                                                                                                                                                                                                                                                              

SyntaxError: invalid syntax

=================================================================================================================================================================================== [FAILED] Took 0.18 seconds ===================================================================================================================================================================================

~
(END)

What does your folder structure look like and did you make any changes to the ac.yaml? esphome-panasonic-ac directory under /config (for homeassistant), ac-yaml.example changed to contain correct wifi network/pw and copied to /config (same level as esphome-panasonic-ac

Did you pull the dev branch? yes

DomiStyle commented 3 years ago

@crispie No idea unfortunately, maybe you can use ESPHome from Docker instead so there are no dependency issues?

Also, it might not be a good idea to put ESPHome into your HA config directory.

@brywithawhy Everything is in the repo now, it needs the latest Home Assistant Release candidate. Instructions on how to add the swing selector(s) are here.

jesserockz commented 3 years ago

Hello, Just found this repo after searching around for a few hours today (Not specifically ESPHome based, but anything around CZ-TACG1) I have wired a d1-mini to my panasonic CS-E18NKR CN-CNT port but I am getting no response at all coming in on uart after the poll is sent out.

Any ideas? I have tried swapping RX/TX. Perhaps my AC unit just doesn't use the port :cry:

Logs ```text [21:41:04][V][esppac:279]: Polling AC [21:41:04][VV][uart_esp8266:111]: Wrote 0b01110000 (0x70) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00001010 (0x0A) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:04][VV][uart_esp8266:111]: Wrote 0b10000110 (0x86) [21:41:04][V][esppac:272]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86 [21:41:09][V][esppac:279]: Polling AC [21:41:09][VV][uart_esp8266:111]: Wrote 0b01110000 (0x70) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00001010 (0x0A) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b00000000 (0x00) [21:41:09][VV][uart_esp8266:111]: Wrote 0b10000110 (0x86) [21:41:09][V][esppac:272]: TX: 70 0A 00 00 00 00 00 00 00 00 00 00 86 ```
DomiStyle commented 3 years ago

@jesserockz Did you have a CZ-TACG1 plugged in there before?

I'm not sure if the port needs to actually be enabled somehow since I didn't check the protocol during pairing but I was able to just swap the CZ-TACG1 out for an ESP after pairing and the AC responded fine. I'm even using both wifi adapters at the same time right now. I did have some issues at first because of a broken channel on the logic converter but it worked after changing to channel 2 & 3 on the logic converter.

Unfortunately the CZ-TACG1 is harder to debug than the DNSK-P11 because it doesn't push any information and only responds to polling. The polling seems to be working fine in your log though.

I have a second AC I can test that never had a CZ-TACG1 connected to it to see if it works there out of the box.

Is the D1-Mini an ESP32 or an ESP8266?

jesserockz commented 3 years ago

No I have not had a CZ-TACG1 in there and dont have one to try. It's an ESP8266. I did not use a logic converter as the 8266 can handle the 5V uart lines (The reason I am not testing with an ESP32)

DomiStyle commented 3 years ago

Did you disable UART logging or are you using software serial for the 8266?

Is your CN-CNT connector exposed like in the picture here or is it on the mainboard? If it's exposed I don't see a reason why it shouldn't be supported.

I tried connecting the ESP to a fresh AC and everything worked so I assume there is no packet that needs to be sent to activate the port.

I will test it on an 8266 next and see if it works aswell.