Hello everyone could you tell me how to implement my idea? I have a smart valve on a cb3s board on a BK7231N chip, I have already flashed it with openbeken 1.18.99 firmware.
initial configuration
she allowed the valve to be started, it is triggered by a button and can now be controlled by mqtt, which is already good
My goal is to set up using this valve and two sensors xkc-y25-v, to set up automatic filling of the water barrel.
The sensor operates on the principle of giving out 1 at the outlet when water is detected
the logic of the operation should be as follows:
the first sensor is installed at the bottom of the barrel, the second at the top
If both sensors have 0, then the valve must be opened, if the second sensor has 1, then the valve must be closed or if more than 40 minutes have passed after opening. It would also be nice if the valve is powered, it should lock.
I added 2 inputs to the configuration, when the sensors are triggered in the initial web panel, I see that the channel states change to 1
but I can't make the valve work automatically based on information from the sensors.
I tried to enter these commands for the test but it doesn't work, there is no reaction to the sensors, although information is updated in the channels and sent to MQTT
addEventHandler 2 0 SetChannel 1 1
addEventHandler 3 0 SetChannel 1 0
can someone tell me how to implement this? and then how can I save this configuration so that it remains working after restarting the device?
initial configuration
Quote:
{
"vendor": "Tuya",
"bDetailed": "0",
"name": "Full Device Name Here",
"model": "enter short model name here",
"chip": "BK7231N",
"board": "TODO",
"flags": "1024",
"keywords": [
"TODO",
"TODO",
"TODO"
],
"pins": {
"14": "Rel;1",
"24": "LED;1",
"26": "Btn;1"
},
"command": "",
"image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
"wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
}
she allowed the valve to be started, it is triggered by a button and can now be controlled by mqtt, which is already good
My goal is to set up using this valve and two sensors xkc-y25-v, to set up automatic filling of the water barrel.
The sensor operates on the principle of giving out 1 at the outlet when water is detected
the logic of the operation should be as follows:
the first sensor is installed at the bottom of the barrel, the second at the top
If both sensors have 0, then the valve must be opened, if the second sensor has 1, then the valve must be closed or if more than 40 minutes have passed after opening. It would also be nice if the valve is powered, it should lock.
I added 2 inputs to the configuration, when the sensors are triggered in the initial web panel, I see that the channel states change to 1
Quote:
ClearIO // clear old GPIO/channels
lfs_format // clear LFS
StartupCommand "" // clear STARTUP
stopDriver * // kill drivers
backlog setPinRole 6 dInput_NoPullUp; setPinChannel 6 2
backlog setPinRole 7 dInput_NoPullUp; setPinChannel 7 3
backlog setPinRole 14 Rel; setPinChannel 14 1
backlog setPinRole 24 LED; setPinChannel 24 1
backlog setPinRole 26 Btn; setPinChannel 26 1
Flags 1024
but I can't make the valve work automatically based on information from the sensors.
I tried to enter these commands for the test but it doesn't work, there is no reaction to the sensors, although information is updated in the channels and sent to MQTT
addEventHandler 2 0 SetChannel 1 1
addEventHandler 3 0 SetChannel 1 0
can someone tell me how to implement this? and then how can I save this configuration so that it remains working after restarting the device?