jacekk015 / zha_quirks

All quirks in one place
MIT License
146 stars 20 forks source link

_TZE200_rtrmfadk preset setting broken #36

Closed mircohacker closed 8 months ago

mircohacker commented 1 year ago

Hi,

I added a new TRV from AVATTO ( _TZE200_rtrmfadk TS0601 ) to my HA setup (container, latest quirk, HA version 2023.11.2). After adding this quirk everything seemed to work fine. But after a day I recognized that the TRV seems to follow a schedule which was not set up by me. After trying to switch the preset to something without a schedule, I found out that the quirk does not seem to expose this setting correctly

image

This seems to be the relevant lines from the full debug log

2023-11-22 22:11:01.785 WARNING (MainThread) [zigpy.util] Error calling listener <bound method RtiThermostat.hass_climate_state_change of <ts0601_trv_rtitek.RtiThermostat object at 0x7f60005790>> with args (514, 150): TypeError("int() argument must be a string, a bytes-like object or a real number, not 'NoneType'")
2023-11-22 22:11:01.786 DEBUG (MainThread) [zigpy.util] Error calling listener <bound method RtiThermostat.hass_climate_state_change of <ts0601_trv_rtitek.RtiThermostat object at 0x7f60005790>> with args (514, 150)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/util.py", line 61, in listener_event
    result.append(method(*args))
                  ^^^^^^^^^^^^^
  File "/config/custom_zha_quirks/ts0601_trv_rtitek.py", line 442, in hass_climate_state_change
    state = 0 if (int(temp_current) >= int(temp_set)) else 1
                  ^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Sadly I have not the slightest clue how to fix this. If you need more information, ping me and i will do my best.

jacekk015 commented 1 year ago

That's not Preset. That's a System Mode. Preset are supported in the quirk code, but to show the Presets in HA GUI code in ZHA needs to be modified. TRV signature needs to be added.

mircohacker commented 1 year ago

Ah good to know. Can you tell me how to switch the default preset to fully manual?

mircohacker commented 1 year ago
image

Maybe writing this value will be sufficient. I will update the issue tomorrow to report if it did work.

TheoKusters commented 1 year ago

Hi, I have the same issue with this device. I installed the quirk and the device was recognized correctly by zha. I noticed on the devices oled display that a schedule was active. After changing the operation_preset to Preset.Manual the schedule icon disappeared. Some hours later the schedule was activated again, so it seems that the preset change was only active within the current schedule window.

The question now is: how to remove/inactivate the schedule?

Any idea will be appreciated.

jacekk015 commented 1 year ago

@TheoKusters Best is to read the manual if any was added. In my quirk and also in Z2M modes are: auto, manual, on, off https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/tuya.ts#L3159

TheoKusters commented 12 months ago

@jacekk015 thanks for your reply, much appreciated the device itself came with a very basic manual. I am using ZHA so Z2M is not an option (yet)

The quirk business is new for me but looking at the code I thought that the section

    def mode_change(self, value):
        """System Mode change."""
        if value in (1, 2, 3):
            operation_preset = self.Preset.Manual
            prog_mode = self.ProgrammingOperationMode.Simple
            occupancy = self.Occupancy.Occupied
        elif value == 5:
            operation_preset = self.Preset.Boost
            prog_mode = self.ProgrammingOperationMode.Simple
            occupancy = self.Occupancy.Occupied
        else:
            operation_preset = self.Preset.Schedule
            prog_mode = self.ProgrammingOperationMode.Schedule_programming_mode
            occupancy = self.Occupancy.Occupied

is switching the device to the predefined schedule is some cases, or am I incorrect?

Can you point me to some documentation about working with quirks?

Many thanks

Alan5001 commented 12 months ago

Hi guys,

same problem here ...

Better Thermostat seems to regulate the temperature correct (purple line). Something else is riding a rollercoaster (Blue line, which is the real temperature measured by an ecternal thermometer).

Unfortunately i can't paste images here, maybe you can have a look here:

https://community.simon42.com/t/thermostat-mit-eigenleben/13006

I wrote 2 attributes manually:

RTI_MODE_ATTR = 0x0401 # [0] schedule [1] manual [2] off [3] on <- i'd set it to 1 (manual) (-> RtiManufCluster (Endpoint id: 1, Id: 0xef00, Type: in) -> mode (id: 0x0401))

RtiThermostat (Endpoint id: 1, Id: 0x0201, Type: in) -> operation_preset (id: 0x4002) <- Set to Preset.Manual

Didn't work, rollercoaster is still rolling 🤷‍♀️ Temperature goes up, down, up, down .... heating is on, off, on, off ,,, but not under control of Better Themostat.

Besides this, every day at 12 o'clock the system switches to 15° for a few minutes, no other automation is interfering.

The ghost in the machine ? 😱

Alex

jacekk015 commented 11 months ago

Heating state was corrected. It was steered in two places. RTI TRV has attribute which shows when TRV has heat state: on/off There's was also an older code which assumed it from temp difference - between room temp and target temp.

Alan5001 commented 11 months ago

I've meanwhile switched the TRV so it'll take some time, maybe til weekend, to test the changes. Nevertheless thanks for your effort,i WILL test the changes in any case 😉👍

Alan5001 commented 11 months ago

Hi,

it took some time, but i have tested the changes, and for the last 3 days it looked very good !

Thanks 👍

glcos commented 11 months ago

Not sure if my issue might be related to this, I'm testing this Avatto thermostat with the quirk provided.

avatto

The thermostat works pretty well, only the clock is not syncing, but I have an annoying issue: once in a while the screen goes into a sort of scheduling programming. I want it to be only manual, no scheduling or advanced programming, but I'm not able to get rid of this screen that appears every 1 or 2 days apparently with no reason. Any idea is much appreciated. avatto-thermostat

jacekk015 commented 11 months ago

HA doesn't send anything itself to Thermostat. Maybe device is complaining about schedule not set. You can always set a flat schedule. One temp for all days. It's nothing connected to HA or Zigbee.

For the clock issue. I need to see HA debug level logs. You need to remove device and pair like a brand new. Wait up to 10 minutes for the initialization process to end. Post the logs.