class Helvar::Net

Included Modules

Defined in:

helvar/net.cr

Constant Summary

CMD_METHODS = {group_scene: 11, device_scene: 12, group_level: 13, device_level: 14, group_proportion: 15, device_proportion: 16, group_modify_proportion: 17, device_modify_proportion: 18, group_emergency_test: 19, device_emergency_test: 20, group_emergency_duration_test: 21, device_emergency_duration_test: 22, group_emergency_stop: 23, device_emergency_stop: 24, query_lamp_hours: 70, query_ballast_hours: 71, query_max_voltage: 72, query_min_voltage: 73, query_max_temp: 74, query_min_temp: 75, query_device_types_with_addresses: 100, query_clusters: 101, query_routers: 102, query_LSIB: 103, query_device_type: 104, query_description_group: 105, query_description_device: 106, query_workgroup_name: 107, query_workgroup_membership: 108, query_last_scene: 109, query_device_state: 110, query_device_disabled: 111, query_lamp_failure: 112, query_device_faulty: 113, query_missing: 114, query_emergency_battery_failure: 129, query_measurement: 150, query_inputs: 151, query_load: 152, query_power_consumption: 160, query_group_power_consumption: 161, query_group: 164, query_groups: 165, query_scene_names: 166, query_scene_info: 167, query_emergency_func_test_time: 170, query_emergency_func_test_state: 171, query_emergency_duration_time: 172, query_emergency_duration_state: 173, query_emergency_battery_charge: 174, query_emergency_battery_time: 175, query_emergency_total_lamp_time: 176, query_time: 185, query_longitude: 186, query_latitude: 187, query_time_zone: 188, query_daylight_savings: 189, query_software_version: 190, query_helvar_net: 191}
COMMANDS = {"group_scene" => "11", "device_scene" => "12", "group_level" => "13", "device_level" => "14", "group_proportion" => "15", "device_proportion" => "16", "group_modify_proportion" => "17", "device_modify_proportion" => "18", "group_emergency_test" => "19", "device_emergency_test" => "20", "group_emergency_duration_test" => "21", "device_emergency_duration_test" => "22", "group_emergency_stop" => "23", "device_emergency_stop" => "24", "query_lamp_hours" => "70", "query_ballast_hours" => "71", "query_max_voltage" => "72", "query_min_voltage" => "73", "query_max_temp" => "74", "query_min_temp" => "75", "query_device_types_with_addresses" => "100", "query_clusters" => "101", "query_routers" => "102", "query_LSIB" => "103", "query_device_type" => "104", "query_description_group" => "105", "query_description_device" => "106", "query_workgroup_name" => "107", "query_workgroup_membership" => "108", "query_last_scene" => "109", "query_device_state" => "110", "query_device_disabled" => "111", "query_lamp_failure" => "112", "query_device_faulty" => "113", "query_missing" => "114", "query_emergency_battery_failure" => "129", "query_measurement" => "150", "query_inputs" => "151", "query_load" => "152", "query_power_consumption" => "160", "query_group_power_consumption" => "161", "query_group" => "164", "query_groups" => "165", "query_scene_names" => "166", "query_scene_info" => "167", "query_emergency_func_test_time" => "170", "query_emergency_func_test_state" => "171", "query_emergency_duration_time" => "172", "query_emergency_duration_state" => "173", "query_emergency_battery_charge" => "174", "query_emergency_battery_time" => "175", "query_emergency_total_lamp_time" => "176", "query_time" => "185", "query_longitude" => "186", "query_latitude" => "187", "query_time_zone" => "188", "query_daylight_savings" => "189", "query_software_version" => "190", "query_helvar_net" => "191"}
ERRORS = {"0" => "success", "1" => "invalid group index parameter", "2" => "invalid cluster parameter", "3" => "invalid router", "4" => "invalid router subnet", "5" => "invalid device parameter", "6" => "invalid sub device parameter", "7" => "invalid block parameter", "8" => "invalid scene", "9" => "cluster does not exist", "10" => "router does not exist", "11" => "device does not exist", "12" => "property does not exist", "13" => "invalid RAW message size", "14" => "invalid messages type", "15" => "invalid message command", "16" => "missing ASCII terminator", "17" => "missing ASCII parameter", "18" => "incompatible version"}
PARAMS = {"V" => :ver, "Q" => :seq, "C" => :cmd, "A" => :ack, "@" => :addr, "F" => :fade, "T" => :time, "L" => :level, "G" => :group, "S" => :scene, "B" => :block, "N" => :latitude, "E" => :longitude, "Z" => :time_zone, "P" => :proportion, "D" => :display_screen, "Y" => :daylight_savings, "O" => :force_store_scene, "K" => :constant_light_scene}

Class Method Summary

Macro Summary

Instance Method Summary

Class Method Detail

def self.driver_interface : String #

Macro Detail

macro build_command_hash #

Generate a String => String hash based on the data above


[View source]

Instance Method Detail

def connected #

[View source]
def device_emergency_duration_test(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def device_emergency_stop(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def device_emergency_test(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def device_level(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def device_modify_proportion(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def device_proportion(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def device_scene(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def disconnected #

[View source]
def get_current_preset(group : Int32) #

[View source]
def group_emergency_duration_test(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def group_emergency_stop(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def group_emergency_test(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def group_level(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def group_modify_proportion(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def group_proportion(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def group_scene(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def light_level(group : Int32, level : Int32, fade : Int32 = 1000) #

[View source]
def lighting(group : Int32, state : Bool) #

[View source]
def lighting_level?(area : Area | Nil = nil) #
Description copied from module PlaceOS::Driver::Interface::Lighting::Level

return the current level


[View source]
def lighting_scene?(area : Area | Nil = nil) #

[View source]
def on_load #

[View source]
def on_update #

[View source]
def query_ballast_hours(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_clusters(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_daylight_savings(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_description_device(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_description_group(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_device_disabled(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_device_faulty(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_device_state(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_device_type(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_device_types_with_addresses(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_battery_charge(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_battery_failure(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_battery_time(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_duration_state(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_duration_time(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_func_test_state(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_func_test_time(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_emergency_total_lamp_time(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_group(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_group_power_consumption(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_groups(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_helvar_net(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_inputs(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_lamp_failure(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_lamp_hours(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_last_scene(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_latitude(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_load(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_longitude(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_LSIB(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_max_temp(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_max_voltage(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_measurement(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_min_temp(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_min_voltage(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_missing(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_power_consumption(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_routers(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_scene_info(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_scene_levels(group : Int32) #

[View source]
def query_scene_names(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_software_version(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_time(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_time_zone(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_workgroup_membership(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def query_workgroup_name(group : Int32 | Nil = nil, block : Int32 | Nil = nil, level : Int32 | Nil = nil, scene : Int32 | Nil = nil, fade : Int32 | Nil = nil, addr : Int32 | Nil = nil, **options) #

[View source]
def received(data, task) #

[View source]
def set_lighting_level(level : Float64, area : Area | Nil = nil, fade_time : UInt32 = 1000_u32) #
Description copied from module PlaceOS::Driver::Interface::Lighting::Level

level between 0.0 and 100.0, fade in milliseconds


[View source]
def set_lighting_scene(scene : UInt32, area : Area | Nil = nil, fade_time : UInt32 = 1000_u32) #

[View source]
def trigger(group : Int32, scene : Int32, fade : Int32 = 1000) #

[View source]