Last summer I bought a socket in the action store:
Now is the time to disconnect from the cloud. It took a while, but I found descriptions of how to do it without disassembling the device and soldering the wires. I took advantage of https://github.com/tuya-cloudcutter/tuya-cloudcutter and https://github.com/openshwprojects/OpenBK7231T_App I used the existing configuration for the LSC Smart Connect Plug and the socket works without internet connection. Unfortunately, not everything was as in the original. I had only one blue LED for this, which should indicate the WiFi connection and indicated the activation of the relay. That's why I decided to look inside. The case was opened without damage. As you can see, the power supply is not isolated, so I do not recommend connecting to 230 V with the housing open. There may be a phase on the mass! I looked at the paths on the pcb from the MCU to the button, LEDs and relay. Inspection results: P6 - switching on the relay by R5 and Q1 P7 - SW1 button P8 - LED1 (red) P26 - LED2 (blue) Power supply 3.3 V and mass obvious and the others not connected. After assembling the case, I was able to modify the pin settings: On the left is the proposed configuration for a similar outlet, and on the right is my setting. The socket now works as I wanted, and although it lacks even a timer, I hope that soon the software will become similar to Tasmota.
As of yesterday, the firmware became compatible with ioBroker. To enable Tasmota-style TELE sending (necessary for the ioBroker sonoff plugin), flag 30 must be enabled. Demonstration:
Every now and then I see topics about replacing fw in these various factory devices.
Where can I find some information about this system to sort out what it is and what it can do?
I understand that it's about the fact that all these finished products use the same wireless module and by replacing the fw we gain direct control over them, setting what is connected to the built-in module?
What does the controls look like then? These modules connect to a local WiFi network, which we will write to them? And then we have an app that catches devices on this network that report?
I am interested in this because I am before designing an installation at home and it would be good to know what it can do, what devices are already figured out, which can be controlled, etc. I used to think about some kind of my own control, but life verifies it and unfortunately I don't have enough free time to do it in a reasonable period of time :/ Therefore, I would like to use something ready that can be adapted to the needs
I understand that it's about the fact that all these finished products use the same wireless module and by replacing the fw we gain direct control over them, setting what is connected to the built-in module?
It's not that good. There are more and more modules, the differences are sometimes big.
krisRaba wrote:
What does the controls look like then? These modules connect to a local WiFi network, which we will write to them? And then we have an app that catches devices on this network that report?
More or less like that, although today an app can be, for example, a web browser tab without a menu. If you have 2-3 of these devices, tabs in the browser for each device will probably be enough. But if we want to use the dependencies between devices more or we want to use some system, such as Home Assistant. I changed the firmware to disconnect from the cloud and get rid of the company's applications on the smartphone. It is no longer convenient when you need a dedicated application for each device. For me, it is more convenient to have access to the home LAN from the world than to send everything from home to the cloud to, for example, turn off the light in the next room. And these are the solutions we get by default when we buy a device and follow the manual.
Yes. HA, you can also give access to the world, the most important thing is that you have one application, no clouds in China, and you can manage it freely and some devices can influence others, etc etc.
Nice, I need to know about this It would suit me best if it was only locally or if so, from the outside, using some VPN, but that direct traffic from the net for devices would be impossible. I have to look if it can be done, e.g. on a router
I looked at the paths on the pcb from the MCU to the button, LEDs and relay.
After assembling the case, I was able to modify the pin settings:
I have a question for the experts on the subject. I look at these photos and in this socket there is a module that has very few pins brought out to the world, because in total, what else is needed in such a device. On the other hand, the pin configuration shows as many as 28 positions... Is it possible to buy a module that would have as many lines as possible, put it on your PCB and freely configure it, e.g. here PWM one, the other, here some on/offs, here inputs, etc.? And then add it to HA as your own module that does something there? Damn, because it would speed up the development and integration of some of your inventions :D
Are there any interface pushers in this as well? For example, from the HA level, define that it should push a frame to this module, which in turn sends further via its UART, or something else? :D
I watched a trailer for HA 2022.10 and I like it more and more I was so afraid it was contagious
Please note that I am answering in context mine project OpenBeken , although Tasmota for the popular ESP also has a scriptable Rules system, but I have not seen so many, for example, possible relays there (in the panel I can choose from 1 to ... 8):
krisRaba wrote:
On the other hand, the pin configuration shows as many as 28 positions... Is it possible to buy a module that would have as many lines as possible, put it on your PCB and freely configure it, e.g. here PWM one, the other, here some on/offs, here inputs, etc.? And then add it to HA as your own module that does something there? Damn, because it would speed up the development and integration of some of your inventions
Each free pin can be scripted and used, we are only limited by the fact that, for example, PWM data the MCU can only support on specific pins.
krisRaba wrote:
Are there any interface pushers in this as well? For example, from the HA level, define that it should push a frame to this module, which in turn sends further via its UART, or something else?
In my firmware, there are up to 64 channels with different roles, you can freely pair buttons, switches, relays, PWMs, ADC, you can trigger events based on readings or clicks (single, double, triple, quadruple click), you can create timers (e.g. turn off the relay after 5 minutes), you can control the peripherals (I add new drivers on a regular basis), etc... You can connect DHT11 and script it (without writing C code, in ready firmware, without HA) that when the temperature exceeds the limit, it performs some action (switches on the relay for 10 minutes) OpenBeken can also send and receive any things via MQTT or send e.g. GET to the server (and you can put measurement results into GET...)
Example for example with I2C:
p.kaczmarek2 wrote:
New I2C update! I added the MCP23017 driver. The MCP23017 is a 16-bit port expander. It allows you to connect e.g. 16 relays to a single I2C bus. In the current system, it is possible to map the 16 pins of the MCP23017 to OpenBeken channels. Here the command is used:
The command was used on the controller of 4 relays. Channels 5, 6, 7 etc. are mapped to expander bits. Here's what it looks like in the UI (I didn't bother adding all 16 channels, just a few): Here are the LEDs during the test: Here is the whole setup (ignore the TC74 temperature sensors on the I2C bus, let's focus on the MCP23017): With annotations: Now you may ask - why? Why 16 channels? Why MCP23017? This is because it allows you to use this module: That would be a very cheap and cool way to control multiple relays. Also, you can have multiple MCPs on the same I2C bus...
.
Another example, fan control on three relays, script at the user's request with simulation because I didn't have such a device :
p.kaczmarek2 wrote:
Hello again @digitalsko, thanks to our OpenBeken Device Simulator which allows me to simulate any device on Windows and create scripts quickly, I made the following script for you:
setChannelType 10 OffLowMidHigh
setChannelLabel 1 "Relay 1"
setChannelLabel 2 "Relay 2"
setChannelLabel 3 "Relay 3"
setChannelLabel 10 "Fan Speed"
// hide raw relay channel buttons from gui
setChannelVisible 1 0
setChannelVisible 2 0
setChannelVisible 3 0
// optional gui buttons
startDriver httpButtons
setButtonLabel 0 "Toggle Fan"
setButtonLabel 1 "Next Fan Speed"
setButtonCommand 0 Do_Power_Press
setButtonCommand 1 Do_Cycle_Press
setButtonEnabled 0 1
setButtonEnabled 1 1
// button colour
addChangeHandler Channel10 == 0 setButtonColor 0 red
addChangeHandler Channel10 != 0 setButtonColor 0 green
// off by default
setButtonColor 0 red
// translate fan state (0-4) to relay states
addChangeHandler Channel10 == 0 backlog SetChannel 1 0; SetChannel 2 0; SetChannel 3 0
// Fan on Low - R2 on
addChangeHandler Channel10 == 1 backlog SetChannel 1 1; SetChannel 2 0; SetChannel 3 0
// Fan on Medium - R2, R3 on
addChangeHandler Channel10 == 2 backlog SetChannel 1 1; SetChannel 2 1; SetChannel 3 0
// Fan on High - R2, R3, R4 on
addChangeHandler Channel10 == 3 backlog SetChannel 1 1; SetChannel 2 1; SetChannel 3 1
// change to OnClick if you want?
addEventHandler OnPress 11 Do_Power_Press
addEventHandler OnPress 9 Do_Cycle_Press
// power press will just toggle channel 10 - so if non zero it goes to 0, if zero, then goes to 1
alias Do_Power_Press toggleChannel 10
// cycle press will cycle values 0, 1, 2 and 3 for channel 10?
// AddChannel [ChannelIndex][ValueToAdd][ClampMin][ClampMax][bWrapInsteadOfClamp]
alias Do_Cycle_Press addChannel 10 1 1 3 1
I'm not sure if this is exactly what you need, but you can modify it to suit your needs and if there is any problem I can also do the modification for you. I'm here to help.
Here is a short presentation of the script:
You must update to the latest version to use all the features of this script.
Other examples:
Quote:
- CB2S + DHT11 test circuit: - WB2S + LCD 2x16 with I2C driver + MCP23017 port expander test circuit: - WB2S + bistable switch and potentiometer test circuit: - WB2S + IR receiver test circuit: - WB2S + Software SPI test: More about my test setups will be covered in dedicated OBK topic.
In the case of Tasmota you can easily run a lot of ready-made drivers on ESP, in the case of OpenBeken you can run on 'unknown Chinese modules' such as BK7231 (T and N), BL602, W800/W801, W600/W601, XR809 and soon more
Great, thank you very much for the above information.
So the scripting language can perform the logic on the module itself, that it performs its function independently. In addition, it can be connected, for example, with Home Assistant and there you can make some master schedules, monitor the status, etc A beautiful thing
I need to review the modules mentioned and see which one is best suited and then it would be appropriate to embrace something in combat to feel it better :)
For now, I'm arranging individual elements of the electrical system in my head and possibly whether something "smear" in a given place or not
The discussion revolves around modifying the firmware of the LSC Smart Connect Plug, which utilizes the BK7231N CB2S module, to disconnect it from cloud services. Users share experiences and methods for achieving this without physical alterations to the device, primarily using tools like Tuya Cloudcutter and OpenBK7231T App. The conversation highlights the benefits of local control over smart devices, including integration with Home Assistant (HA) for enhanced functionality. Participants express interest in the capabilities of various firmware options, including scripting and device management, and discuss the potential for custom configurations and automation within a home network. Summary generated by the language model.