Replies: 1 comment 5 replies
-
Update: this is one of those situations where you finally decide to ask for help, write out the problem, and then some subconscious process gets set loose and you figure out the problem. I have it working, though I'm not sure if is supposed to look like that. If anyone could still take a look, particularly at my inline function starting line 20, I'd really appreciate it. With the code the way it is now it works as expected but one of the reasons I love doing this kind of stuff is to learn and I am sure I've made mistakes in that code. Next trick is going to be figuring out how to add a switch from home assistant in to this to truly set the power state. I have a split current detector set up that measures when my Daikin is drawing power. If it is (over a small amount) the switch returns true, otherwise false. It's a simple way to be certain my power toggle states are in sync if I am away from the unit. Figuring this out should be fun :) |
Beta Was this translation helpful? Give feedback.
-
I'm working on a custom ESPHome climate component using IRremoteESP8266.
Using Daikin128 protocol, I created a header file (this one, my repo ). My circuit is fine, IR is transmitting and the unit recognizes the codes, in fact I've gotten everything to work - modes, fan, temp, etc. changes - but I am stumped on how to handle the power state.
The Daikin 17 series is differential; it doesn't have discrete on/off, just one power command. The library includes two settings "getPowerToggle" and "setPowerToggle". The first is a bool value and the second sets the first.
I am fairly new to Arduino c++ and I can't seem to wrap my head around how to send the correct command. From what I understand, if "getPowerToggle" returns true, then the power command should be sent, false and it should not.
What needs to happen is, if a command is selected (say "set the mode to cool") it should check if getPowerToggle is true or false, if true toggle the power, if false just send the command to set the mode. I've tried multiple ways but can't get it to work. The power state does change but with each command i.e. if I am in mode Cool and I switch to Heat it turns the unit off. If I choose Heat again it turns it back on. I know these AC remotes send the entire state but that is what I think the Toggle setting is meant to help with. Implementing that is my challenge right now.
Would anyone be willing to take a look at my work and see if something obvious jumps out? Apologies if the code is a little rough, I am still early in the learning process and appreciate any help.
Beta Was this translation helpful? Give feedback.
All reactions