Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Moes Tuya BRT-100 #5701

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

EmJay276
Copy link
Contributor

@EmJay276 EmJay276 commented Jan 23, 2022

  • Fix resetting the preset after boosting (tuya.cpp - L847)
  • Add temperature offset for Moes Tuya BRT-100
  • Fix mode return from "off" to "heat" if heatsetpoint is increased on device itself back to >5°C

@EmJay276
Copy link
Contributor Author

Fixes a bug from #5153 (reset of boosting preset) and adds the temperature offset mentioned in #5153 and missing in #5501

@manup manup requested a review from Smanar January 27, 2022 00:54
Copy link
Collaborator

@Smanar Smanar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this command was missing, boost was bugged too.
No danger to break something.

@EmJay276
Copy link
Contributor Author

EmJay276 commented Feb 4, 2022

I also found another bug when the device was in "fake off" mode. If the temperature was increased on the device itself, the mode won't change from "off" to "heat". fixed with 783605e

@EmJay276
Copy link
Contributor Author

Can I bump this pull request or help merging it somehow?
I don't know who is repsonsible for this, @Smanar do you?

@Mimiix
Copy link
Collaborator

Mimiix commented Feb 18, 2022

@EmJay276 #5733

@EmJay276
Copy link
Contributor Author

@Mimiix Thanks for the link, I have already read this.
This pull request is a fix for 2 Bugs (and a missing temperatur offset when inital implemented), which should be fine according to #5733.

@Mimiix
Copy link
Collaborator

Mimiix commented Feb 18, 2022

@Mimiix Thanks for the link, I have already read this. This pull request is a fix for 2 Bugs (and a missing temperatur offset when inital implemented), which should be fine according to #5733.

They are all on hold. Note that 5733 is just a notification and explanation. It's up to @manup to approve prs.

@EmJay276
Copy link
Contributor Author

@Mimiix Thanks for the link, I have already read this. This pull request is a fix for 2 Bugs (and a missing temperatur offset when inital implemented), which should be fine according to #5733.

They are all on hold. Note that 5733 is just a notification and explanation. It's up to @manup to approve prs.

Ok thanks!
It would be great to merge this, so I can try to build a DDF file for this device without having to switch between two docker containers all the time!

@Smanar
Copy link
Collaborator

Smanar commented Feb 18, 2022

Using DDF is not possible for device that use tuya cluster yet.

@jeroen85
Copy link

Please merge this. I use the offset value to control the BRT-100 in combination with an external temperature sensor. This is not working now.

@Mimiix
Copy link
Collaborator

Mimiix commented Feb 24, 2022

@EmJay276 As Smanar notes: It isnt possible right now :(

@jjansen85 Please check my post earlier. IF you really need this, cloning the repo , merging the change and then compile yourself is the faster way.

@EmJay276
Copy link
Contributor Author

Is there any update on this topic?

@Smanar
Copy link
Collaborator

Smanar commented May 26, 2022

There is a PR to support tuya TRV in waiting list.
But no, still locked.

@EmJay276
Copy link
Contributor Author

Is there any update?

@Smanar
Copy link
Collaborator

Smanar commented Jun 30, 2022

Still locked #6054

@EmJay276
Copy link
Contributor Author

EmJay276 commented Sep 7, 2022

Any Update? Its almost a 3/4 year now for just 3 simple fixes...

@EmJay276
Copy link
Contributor Author

EmJay276 commented Nov 6, 2022

@jjansen85 if you or anyone else is interested, I just compiled a the rest-plugin from the current master branch including my fixes 59d3dc5
It is attached libde_rest_plugin.zip

Just replace it like described here https://github.com/dresden-elektronik/deconz-rest-plugin#get-and-compile-the-plugin (4.)
cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

@jeroen85
Copy link

jeroen85 commented Nov 6, 2022

@EmJay276 Thanks for your follow-up, appreciate your efforts!

Did not appreciate the fact that it is still not merged into this repository. Therefore, and some other minor issues, I switched to Zigbee2MQTT some months ago.

@EmJay276
Copy link
Contributor Author

EmJay276 commented Nov 6, 2022

Therefore, and some other minor issues, I switched to Zigbee2MQTT some months ago.

Do the BRT-100 work fine with Zigbee2MQTT? I also thought about switching...

@jeroen85
Copy link

jeroen85 commented Nov 6, 2022

Therefore, and some other minor issues, I switched to Zigbee2MQTT some months ago.

Do the BRT-100 work fine with Zigbee2MQTT? I also thought about switching...

Yes!

@EmJay276
Copy link
Contributor Author

I had issues connecting new lights in 2.19.1, merged 2.19.2-beta, now it works fine.
Current build: libde_rest_plugin_2.19.2-beta_e46689d.zip

@EmJay276
Copy link
Contributor Author

EmJay276 commented Jan 6, 2023

Current build 2.19.03
libde_rest_plugin_2.19.3_88988f9.zip

@EmJay276
Copy link
Contributor Author

EmJay276 commented Dec 5, 2023

Any news here?

@Mimiix
Copy link
Collaborator

Mimiix commented Dec 5, 2023

Asked manup to check.

@Smanar
Copy link
Collaborator

Smanar commented Dec 6, 2023

Hello, there is some problem for this PR, the c++ code is now able to manage tuya TRV, and the direction take by the plugin is more for remove all specific stuff.
Do you want to make a try with DDF to see if it's possible to avoid this PR ?

I assume you have the model "_TZE200_b6wax7g0" ? Do you know how work DDF ? To work this DDF need to be in the "tuya" folder because of relative path of some scripts, else we need to add the script file tuya_trv_preset_set.js (but for the moment this field is not enabled)

To start can try with

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_b6wax7g0",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Tuya TRV",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_THERMOSTAT",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0xef00"
      ],
      "meta": {
        "values": {
          "config/mode": {"auto": 0, "heat": 1, "temporary": 2, "holiday": 3}
        }
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/battery",
          "parse": {"fn": "tuya", "dpid": 14, "eval": "Item.val = Attr.val;"},
          "read": {"fn": "none"}
        },
        {
          "name": "config/offset",
          "parse": {"fn": "tuya", "dpid": 105, "eval": "Item.val = Attr.val * 10;"},
          "write": {"fn": "tuya", "dpid": 105, "dt": "0x2b", "eval": "Item.val / 10;"},
          "read": {"fn": "none"}
        },
        {
          "name": "config/heatsetpoint",
          "parse": {"fn": "tuya", "dpid": 2, "eval": "Item.val = Attr.val * 100;"},
          "write": {"fn": "tuya", "dpid": 2, "dt": "0x2b", "eval": "Item.val / 100;"},
          "read": {"fn": "tuya"}
        },
        {
          "name": "config/locked",
          "parse": {"fn": "tuya", "dpid": 13, "eval": "Item.val = Attr.val;"},
          "write": {"fn": "tuya", "dpid": 13, "dt": "0x10", "eval": "Item.val;"},
          "read": {"fn": "none"}
        },
        {
          "name": "config/windowopen_set",
          "parse": {"fn": "tuya", "dpid": 8, "eval": "Item.val = Attr.val;"},
          "write": {"fn": "tuya", "dpid": 8, "dt": "0x10", "eval": "Item.val;"},
          "read": {"fn": "none"}
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "config/mode",
          "values": [
              ["auto", 0], ["heat", 1], ["temporary", 2], ["holiday", 3]
          ],
          "parse": {"fn": "tuya", "dpid": 1, "eval": "if (Attr.val == 0) { Item.val = 'auto' } else if (Attr.val == 1) { Item.val = 'heat' } else if (Attr.val == 2) { Item.val = 'temporary' } else { Item.val = 'holiday' }"},
          "write": {"fn": "tuya", "dpid": 1, "dt": "0x30", "eval": "if (Item.val == 'auto') { 0 } else if (Item.val == 'heat') { 1 } if (Item.val == 'temporary') { 2 } else { 3 }"},
          "read": {"fn": "none"}
        },
        {
          "name": "config/preset",
          "parse": {"fn": "tuya", "dpid": 4, "script": "tuya_trv_preset.js"},
          "write": {"fn": "tuya", "dpid": 4, "dt": "0x30", "script": "tuya_trv_preset_set.js"},
          "read": {"fn": "none"}
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/valve",
          "parse": {"fn": "tuya", "dpid": 104, "eval": "Item.val = Attr.val > 5;"},
          "read": {"fn": "none"}
        },
        {
          "name": "state/temperature",
          "parse": {"fn": "tuya", "dpid": 3, "eval": "Item.val = Attr.val * 10;"},
          "read": {"fn": "none"}
        }
      ]
    }
  ]
}

Somes changes :

  • The device will have a battery level instead of a lowbattery
  • Config/preset is present but not used yet, if I remember your device support only "boost" ?
  • Config mode can be auto/heat/temporary/holiday.

And all the stuff with 5°C is not in place, not sure it will be possible yet.

@EmJay276
Copy link
Contributor Author

EmJay276 commented Dec 6, 2023

Thanks @Smanar, I will have a look at the DDF if I find some spare time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants