Closed backcountrymountains closed 1 year ago
There is a mask attribute to help with pulling individual values from a bitfield. But so far it has only been used in read-only sensors.
The permission denied may just be that you are using the wrong server (selected at top), or the specific API call you are trying to use requires special permission (most of the calls under General Devices Management and everything under Industrial General Device System is in that category, but"Get Device Information" about halfway down the General Devices Management section returns product_id, local_key and other info about the device itself)
@backcountrymountains I am also playing around with a good integration for the Pioneer WYT. I actually found that the existing Starlight Heatpump is pretty dang good, and the latest additions to it (not in a release build yet), introduces display/buzzer switches. While they appear to show whether these options are on or off, I can't actually seem to be able to "write".
Unrelated note, I have an actual power monitor to measure the power usage of my 18K BTU WYT mini split. I have been struggling with bad temperature regulation/erratic compressor duty cycle behavior on my unit, so I have been digging deep logging room temperature, and my mini split power. I figured out that with id 116, and a scale of 30, there is really dang good correlation between actual measured power, and reported power.
- entity: sensor
class: power
category: diagnostic
name: Power
dps:
- id: 116
type: integer
name: sensor
unit: "W"
class: measurement
mapping:
- scale: 30
If you don't mind giving it a try and reporting back with a similar 1 day plot of your power usage, that would be awesome! I am trying to understand what kind of compressor duty cycle behavior is normal when these WYT mini splits are working to maintain room temperature. In the image below, pink is the "calculated power" (ignore the beginning where it's much higher than blue, I was trying to figure out the correct scale), and blue is the actual power I am measuring with a clamp current sensor.
30 seems like an odd factor, but if the unit is BTU/h, then a factor of 29.3 would match with the dp being 0.01 BTU/h readings.
30 seems like an odd factor, but if the unit is BTU/h, then a factor of 29.3 would match with the dp being 0.01 BTU/h readings.
That's an interesting point. I was also confused by how odd 30 was, but you bring up a good point. However, if this dp is "requested BTU/h", it's unlikely to match the exact electrical power like it seems to, since that would assume 100% efficiency. Not really sure what the relationship is, but it seems to track actual measured electrical power surprisingly well.
@aeozyalcin I tried adding the sensor you posted but tuya-local doesn't seem to recognize DP 116 on my device. I went to iot.tuya.com and I can get logged values from DP 116 (it's written in Chinese in the drop-down the website). The values do seem to correspond to the requested BTU/h or watts of the device (the values range from 246 when off and 4000 - 20000 when on).
How do I force tuya-local to query DP 116? Right now it just says "Unknown". I had to add optional: true
to the config to even be able to select the modified device template because tuya-local kept saying missing required DPs: [{'116': 'int'}]
The logs I posted above show that tuya-local doesn't see DP 116, even though iot.tuya.com is collecting that data. I don't know if I should open up a separate issue for that.
@aeozyalcin I tried adding the sensor you posted but tuya-local doesn't seem to recognize DP 116 on my device. I went to iot.tuya.com and I can get logged values from DP 116 (it's written in Chinese in the drop-down the website). The values do seem to correspond to the requested BTU/h or watts of the device (the values range from 246 when off and 4000 - 20000 when on).
How do I force tuya-local to query DP 116? Right now it just says "Unknown". I had to add
optional: true
to the config to even be able to select the modified device template because tuya-local kept sayingmissing required DPs: [{'116': 'int'}]
The logs I posted above show that tuya-local doesn't see DP 116, even though iot.tuya.com is collecting that data. I don't know if I should open up a separate issue for that.
I think you forgot to attach your logs. But here is a rough template of how I have the power in my yaml. Once you save the yaml, make sure to reload the integration. And let me know! I am still struggling with bizarre/bad temperature regulation with my WYT, looking forward to seeing how your heat pump power varies throughout the day.
name: Pioneer heatpump
primary_entity:
entity: climate
translation_key: aircon_extra
dps:
- id: 1
...
...
...
secondary_entities:
- entity: sensor
class: power
category: diagnostic
name: Power
dps:
- id: 116
type: integer
name: sensor
unit: "W"
class: measurement
mapping:
- scale: 30
My logs are in the first comment.
My device config is like this for DP 116. I had to add the optional: true
because tuya-local doesn't see DP 116 and won't let me select a config that requires DP 116 without the optional
tag:
name: Pioneer WYT Mini Split AC/Heat Pump
primary_entity:
entity: climate
translation_key: aircon_extra
dps:
- id: 116
name: unknown_116
type: integer
optional: true
secondary_entities:
- entity: sensor
class: power
category: diagnostic
name: Power
dps:
- id: 116
optional: true
type: integer
name: sensor
unit: "W"
class: measurement
mapping:
- scale: 30
This config creates a sensor for DP 116 but doesn't get the values from the device. I don't understand why tuya-local doesn't get the values but iot.tuya.com does have extensive logs of the values for DP 116.
Does your device report humidity on DP 18? My device doesn't show humidity either.
I don't have a humidity reporting either. Actually, I don't think the WYT series has a humidity sensor fitted at all.
Have you seen @make-all's suggestion on this issue?
The permission denied may just be that you are using the wrong server (selected at top), or the specific API call you are trying to use requires special permission (most of the calls under General Devices Management and everything under Industrial General Device System is in that category, but"Get Device Information" about halfway down the General Devices Management section returns product_id, local_key and other info about the device itself)
Yeah, that was an issue I was having with iot.tuya.com but was probably just due to multiple apps trying to query the device, which it doesn't like.
I've been playing around with the device and everything seems to be connecting working but I have no DP 116. I think I might be facing an issue similar to this tinytuya problem, where the energy or BTU/h is calculated from a different DP on my device, which is then logged in the tuya cloud on DP 116, but is not accessible on the device itself.
Can you check the Device Update
section of the Tuya app for your mini-split? Mine says Main Module: V1.0.0
MCU Module: V1.0.0
Maybe we have slightly different devices. I know Pioneer very similar but slightly different models of mini-split.
The Tuya IOT project I have is in the Western American Data Center. I have these services authorized for the project.
My main module is v1.1.14 and MCU module is V1.0.0. This is on a brand new Pioneer WYT Diamante Ultra 18K BTU unit I installed just last month.
Maybe I have an old module. I installed the mini split last year but only got the tuya module this year. When you first ran the tuya-local add device integration, did you make a log of the DPs like in my first post? Does yours show DP 116 in that list? the integration might even show you that information if you set the log level to debug:
service: logger.set_level
data:
custom_components.tuya_local: debug
and check the logs.
So your Tuya module is not a USB stick then? My unit came with the Tuya USB stick, but I think the non diamante ultra units require a different module that plugs directly into the mainboard through a connector, rather than through USB. I will report back with the logs.
Yes, mine is a unit that plugs into the mainboard: https://www.homedepot.com/p/Pioneer-Wireless-Internet-Access-and-Control-Module-For-WYT-Model-Mini-Split-System-TST-DIAWIFITPD/314610125#overlay
Hey, @aeozyalcin, can you post the result of querying DpID 110? It is a bitmask that shows what functionalities are available on the device. I wrote about it in jasonacox/tinytuya#391.
If you set custom_components.tuya_local: debug
it should be in the HA log output.
[custom_components.tuya_local.device] Pioneer WYT Mini Split AC/Heat Pump received {"1": false, "2": 780, "3": 25, "4": "cold", "5": "high", "18": 0, "20": 0, "101": 0, "105": "off", "110": 2228796, "113": "0", "114": "0", "119": "0", "120": "off", "123": "0010", "125": "great", "126": "0", "127": "0", "128": "0", "129": "1", "130": 26, "131": false, "132": false, "133": "0", "134": "{\"t\":1690814535,\"s\":false,\"clr\":true}", "full_poll": true}
The value of DpID 110 on mine, 2228796, seems to indicate that it doesn't support power logging, despite iot.tuya.com
having power logs. It's pretty weird.
Thanks.
Here is my log entry @backcountrymountains :
Living Room Heat Pump received {"1": true, "2": 740, "3": 22, "4": "cold", "5": "auto", "18": 0, "20": 0, "101": 0, "105": "off", "110": 2241084, "113": "1", "114": "1", "116": 2806, "119": "0", "120": "off", "123": "0000", "125": "great", "126": "0", "127": "0", "128": "0", "129": "1", "130": 26, "131": false, "132": false, "133": "3", "134": "{\"t\":16,\"s\":false,\"clr\":true}", "135": 1, "full_poll": true}
Thanks @aeozyalcin. That's definitely a different output than what I get from my WYT. I can't believe that the Pioneer people have different versions of Tuya integrations for such similar equipment.
I also can't understand how iot.tuya.com
can see DPiD 116 but I have no access to it. I think hacking the Tuya module is outside my skill level.
I've made some changes to the Daizuki config based on your findings, thanks.
@make-all the problem I have been facing is that the heat pump always reports current temperature in Celcius, while the set temperature unit depends on whether the heat pump remote is set to Celcius or Fahrenheit. Most Pioneer units will be Fahrenheit, since the brand is North American.
I haven't figured out a way to tell tuya-local/home assistant that the units are different between set temperature and current temperature. So when my heat pump is in Fahrenheit, the climate entity in HA accepts set temp in Fahrenheit correctly, but also incorrectly assumes current temperature is reported in Fahrenheit, so it shows "22 F", when it should say something like "71.6F". Declaring different units for DP ID 1 & 2 did not fix this issue.
The Daizuki config splits out current temperature into its own sensor to work around this. It is basically the only difference between Daizuki and starlight, which should also be compatible with the pioneer when set to Celsius
@aeozyalcin I just did a mapping of C to F in my config for the DpID 3, which is the current temperature on mine:
- id: 3
name: current_temperature
type: integer
mapping:
- dps_val: 15
value: 59
- dps_val: 16
value: 61
- dps_val: 17
value: 63
- dps_val: 18
value: 64
- dps_val: 19
value: 66
- dps_val: 20
value: 68
- dps_val: 21
value: 70
- dps_val: 22
value: 72
- dps_val: 23
value: 73
- dps_val: 24
value: 75
- dps_val: 25
value: 77
- dps_val: 26
value: 79
- dps_val: 27
value: 81
- dps_val: 28
value: 82
- dps_val: 29
value: 84
- dps_val: 30
value: 86
- dps_val: 31
value: 88
- dps_val: 32
value: 90
unit: F
Since the values are integer
I'm not sure how exactly to make them more accurate with a decimal using the scale
mapping (is it possible?) but it works well enough for me since it's just a sensor reading, not the setpoint.
This is just a mini-split type air conditioner/heat pump. I think it's very similar to the
daizuki_heatpump.yaml
thattuya-local
suggested. But there are some settings that I'd like to add that I need help with: There are two bytes at DPid: 123 that seem to be a string of binary booleans. I don't think I'm saying that right but:So Display on/off is in position 5 from the left:
01000
. Beep on/off is position 6 from the left:10000
and if they are both on it's:11000
Looking at the
devices/README.md
it seems like this is abitfield
, but I don't see any info on how to deal with mapping thebitfield
to switches to control the display or beeping of the air conditioner.I have no idea what I'm doing.
Please help! Thanks!
Log Message
Information about DPS mappings
I went through iot.tuya.com and translated the Chinese words and added some description, just to get an idea:
Product ID
Listen, I keep getting "permission deny" so something is not working with IoT tuya connecting to my device.
Information about how the device functions
Just a mini-split