Ledvance WiFi bulbs

Seems like cmd.exe handles string parameters differently. It would work without qotes:

frida-trace -U --decorate -j *!*encodeString*/isu -F

I’m glad I could help!

1 Like

Awesome! Powershell gave me an error, buyt running without quotes in cmd did the trick!

I’m guessing the device_id is easy to obtain?

In the app you can see the device_id as the Virtual ID:

Awesome, thanks! Should be easy to do then :slight_smile:

EDIT: The device_id string can also be found named “devId” in the blob.

I’m guessing that there is no reason to sign up for an Tuya IOT dev account anymore, as we got the localkey this other way, correct?

That is correct, if you use this method and local tuya, there is no need for the tuya iot account.

@Flag you are awesome !!!

Worked :slight_smile:

Unfortunately, I have now another question about the Tuya local integration.

How do you configure this part:

Well an enormous THANK YOU to @Flag for his android VM tuto (although, being on Linux, that was a bit different) and @FrancYescO for his frida instructions.
I finally managed to connect my Ledvance Flex Neon to Hass.
NOT THANKS TO Ledvance though.

@rgrabot You need to test-and-tweak the values in this screen. I used the setting 20 for the ID, then you can submit, try, change, retry etc. You should keep an eye on the dev tools “states” screen on Hass while changing the value in the Ledvance app to check if you have settings swapped and their min/max values.

Here is what it looks like for my neon flex :


(min/max for color are 1500/2700, for brightness 0/1000)

@rgrabot For finding the correct values in local tuya, I found this reddit post which helped me a lot:

3 Likes

if frida-trace says “tracing 0 functions” just reboot your pc and android device, i’ve also got this issue but it got just solved doing “nothing”

AFAIK is not ever possibile to register these LDV devices on the tuya IOT cloud platform with a dev account as there is no way to link LDV account/devices to the platform.

1 Like

Hey guys! Will this method also work with the Ledvance Smart+ plug? Link: https://www.ledvance.com/consumer/products/smart-home/smart-home-products-with-wifi-technology/smart-home-components/plug-with-smart-socket-to-control-non-smart-devices-with-wifi-technology--pairable-with-remote-controller-c6482

pretty sure, on any device that can be registered on LDV SMART+ WiFi app (or better, with any device on any app that uses tuya WiFi SDK)

Hello , on my side i create a link with ledvance / amazon echo , amazon echo / node red , node red/ home assistant.
procedure:
1 ) connect ledvance light bubble rgb to amazon-echo , by official skills
2 ) in node red , install palette node-red-contrib-alexa-cakebaked ,node-red-contrib-home-assistant-websocket
3 ) in Home assistant , create virtual light
configuration.yaml

  - platform: template
    lights:
      theater_lights:
        friendly_name: "Couloir"
        temperature_template: "{{states('input_number.temperature_input') | int}}"
        color_template: "({{states('input_number.h_input') | int}}, {{states('input_number.s_input') | int}})"
        turn_on:
        turn_off:
        set_temperature:
          service: input_number.set_value
          data:
            value: "{{ color_temp }}"
            entity_id: input_number.temperature_input
        set_color:
          - service: input_number.set_value
            data:
              value: "{{ h }}"
              entity_id: input_number.h_input
          - service: input_number.set_value
            data:
              value: "{{ s }}"
              entity_id: input_number.s_input'

create input_number.h_input , input_number.s_input , input_number.temperature_input in HA

reboot home assisant

4 ) import link home assistant / node red (amazon echo link)

import :

[
    {
        "id": "651912d81a7df79b",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": ""
    },
    {
        "id": "2c472ab101a962a8",
        "type": "debug",
        "z": "651912d81a7df79b",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 510,
        "y": 240,
        "wires": []
    },
    {
        "id": "9711700c818980e7",
        "type": "inject",
        "z": "651912d81a7df79b",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "15",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 240,
        "wires": [
            [
                "7786a2d4840a0b5e"
            ]
        ]
    },
    {
        "id": "d8bc583ad1eb3b36",
        "type": "alexa-remote-routine",
        "z": "651912d81a7df79b",
        "name": "",
        "account": "20cf3dbd61cfc4c6",
        "routineNode": {
            "type": "node",
            "payload": {
                "type": "serial",
                "children": [
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "setColor",
                            "value": {
                                "type": "msg",
                                "value": "payload.color_hex"
                            }
                        }
                    },
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "setBrightness",
                            "value": {
                                "type": "msg",
                                "value": "payload.brightness"
                            }
                        }
                    },
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "turnOn"
                        }
                    }
                ]
            }
        },
        "x": 780,
        "y": 280,
        "wires": [
            []
        ]
    },
    {
        "id": "7786a2d4840a0b5e",
        "type": "alexa-remote-init",
        "z": "651912d81a7df79b",
        "name": "",
        "account": "20cf3dbd61cfc4c6",
        "option": "initialise",
        "x": 320,
        "y": 240,
        "wires": [
            [
                "2c472ab101a962a8"
            ]
        ]
    },
    {
        "id": "375b230a2c31d081",
        "type": "inject",
        "z": "651912d81a7df79b",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "00 12 * * 2,5,0",
        "once": false,
        "onceDelay": "20",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 300,
        "wires": [
            [
                "7786a2d4840a0b5e"
            ]
        ]
    },
    {
        "id": "c00be3f8150254ff",
        "type": "alexa-remote-routine",
        "z": "651912d81a7df79b",
        "name": "",
        "account": "20cf3dbd61cfc4c6",
        "routineNode": {
            "type": "node",
            "payload": {
                "type": "parallel",
                "children": [
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "turnOff"
                        }
                    }
                ]
            }
        },
        "x": 700,
        "y": 440,
        "wires": [
            []
        ]
    },
    {
        "id": "b66d450c6ff2ef81",
        "type": "server-state-changed",
        "z": "651912d81a7df79b",
        "name": "",
        "server": "2bfa934df7b2cf61",
        "version": 3,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "light.theater_lights",
        "entityidfiltertype": "exact",
        "outputinitially": true,
        "state_type": "str",
        "haltifstate": "on",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": false,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            }
        ],
        "x": 200,
        "y": 400,
        "wires": [
            [
                "1aa607e1e51f4050"
            ],
            [
                "c00be3f8150254ff"
            ]
        ]
    },
    {
        "id": "1aa607e1e51f4050",
        "type": "function",
        "z": "651912d81a7df79b",
        "name": "",
        "func": "function rgbToHex(r, g, b) {\n  return \"#\" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n}\n\nfunction hexToRgb(hex) {\n  var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n  if(result){\n      var r= parseInt(result[1], 16);\n      var g= parseInt(result[2], 16);\n      var b= parseInt(result[3], 16);\n      return r+\",\"+g+\",\"+b;//return 23,14,45 -> reformat if needed \n  } \n  return null;\n}\n\n\n\n\n\nvar o = msg.payload\nmsg.payload = o\nmsg.payload.state = o.state\nif (o.new_state.attributes.brightness < 0) \n{msg.payload.brightness = 0}\nif (o.new_state.attributes.color_temp < 0) \n{msg.payload.color_temp = 0}\nmsg.payload.brightness = o.new_state.attributes.brightness/2.55\nmsg.payload.color_temp = (1/o.new_state.attributes.color_temp)*1100000\n\nmsg.payload.color_hex = rgbToHex(o.new_state.attributes.rgb_color[0] ,o.new_state.attributes.rgb_color[1],o.new_state.attributes.rgb_color[2])\nif (o.new_state.attributes.color_temp === o.old_state.attributes.color_temp) \n{msg.payload.set_color = 0} else {msg.payload.set_color = 1}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 460,
        "y": 380,
        "wires": [
            [
                "ad5376e4eeb536ce"
            ]
        ]
    },
    {
        "id": "ad5376e4eeb536ce",
        "type": "switch",
        "z": "651912d81a7df79b",
        "name": "",
        "property": "payload.set_color",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "0",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "1",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 610,
        "y": 320,
        "wires": [
            [
                "d8bc583ad1eb3b36"
            ],
            [
                "9477aa1855584097"
            ]
        ]
    },
    {
        "id": "9477aa1855584097",
        "type": "alexa-remote-routine",
        "z": "651912d81a7df79b",
        "name": "",
        "account": "20cf3dbd61cfc4c6",
        "routineNode": {
            "type": "node",
            "payload": {
                "type": "serial",
                "children": [
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "setColorTemperature",
                            "value": {
                                "type": "msg",
                                "value": "payload.color_temp"
                            }
                        }
                    },
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "setBrightness",
                            "value": {
                                "type": "msg",
                                "value": "payload.brightness"
                            }
                        }
                    },
                    {
                        "type": "smarthome",
                        "payload": {
                            "entity": "385202c2-ac6d-4593-b92f-1a177a0851cd",
                            "action": "turnOn"
                        }
                    }
                ]
            }
        },
        "x": 780,
        "y": 320,
        "wires": [
            []
        ]
    },
    {
        "id": "9557fbf562e9aaf4",
        "type": "comment",
        "z": "651912d81a7df79b",
        "name": "couloir",
        "info": "",
        "x": 110,
        "y": 400,
        "wires": []
    },
    {
        "id": "20cf3dbd61cfc4c6",
        "type": "alexa-remote-account",
        "name": "",
        "authMethod": "proxy",
        "proxyOwnIp": "192.168.1.55",
        "proxyPort": "3456",
        "cookieFile": "/data/pass.txt",
        "refreshInterval": "3",
        "alexaServiceHost": "alexa.amazon.fr",
        "amazonPage": "amazon.fr",
        "acceptLanguage": "en-FR",
        "userAgent": "",
        "useWsMqtt": "on",
        "autoInit": "off"
    },
    {
        "id": "2bfa934df7b2cf61",
        "type": "server",
        "name": "Home Assistant",
        "version": 1,
        "legacy": false,
        "addon": false,
        "rejectUnauthorizedCerts": false,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    }
]

Adapt ip address of your raspberry py , country of your alexa_host, connect to your amazon account with link http:// your-ip:3456 and other adaptation

The import in nodered doesent work.

Can you export it in a txt file and put it here on the forum?

Thank you :smiley:

First of all a big thank you for that effort!
But I’m stumbling at Step 15.
Whenever I execute the 3rd commandline (adb shell “/data/local/tmp/frida-server &”) I get the following error message: /system/bin/sh: /data/local/tmp/frida-server: can’t execute: Is a directory
What is the trick about it?

you probably miswritted some command or wrongly placed files, as the command output is saying that /data/local/tmp/frida-server is a directory instead it should be a file…

execute adb shell "rm -rf /data/local/tmp/frida-server" and restart from step 15 after you are sure that you have a frida-server binary file in the same folder

A HUGE shoutout to all of you that made this work for me!
I finally got it. Don’t know exactly how and what I did wrong in first place though - but anyway.
You saved me from throwing that bulbs into the trash and buy an alternative ZigBee variant!

Thanks a LOT!

Hi all,

big thanks for figuring this out!

But - I need help :smiley:

I have followed the steps, did the pip Frida install, and downloaded the 5.0.17 server version. However, when I was running the frida server commands, and was running the last one “frida-server &”, I was getting the policy error that Flag was describing.
So I was checking the version of Frida trace - and it shows 5.0.19.
Any way to change it to 5.0.17?

I hope once that is sorted, the rest will work out too…

Damn! It worked once.
But now when I want to trace again the app in the emulator crashes and I get the error:
failed to attach: process with pid <PID> either refused to load frida-agent, or terminated during injection

Can I start all over from step 1 simply by deleting the frida directory?