Replies: 3 comments 6 replies
-
As in the FAQ we can't help you with programming, but if you only have 2 states, maybe you should just use them thru the raw state, you can even store them and transfer them thru that. |
Beta Was this translation helpful? Give feedback.
-
Oh btw. A relatively big difference is how and where _.Temp is stored.
.. where the Set temperature is stored in the 7 most significant bits (which are sent last because LSBfirst) So I borrowed and modfied this SetTemp function for the IRDaikin152 class. And also modified the Protocol
Then, related to Temp setting:
I do not know what my AC will do with 0x60 in FanMode, but its definitely not what my remote consistently sets for FanMode |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have built an IR-sender to control my Daikin AC , that works just fine.
It receives commands for temperature, fanspeed etc from HomeAssistant over TCP.
In summer my AC is on day and night, but in the daytime i set the fanspeed low and the temperature to about 26C
I have an idea to create two instances of Daiking152Protocol (which is a struct inside a union)
For example:
Daikin152Protocol Day; Daikin152Protocol Night;
Then a button in homeAssistant or an automation based on the time, sends a request to copy Night.raw into _.raw (the Daiking152Protocol that is a member of the class IRDaikin152)
There conveniently already is a function
void setRaw (const uint8_t new_code[])
My question/problem is... how do I initialize my 'Night' -instance (since it has bitfield labels)
Daikin152Protocol Night={ .Mode = kDaikinCool , } ; // dont forget to get the checksum
compiles (in PlatformIO) , but it isnt a full configuration for my settings
Daikin152Protocol Night={ .Power = 1 , .Mode = kDaikinCool , } ;
Does not compile, it gives an error:
error: too many initializers for 'Daikin152Protocol'
I have googled around for a bit. Its possible My compiler doesnt allow it or something. On the other hand it may just be tha I am not using the right syntax.
Can I initialize an instance like this?
Or is there a function to set an entire content of a Protocol at runtime?
(It looks like the only funciton available is setRaw( ) , but if I declare an array, I can't use the bitfield labels (.power , .Mode etc) to initialize it.
Beta Was this translation helpful? Give feedback.
All reactions