Hi, I have few zigbee temp sensors with tuya ecosystem (not connected to HA) and I have DIY smart screen based on ESP8266. I would like to fetch temp data from those sensors but I do not know where to start. I do have iot.tuya.com account and I can get it to fetch in API explorer and postman but can’t do it with ESP. Getting token and adding sign headers is a bit tricky to do. I did not find any similar project around. Does anyone done something similar and can put me in a right tracks? :)

request looks like this for example:

curl --request GET “https://openapi.tuyaeu.com/v1.0/devices/XXXXXXX” --header “sign_method: HMAC-SHA256” --header “client_id: XXXXX” --header “t: XXXXX” --header “mode: cors” --header “Content-Type: application/json” --header “sign: XXXXX” --header “access_token: XXXXXX”

and I know that before that I need to request a token (or refresh it).

  • terragadyOPB
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    I am already fetching data from other source through https so this is already solved.

    Yes that is what I thought, other option is esp32 or raspberry pi zero to replace 8266. For the while I thought there might be some local shortcut of both devices are in the same network pinging directly ip address of the sensor (but this gets tricky with zigbee devices and hub but I also have WiFi sensors which i can use), did you hear about this method? I saw it somewhere where googling and it didn’t require as much authentication.