Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamp.kaczmarek2 wrote:There is no Tuya JSON data in the attached binary file.
p.kaczmarek2 wrote:Do you need any further help with configuring the device?
// This aliased command will turn off relay on CH1 after 10 seconds
// addRepeatingEvent [IntervalSeconds][RepeatsOr-1][CommandToRun]
alias turn_off_after_time addRepeatingEvent 10 1 setChannel 1 0
// this will run the turn off command every time that CH1 becomes 1
addChangeHandler Channel1 == 1 turn_off_after_time
// setup NTP driver
startDriver ntp
// set your time zone
ntp_timeZoneOfs 10:00
// create command aliases for later usage
alias day_lights backlog led_temperature 200; led_dimmer 100; echo lights_day
alias night_lights backlog led_temperature 500; led_dimmer 50; echo lights_night
// at given hour, change lights state
addClockEvent 06:01 0xff 1 day_lights
addClockEvent 20:01 0xff 1 night_lights
// wait for NTP sync
waitFor NTPState 1
// after NTP is synced, just after reboot, adjust light states correctly
if $hour>=06&&$hour<21 then day_lights
if $hour>=21||$hour<06 then night_lights
"pins": {
"9": "Btn;3",
"14": "Rel;0",
"24": "LED;2",
"26": "Rel;1"
},
// Channel 0 - Water Off
// Channel 1 - Water On
// Channel 2 - LED
alias turn_off_led backlog setChannel 2 0
alias turn_on_led backlog setChannel 2 1
// This will automatically turn off relays after about 2 seconds
// NOTE: addRepeatingEvent [RepeatTime] [RepeatCount]
alias stop_flow backlog turn_off_led; addRepeatingEvent 2 1 setChannel 0 0
alias start_flow backlog turn_on_led; addRepeatingEvent 2 1 setChannel 1 0
addChangeHandler Channel0 != 0 stop_flow
addChangeHandler Channel1 != 0 start_flow