This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Dyson Pure Hot+Cool
#1
Has anyone connected a Dyson Pure Hot+Cool 2018 (244289-01) or maybe another Dyson product that used the same protocol?


https://shop.dyson.nl/dyson-ventilatoren...-244289-01
Reply
#2
There are some Python libraries for control: https://github.com/CharlesBlonde/libpurecoollink

Internally MQTT is used which is supported by LM, but you need to get credentials before MQTT connection is possible.
Reply
#3
(15.02.2019, 08:34)admin Wrote: There are some Python libraries for control: https://github.com/CharlesBlonde/libpurecoollink

Internally MQTT is used which is supported by LM, but you need to get credentials before MQTT connection is possible.

I already installed this device on my local network and have the right credentials for the Dyson app. How to start?
Reply
#4
Use standard MQTT example without encryption. Username is device serial number, password value are device credentials.

This resident script will connect to MQTT and subscribe to status topic. See logs tab for output result.

Code:
-- product types
DYSON_PURE_COOL_LINK_TOUR = '475'
DYSON_PURE_COOL_LINK_DESK = '469'
DYSON_PURE_HOT_COOL_LINK_TOUR = '455'
DYSON_360_EYE = 'N223'

broker = '192.168.1.1' -- default port is 1883
username = '...' -- device serial
password = '...' -- device credentials
producttype = DYSON_PURE_HOT_COOL_LINK_TOUR

topic = producttype .. '/' .. username .. '/status'

mqtt = require('mosquitto')
client = mqtt.new()

client.ON_CONNECT = function(status, rc, err)
  if status then
    log('connect ok')
    client:subscribe(topic)
  else
    log('connect error', rc, err)
  end
end

client.ON_MESSAGE = function(mid, topic, data)
  log('message', topic, data)
end

client:login_set(username, password)
client:connect(broker)
client:loop_forever()
Reply
#5
where to find the mosquitto module?

Resident script:19: module 'mosquitto' not found:
no field package.preload['mosquitto']
no file './mosquitto'
no file 'Library mosquitto'
no file 'Library mosquitto'
no file 'Library mosquitto.so'
stack traceback:
[C]: in function 'require'
Reply
#6
Install these packages:

http://dl.openrb.com/pkg/libmosquitto_1.6.3-1_imx6.ipk
http://dl.openrb.com/pkg/luamosquitto_0.3-2_imx6.ipk
Reply
#7
(12.07.2019, 09:47)admin Wrote: Install these packages:

http://dl.openrb.com/pkg/libmosquitto_1.6.3-1_imx6.ipk
http://dl.openrb.com/pkg/luamosquitto_0.3-2_imx6.ipk

and for a lm4?
Reply
#8
http://dl.openrb.com/pkg/libmosquitto_1.6.3-1_mxs.ipk
http://dl.openrb.com/pkg/luamosquitto_0.3-2_mxs.ipk
Reply
#9
yes, packages are installed.

But how to find the password (device credentials) or is it possible to generate it?
Reply
#10
I think i need to get device information over HTTPS:
https://github.com/CharlesBlonde/libpure...k/dyson.py


Code:
https = require 'ssl.https'
require('json')
socket.http.TIMEOUT = 5
local cUsername = 'xxxxxxxxx@xxxxxxxx.nl'
local cPassword = 'xxxxxxxxxxxxxx'

-- get session info
local cBody = '{"Email":"' .. cUsername .. '","Password":"' .. cPassword ..'"}'
local cReq = {}
local cUrl1 = 'https://api.cp.dyson.com/v1/userregistration/authenticate?country=NL'
result1 = https.request({
    url = cUrl1,
    method = 'POST',
    headers = {
      ['content-length'] = #cBody,
      ['content-type'] = 'application/json'
    },
    source = ltn12.source.string(cBody),
    sink = ltn12.sink.table(cReq)
})
if result1 and cReq then
  log(cReq)
  cAuth = cReq
else
  log(result1)
end


result:

Code:
* table:
[1]
  * string: {"Account":"xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx-xxxxxxx","Password":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}

How to get the account and password value in the following GET request to receive al devices from: /provisioningservice/manifest
Reply
#11
Send GET request to https://api.cp.dyson.com/v1/provisioning...e/manifest after the first one to get device list. You need to decode the first result using JSON and then pass AccountTongueassword values as Basic auth. See last example in HTTP docs: http://w3.impa.br/~diego/software/luasocket/http.html
Reply
#12
(4 hours ago)admin Wrote: Send GET request to https://api.cp.dyson.com/v1/provisioning...e/manifest after the first one to get device list. You need to decode the first result using JSON and then pass AccountTongueassword values as Basic auth. See last example in HTTP docs: http://w3.impa.br/~diego/software/luasocket/http.html

i added Account and Password settings to the code below, but i only get a 403 error.


Code:
mime = require("mime")
r, c = https.request {
  url = 'https://api.cp.dyson.com/v1/provisioningservice/manifest',
  method = 'GET',
  headers = { authentication = "Basic " .. mime.b64("xxxxxxxxx:xxxxxxxxxxxx") }
}
log(r,c)
Reply


Forum Jump: