revk / ESP32-Faikin

ESP32 based module to control Daikin aircon units
GNU General Public License v3.0
395 stars 59 forks source link

the S21 Protocol has Power Meter ? #101

Closed metarutaiga closed 4 months ago

metarutaiga commented 11 months ago

Is the FM Meter? Is the FP Pulse? The values are Hex values.

I checked it on my FTXM-V. The value is likely my Power Meter closely.

kWh = FM * FP / 1000.

44616E commented 5 months ago

I am happy to help testing various commands, can someone explain to me how to read / convert the results? as far as I understood they are hex, but also reversed?

Well, correct me if I am wrong, but some values need to be converted to decimal, others are fine as hex, but its always inverted.

I wonder if FM / GM is not simply counting up the kWh, in my case the value is 13123 (hex: 3343), which could be 1312,3 kWh and which is incrementing by 0.1 kWh as seen here. This would match the ONECTA App, where 0.1 kWh is the smallest unit. I dont have consumption data before last year (2023: ~500kWh), but if its a lifetime value, It could make sense since I have my AC almost 3 years.

I am thinking the same, my values look very close if we use a 0.1 multiplier. Will test some more tonight.

44616E commented 5 months ago

"The ‘Outdoor compressor Energy consumption’ and ‘Outdoor compressor Estimated power consumption’ sensors are updated every time 100 Wh are consumed by all different operating modes summed together."

https://www.home-assistant.io/integrations/daikin#sensor

So seems the multiplier is fixed. Do I think GP is not required.

The estimated power consumption would be handy.

metarutaiga commented 5 months ago

The Daikin integration in HA has wrong power consumption value with my aircon. It seems that official wifi module is read wrong data.

revk commented 5 months ago

OK so what is GP?

This is why is asked the units in the first place!

I can change to 100Wh multiplier, no problem.

But is GP useful? Or shall we ignore it?

serimi89 commented 5 months ago

OK so what is GP?

This is why is asked the units in the first place!

I can change to 100Wh multiplier, no problem.

But is GP useful? Or shall we ignore it?

I think the original assumption was just letter based, P = pulse, M = Meter - doesn't seem to be necessary a proof that both are necessary?

Anyway, I have been reading the new Daikin Cloud API I came across this re power consumption, which is exactly the way data is displayed on the ONECTA App, too and I think it it was displayed in the local api, too.

I just disconnected my Daikin WiFi Adapter last week and replaced it with the Faikin, but might connect it again in the next days to look for consumption data clues.

Characteristic name: consumptionData

Description: You can consult the energy consumption of your devices. Please note that not all Daikin devices support consumption data through the API, as such it's possible that the consumptionData object is not always present. "consumptionData": { "settable": false, "value": { "electrical": { "unit": "kWh", "heating": { "d": [ 0, 0, 0, 1, 2, 0, 2, 3, 0, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 5, 7, null, null, null ], "w": [ 0, 0, 0, 0, 100, 30, 130, 0, 0, 0, 0, 100, null, null ], "m": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 264 ] }, "cooling": { "d": [ 0, 0, 0, 1, 2, 0, 2, 3, 0, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 5, 7, null, null, null ], "w": [ 0, 0, 0, 0, 100, 30, 130, 0, 0, 0, 0, 100, null, null], "m": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 264 ] } } } }

There can be electrical and gas data. The data is split up between heating and cooling (if available). There are three arrays of data available. "d" contains 24 fields spread over the current day and the day before. d[0] => 00:00-02:00 yesterday d[1] => 02:00-04:00 yesterday ... d[22] => 20:00-22:00 today d[23] => 22:00-24:00 today

"w" contains 14 fields spread over this week and last week. w[0] => Monday last week w[1] => Tuesday last week ... w[12] => Saturday this week w[13] => Sunday this week

"m" contains 24 fields spread over this year and last year. m[0] => January last year m[1] => February last year ... m[22] => November this year m[23] => December this year

Due to the structure of the data, some fields can be empty (null), which means data is not (yet) available for this timeslot.

Consumption data is expected to be updated every 2 hours, randomized from the startup time of the Daikin device. This means that, for example, data d[0] will be available between 02:00 & 04:00.

revk commented 5 months ago

OK changing to 100wH units - beta issue shortly.

sm-Fifteen commented 5 months ago

I am happy to help testing various commands, can someone explain to me how to read / convert the results? as far as I understood they are hex, but also reversed?

Well, correct me if I am wrong, but some values need to be converted to decimal, others are fine as hex, but its always inverted.

I wonder if FM / GM is not simply counting up the kWh, in my case the value is 13123 (hex: 3343), which could be 1312,3 kWh and which is incrementing by 0.1 kWh as seen here. This would match the ONECTA App, where 0.1 kWh is the smallest unit. I dont have consumption data before last year (2023: ~500kWh), but if its a lifetime value, It could make sense since I have my AC almost 3 years.

Ah! It did seem weird to me that the energy reading value would depend on a device-dependent and possibly dynamic multiplier. FM/GM being hectowatt-hours makes a lot more sense.

I'll be sure to run tests of my own once the Faikin controllers for my multi-zone units get delivered, probably around monday.

44616E commented 5 months ago

OK changing to 100wH units - beta issue shortly.

Downloaded latest Beta on to my units, but now don't seem to have Wh in the State or Faikin MQTT messages. So can't compare the new values (I can only do this at night when the other loads are off as the power meter in for the whole building).

revk commented 5 months ago

Grr, I set to poll P not M, sorry. Try again in moment - making beta now.

44616E commented 5 months ago

Thanks, now getting WH. Looks good so far, will check it over night to see how it compares.

44616E commented 5 months ago

image Seems pretty good if averaged over a reasonable period of time. Over 20 minutes I got 3.3kw (converting from Wh to W) from Wh compared to around 3.28kW according to the meter.

sm-Fifteen commented 4 months ago

Ok, so I finally plugged in my Faikin boards, I've been trying out a few things.

So far, I can't get either of my units (two FTXS12LVJU connected to a single 2MXS18NMVJUA outdoor unit) to reply to an FM command. I have in fact rested the others listed here, and I'm getting this:

So energy monitoring could be something that's not supported on all models, possibly?

EDIT: I'll also note that, even though F6 is the command that reports whether powerful mode is turned on or off, and even though neither F6 (read) nor D6 (set) work, that unit very much has a powerful mode, and Faikin is unable to enable it, or recognize that it's on when turned on manually.

EDIT2: Enabling debug mode and fiddling with the controller, it seems like neither Powerful mode, neither Comfort mode (louvers go up while heating and down while cooling) or "intelligent eye mode" (target temp goes dow by 2C if there's been no movement in the room for 20+ minutes) in reflected by the output of the list of commands that Faikin knows at this time.

44616E commented 4 months ago

The link I posted earlier does say that its not supported on all models. It also appears that it may be an estimate. So far I have only tried it on my new premium units. I will try on my Daikin lites and a cassette latter.

I find at least for cooling the compressor frequency is pretty consistant with power consumption so if you don't have metering you could use that with a lookup table. But this would be model specific so not something that would make sense for the faikin to do it self.

44616E commented 4 months ago

When I get time to play around with the commands I would like to try and find humidity. It is reported on the inbuilt wifi (not connected by s21).

MassiPi commented 4 months ago

So energy monitoring could be something that's not supported on all models, possibly?

it's likely. I've still not tested, but i expect also my FTXSxxG2V1B units not to be able to report power consumption, like they cant report or set powerful and eco mode (even if the units HAVE these modes and they can be set with the remote controller) old units :)

Swalabrr commented 4 months ago

I have 2 daikins which were connected to onecta app from day one. I've just installed the faikins in them and I can confirm that the Wh value closely resembles what onecta app is reporting.

One daikin has a lifetime consumption of 423.1 kWh as reported in onecta 422100 Wh as reported in faikin

the other one 229.7 kWh as reported in onecta 230100 Wh as reported in faikin.

So, I'm here to confirm that what faikin is reporting is correct. Hopefully you will soon add the HA sensor for energy :D

revk commented 4 months ago

What's the HA JSON config for that?

44616E commented 4 months ago

EDIT2: Enabling debug mode and fiddling with the controller, it seems like neither Powerful mode, neither Comfort mode (louvers go up while heating and down while cooling) or "intelligent eye mode" (target temp goes dow by 2C if there's been no movement in the room for 20+ minutes) in reflected by the output of the list of commands that Faikin knows at this time.

Powerful mode also doesnt work properly for me. It can report powerful mode from the remote, but if set by faikin it toggles on and off repeatedly and doesnt seem to do anything. I guess we should start a seperate issue for it.

sm-Fifteen commented 4 months ago

So energy monitoring could be something that's not supported on all models, possibly?

it's likely. I've still not tested, but i expect also my FTXSxxG2V1B units not to be able to report power consumption, like they cant report or set powerful and eco mode (even if the units HAVE these modes and they can be set with the remote controller) old units :)

My units are only 2 years old, though, even though the LV series heads are older (but still the most efficient) and the MXS multizone series not the highest end of their multizone range (which would be MXL/Aurora). Regarding the missing signals, I wonder how the official wired controllers do. Do tgey have extra commands we haven't found yet?

EDIT2: Enabling debug mode and fiddling with the controller, it seems like neither Powerful mode, neither Comfort mode (louvers go up while heating and down while cooling) or "intelligent eye mode" (target temp goes dow by 2C if there's been no movement in the room for 20+ minutes) in reflected by the output of the list of commands that Faikin knows at this time.

Powerful mode also doesnt work properly for me. It can report powerful mode from the remote, but if set by faikin it toggles on and off repeatedly and doesnt seem to do anything. I guess we should start a seperate issue for it.

Probably, yeah.

EDIT: Actually that looks like a different issue. My unit simply does not respond to F6/F7 messages, and looking at the publically available service manuals, it appears like it could be related to how neither the wired Nav controller (BRC1E73), nor the brand new Daikin One+ smart thermostats (which have a "boost mode", but only for "unitary" ducted models, not S21 or P1P2), nor the older DKN Cloud/DKN Plus (rebranded Airzone Aidoo adapters, either AZAI6WSCDKB or AZAI6WSPDKC, respectively) have any kind of support or understanding of the powerful (and apparently Comfort airflow) modes that are specific to some wall-mounted or "floor-mounted" units.

Swalabrr commented 4 months ago

What's the HA JSON config for that?

i've managed to add lifetime energy as a sensor in HA with the following configuration.yaml changes:

mqtt: sensor:

it does add the entity in HA, but the entity has no parent device.

revk commented 4 months ago

OK, added to latest beta, let me know if that works.

Swalabrr commented 4 months ago

image

yup, it works!

Thank you!

MassiPi commented 4 months ago

So energy monitoring could be something that's not supported on all models, possibly?

yes i can confirm, also on my (old) FTXSxxG units no F6, F7, FM and FP replies, so no powerful, silent, power consumption etc. would be nice to have a table of available info/functions for split model.. today's table is just, more or less, S21 working or not