Python plugin for MOES BHT-002 Termostat

For heating/cooling related questions in Domoticz
Post Reply
vanbasten
Posts: 2
Joined: Tuesday 04 December 2018 21:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Python plugin for MOES BHT-002 Termostat

Post by vanbasten » Tuesday 04 December 2018 21:38

Hi,
I need help connecting domoticz and MOES BHT-002 thermostat series (https://www.aliexpress.com/item/WiFi-Th ... 5ff5a881fe.

Currently thermostat is controlled with Smart Life APP (Alexa) and working fine, but I want to control it via domoticz.

So, I was wondering if you guys could point me in right direction regarding documentation or there is already a plugin for domoticz which can control above mentioned thermostat series.

Thanks in advance!

vanbasten
Posts: 2
Joined: Tuesday 04 December 2018 21:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin for MOES BHT-002 Termostat

Post by vanbasten » Thursday 06 December 2018 21:32

After some research using tuya-cli I found that there are actually all informations that we need in order to write domoticz plugin for above mentioned thermostat series:

here are some examples of data gathered with tuya-cli:

dev:~# tuya-cli get --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --dps 1
true
dev:~# tuya-cli get --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --dps 2
50
dev:~# tuya-cli get --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --dps 3
45
dev:~# tuya-cli get --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --dps 4
1
dev:~# tuya-cli get --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --dps 5
false
dev:~# tuya-cli get --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --dps 6
false

and explained :
--dps 1 true/false - true when device is on, false for off
--dps 2 number - desired temperature divided by 2 (25 degrees are shown as 50)
--dps 3 number - current temperature divided by 2 (22.5 degrees are shown as 45)
--dps 4 0/1 - 0 for scheduled mode, 1 for manual mode
--dps 5 not sure
--dps 6 not sure

Since I have no experience in writing plugins for domoticz, and we have all data needed, it would be cool if someone could step in and help with the plugin.

Cheers


EDIT:

using set command we can set:
desired temperature...

dev:~# tuya-cli set --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --set 60 --dps 2
Set succeeded.

or turn on/off the thermostat...
dev:~# tuya-cli set --ip 192.168.6.105 --id 65363xxx --key ff87122xxx --set false --dps 1

sheduled/manual mode setting via tuya-cli ends with:
{ Error: Error communicating with device. Make sure nothing else is trying to control it or connected to it.
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '192.168.6.105',
port: 6668 }

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest