Skip to main content

ENP-KIT-RL1

rl library implements relay management for the ENP-KIT-RL1.

rl.is_closed

-- @return boolean Relay status
function rl.is_closed()
end

Returns the current state of a relay:

  • true - relay is closed
  • false - relay is opened

Example

status = rl.is_closed()
if status then
enapter.log("Relay is closed")
else
enapter.log("Relay is openned")
end

rl.open

function rl.open()
end

Opens relay contact.

rl.close

function rl.close()
end

Closes relay contact.

rl.impulse

-- @param duration - impulse duration, in milliseconds
-- @note this command will only close and then open relay. It has no effect if relay is already closed.
function rl.impulse(duration)
end

Blueprint Example

blueprint_spec: "device/1.0"
display_name: My Device Switch
description: Automatic device switch
icon: enapter-home

telemetry:
status:
display_name: Bar status
type: string
enum:
- light
- dark

communication_modules:
rl1:
product: ENP-RL1
lua_file: firmware.lua
commands:
home_light_switch_on:
display_name: Ligh On
group: light
ui:
icon: white-balance-sunny
quick_access: true
home_light_switch_off:
display_name: Ligh Off
group: light
ui:
icon: moon-waning-crescent
quick_access: true
command_groups:
light:
display_name: Ligh
Hardware diversity is welcome. Integrate any device into a unified energy network.
© 2024 Enapter
Developer toolkit
DocumentationReference