Hi,
I would like to display boolean values (got by reading values on a PLC) on a dashboard, using UI switches. Each time, it is possible to click on the switch in order to change the value, but I want the opposite. I just would like to trigger the value targeted, so that the switch becomes ON when the value is true and OFF when it's false.
I've found some topics who barely spoke about this issue, but it didn't help me to solve my problem.
I understood that I have to register the value before the switch thanks to a change node. I did that and transform each value into msg.payload, with the purpose to display the result on the switch.
Unfortunately, it didn't work. What do I have to put into "On Payload" and "Off payload" of the switch ?
I also have a lot of alarms on my PC, so it would be great if you have a solution which avoid me to have many and many nodes (thanks to an unique function for instance).
My flow :
[
{
"id": "94c53e1fb7cccfbc",
"type": "tab",
"label": "Flux 4",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8aaa48f84818486f",
"type": "s7 in",
"z": "94c53e1fb7cccfbc",
"endpoint": "fed32a73d5582e79",
"mode": "all",
"variable": "",
"diff": true,
"name": "Reading measures",
"x": 210,
"y": 580,
"wires": [
[
"beb5b40f0623fa30",
"dbbd21fd05d8dda5",
"b1d5947a6488af35",
"0795cfe801cec740",
"c8e77ee01ebb8eca",
"584ab7fcb536f569"
]
]
},
{
"id": "19d97c37bab53fa0",
"type": "ui_switch",
"z": "94c53e1fb7cccfbc",
"name": "",
"label": "Safety temperature switch",
"tooltip": "",
"group": "cd79e9901663568e",
"order": 23,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 890,
"y": 500,
"wires": [
[]
]
},
{
"id": "dbbd21fd05d8dda5",
"type": "ui_switch",
"z": "94c53e1fb7cccfbc",
"name": "",
"label": "Overload_cutout",
"tooltip": "",
"group": "cd79e9901663568e",
"order": 23,
"width": 0,
"height": 0,
"passthru": false,
"decouple": "false",
"topic": "payload.Overload_cutout",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 860,
"y": 540,
"wires": [
[]
]
},
{
"id": "b1d5947a6488af35",
"type": "ui_switch",
"z": "94c53e1fb7cccfbc",
"name": "",
"label": "Thermal_cutout",
"tooltip": "",
"group": "cd79e9901663568e",
"order": 23,
"width": 0,
"height": 0,
"passthru": false,
"decouple": "false",
"topic": "payload.Thermal_cutout",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 860,
"y": 580,
"wires": [
[]
]
},
{
"id": "0795cfe801cec740",
"type": "ui_switch",
"z": "94c53e1fb7cccfbc",
"name": "",
"label": "Power_fail",
"tooltip": "",
"group": "cd79e9901663568e",
"order": 23,
"width": 0,
"height": 0,
"passthru": false,
"decouple": "false",
"topic": "payload.Power_fail",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 850,
"y": 620,
"wires": [
[]
]
},
{
"id": "beb5b40f0623fa30",
"type": "change",
"z": "94c53e1fb7cccfbc",
"name": "",
"rules": [
{
"t": "set",
"p": "payload.Safety_temperature_switch",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 560,
"y": 500,
"wires": [
[
"19d97c37bab53fa0"
]
]
},
{
"id": "c8e77ee01ebb8eca",
"type": "change",
"z": "94c53e1fb7cccfbc",
"name": "",
"rules": [
{
"t": "set",
"p": "payload.Door_open",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 660,
"wires": [
[
"91ee2be7177eb5ba"
]
]
},
{
"id": "91ee2be7177eb5ba",
"type": "ui_switch",
"z": "94c53e1fb7cccfbc",
"name": "",
"label": "Door open",
"tooltip": "",
"group": "cd79e9901663568e",
"order": 23,
"width": 0,
"height": 0,
"passthru": true,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 850,
"y": 660,
"wires": [
[]
]
},
{
"id": "584ab7fcb536f569",
"type": "debug",
"z": "94c53e1fb7cccfbc",
"name": "debug 212",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 450,
"y": 420,
"wires": []
},
{
"id": "fed32a73d5582e79",
"type": "s7 endpoint",
"transport": "iso-on-tcp",
"address": "192.168.0.1",
"port": "102",
"rack": "0",
"slot": "1",
"localtsaphi": "01",
"localtsaplo": "00",
"remotetsaphi": "01",
"remotetsaplo": "00",
"connmode": "rack-slot",
"adapter": "",
"busaddr": "2",
"cycletime": "10000",
"timeout": "2000",
"name": "Discovery",
"vartable": [
{
"addr": "DB62,BYTE0",
"name": "Dry_Bulb_0"
},
{
"addr": "DB62,BYTE1",
"name": "Dry_Bulb_1"
},
{
"addr": "DB62,BYTE2",
"name": "Dry_Bulb_2"
},
{
"addr": "DB62,BYTE3",
"name": "Dry_Bulb_3"
},
{
"addr": "DB62,BYTE4",
"name": "Wet_Bulb_0"
},
{
"addr": "DB62,BYTE5",
"name": "Wet_Bulb_1"
},
{
"addr": "DB62,BYTE6",
"name": "Wet_Bulb_2"
},
{
"addr": "DB62,BYTE7",
"name": "Wet_Bulb_3"
},
{
"addr": "DB62,BYTE8",
"name": "PT100_USER0_0"
},
{
"addr": "DB62,BYTE9",
"name": "PT100_USER0_1"
},
{
"addr": "DB62,BYTE10",
"name": "PT100_USER0_2"
},
{
"addr": "DB62,BYTE11",
"name": "PT100_USER0_3"
},
{
"addr": "DB62,BYTE12",
"name": "PT100_USER1_0"
},
{
"addr": "DB62,BYTE13",
"name": "PT100_USER1_1"
},
{
"addr": "DB62,BYTE14",
"name": "PT100_USER1_2"
},
{
"addr": "DB62,BYTE15",
"name": "PT100_USER1_3"
},
{
"addr": "DB62,BYTE16",
"name": "PT100_USER2_0"
},
{
"addr": "DB62,BYTE17",
"name": "PT100_USER2_1"
},
{
"addr": "DB62,BYTE18",
"name": "PT100_USER2_2"
},
{
"addr": "DB62,BYTE19",
"name": "PT100_USER2_3"
},
{
"addr": "DB62,BYTE20",
"name": "PT100_USER3_0"
},
{
"addr": "DB62,BYTE21",
"name": "PT100_USER3_1"
},
{
"addr": "DB62,BYTE22",
"name": "PT100_USER3_2"
},
{
"addr": "DB62,BYTE23",
"name": "PT100_USER3_3"
},
{
"addr": "DB62,BYTE24",
"name": "Low_stage_suction_pressure_0"
},
{
"addr": "DB62,BYTE25",
"name": "Low_stage_suction_pressure_1"
},
{
"addr": "DB62,BYTE26",
"name": "Low_stage_suction_pressure_2"
},
{
"addr": "DB62,BYTE27",
"name": "Low_stage_suction_pressure_3"
},
{
"addr": "DB62,BYTE28",
"name": "Low_stage_discharge_pressure_0"
},
{
"addr": "DB62,BYTE29",
"name": "Low_stage_discharge_pressure_1"
},
{
"addr": "DB62,BYTE30",
"name": "Low_stage_discharge_pressure_2"
},
{
"addr": "DB62,BYTE31",
"name": "Low_stage_discharge_pressure_3"
},
{
"addr": "DB62,BYTE32",
"name": "High_stage_suction_pressure_0"
},
{
"addr": "DB62,BYTE33",
"name": "High_stage_suction_pressure_1"
},
{
"addr": "DB62,BYTE34",
"name": "High_stage_suction_pressure_2"
},
{
"addr": "DB62,BYTE35",
"name": "High_stage_suction_pressure_3"
},
{
"addr": "DB62,BYTE36",
"name": "High_stage_discharge_pressure_0"
},
{
"addr": "DB62,BYTE37",
"name": "High_stage_discharge_pressure_1"
},
{
"addr": "DB62,BYTE38",
"name": "High_stage_discharge_pressure_2"
},
{
"addr": "DB62,BYTE39",
"name": "High_stage_discharge_pressure_3"
},
{
"addr": "DB62,BYTE40",
"name": "User_analog_input0_0"
},
{
"addr": "DB62,BYTE41",
"name": "User_analog_input0_1"
},
{
"addr": "DB62,BYTE42",
"name": "User_analog_input0_2"
},
{
"addr": "DB62,BYTE43",
"name": "User_analog_input0_3"
},
{
"addr": "DB62,BYTE44",
"name": "User_analog_input1_0"
},
{
"addr": "DB62,BYTE45",
"name": "User_analog_input1_1"
},
{
"addr": "DB62,BYTE46",
"name": "User_analog_input1_2"
},
{
"addr": "DB62,BYTE47",
"name": "User_analog_input1_3"
},
{
"addr": "DB62,BYTE48",
"name": "User_analog_input2_0"
},
{
"addr": "DB62,BYTE49",
"name": "User_analog_input2_1"
},
{
"addr": "DB62,BYTE50",
"name": "User_analog_input2_2"
},
{
"addr": "DB62,BYTE51",
"name": "User_analog_input2_3"
},
{
"addr": "DB62,BYTE52",
"name": "User_analog_input3_0"
},
{
"addr": "DB62,BYTE53",
"name": "User_analog_input3_1"
},
{
"addr": "DB62,BYTE54",
"name": "User_analog_input3_2"
},
{
"addr": "DB62,BYTE55",
"name": "User_analog_input3_3"
},
{
"addr": "DB62,BYTE56",
"name": "User_analog_input4_0"
},
{
"addr": "DB62,BYTE57",
"name": "User_analog_input4_1"
},
{
"addr": "DB62,BYTE58",
"name": "User_analog_input4_2"
},
{
"addr": "DB62,BYTE59",
"name": "User_analog_input4_3"
},
{
"addr": "DB62,BYTE60",
"name": "Capacity_probe_0"
},
{
"addr": "DB62,BYTE61",
"name": "Capacity_probe_1"
},
{
"addr": "DB62,BYTE62",
"name": "Capacity_probe_2"
},
{
"addr": "DB62,BYTE63",
"name": "Capacity_probe_3"
},
{
"addr": "DB62,BYTE64",
"name": "Chamber_temperature_0"
},
{
"addr": "DB62,BYTE65",
"name": "Chamber_temperature_1"
},
{
"addr": "DB62,BYTE66",
"name": "Chamber_temperature_2"
},
{
"addr": "DB62,BYTE67",
"name": "Chamber_temperature_3"
},
{
"addr": "DB62,BYTE68",
"name": "Relative_humidity_0"
},
{
"addr": "DB62,BYTE69",
"name": "Relative_humidity_1"
},
{
"addr": "DB62,BYTE70",
"name": "Relative_humidity_2"
},
{
"addr": "DB62,BYTE71",
"name": "Relative_humidity_3"
},
{
"addr": "DB62,BYTE72",
"name": "Absolute_humidity_0"
},
{
"addr": "DB62,BYTE73",
"name": "Absolute_humidity_1"
},
{
"addr": "DB62,BYTE74",
"name": "Absolute_humidity_2"
},
{
"addr": "DB62,BYTE75",
"name": "Absolute_humidity_3"
},
{
"addr": "DB62,BYTE104",
"name": "Channel0_measure_0"
},
{
"addr": "DB62,BYTE105",
"name": "Channel0_measure_1"
},
{
"addr": "DB62,BYTE106",
"name": "Channel0_measure_2"
},
{
"addr": "DB62,BYTE107",
"name": "Channel0_measure_3"
},
{
"addr": "DB62,BYTE108",
"name": "Channel1_measure_0"
},
{
"addr": "DB62,BYTE109",
"name": "Channel1_measure_1"
},
{
"addr": "DB62,BYTE110",
"name": "Channel1_measure_2"
},
{
"addr": "DB62,BYTE111",
"name": "Channel1_measure_3"
},
{
"addr": "DB62,X128.0",
"name": "Safety_temperature_switch"
},
{
"addr": "DB62,X128.1",
"name": "Overload_cutout"
},
{
"addr": "DB62,X128.2",
"name": "Thermal_cutout"
},
{
"addr": "DB62,X128.3",
"name": "Power_fail"
},
{
"addr": "DB62,X128.4",
"name": "Emergency_switch"
},
{
"addr": "DB62,X128.5",
"name": "Door_open"
},
{
"addr": "DB62,X128.6",
"name": "Max_temperature"
},
{
"addr": "DB62,X128.7",
"name": "Adjustable_max_temperature"
},
{
"addr": "DB62,X129.0",
"name": "Adjustable_min_temperature"
},
{
"addr": "DB62,X129.1",
"name": "Pt100_dry_bulb_sensor_fail"
},
{
"addr": "DB62,X129.2",
"name": "TC_dut_sensor_fail"
},
{
"addr": "DB62,X129.3",
"name": "Pt100_wet_bulb_sensor_fail"
},
{
"addr": "DB62,X129.4",
"name": "Salt_solution_min_level"
},
{
"addr": "DB62,X129.5",
"name": "Water_lack"
},
{
"addr": "DB62,X129.6",
"name": "Steam_generator_max_temperature"
},
{
"addr": "DB62,X129.7",
"name": "Low_stage_compressor_min_oil_pressure"
},
{
"addr": "DB62,X130.0",
"name": "Low_stage_compressor_overload_cutout"
},
{
"addr": "DB62,X130.1",
"name": "Low_stage_compressor_thermal_cutout"
},
{
"addr": "DB62,X130.2",
"name": "Low_stage_fan_compressor_overload_cutout"
},
{
"addr": "DB62,X130.3",
"name": "Max_low_stage_pressure"
},
{
"addr": "DB62,X130.4",
"name": "Min_low_stage_pressure"
},
{
"addr": "DB62,X130.5",
"name": "Max_low_stage_discharge_temperature"
},
{
"addr": "DB62,X130.6",
"name": "High_stage_compressor_min_oil_pressure"
},
{
"addr": "DB62,X130.7",
"name": "High_stage_compressor_overload_cutout"
},
{
"addr": "DB62,X131.0",
"name": "High_stage_compressor_thermal_cutout"
},
{
"addr": "DB62,X131.1",
"name": "High_stage_fan_compressor_overload_cutout"
},
{
"addr": "DB62,X131.2",
"name": "High_stage_max_pressure"
},
{
"addr": "DB62,X131.3",
"name": "High_stage_min_pressure"
},
{
"addr": "DB62,X131.4",
"name": "Max_high_stage_discharge_temperature"
},
{
"addr": "DB62,X131.5",
"name": "Intermediate_fluid_overtemperature"
},
{
"addr": "DB62,X131.6",
"name": "Intermediate_fluid_undertemperature"
},
{
"addr": "DB62,X131.7",
"name": "Max_intermediate_fluid_level"
},
{
"addr": "DB62,X132.0",
"name": "Min_intermediate_fluid_level"
},
{
"addr": "DB62,X132.1",
"name": "Intermediate_fluid_overpressure"
},
{
"addr": "DB62,X132.2",
"name": "Intermediate_fluid_underpressure"
},
{
"addr": "DB62,X132.3",
"name": "Intermediate_fluid_pump_overload_cutout"
},
{
"addr": "DB62,X132.4",
"name": "Intermediate_fluid_pump_thermal_cutout"
},
{
"addr": "DB62,X132.5",
"name": "Condenser_fan_overload_cutout"
},
{
"addr": "DB62,X132.6",
"name": "Water_lack_pre-alarm"
},
{
"addr": "DB62,X132.7",
"name": "Min_condenser_water_flow"
},
{
"addr": "DB62,X133.0",
"name": "Min_compressed_air_pressure"
},
{
"addr": "DB62,X133.1",
"name": "Min_differential_pressure"
},
{
"addr": "DB62,X133.2",
"name": "Min_liquid_nytrogen_pressure"
},
{
"addr": "DB62,X133.3",
"name": "Smoke_detector"
},
{
"addr": "DB62,X133.4",
"name": "Max_CO_concentration"
},
{
"addr": "DB62,X133.5",
"name": "Min_oxygen_concentration"
},
{
"addr": "DB62,X133.6",
"name": "Inverter_fail"
},
{
"addr": "DB62,X133.7",
"name": "Vacuum_pump_overload_cutout"
},
{
"addr": "DB62,X134.0",
"name": "Vacuum_pump_thermal_cutout"
},
{
"addr": "DB62,X134.1",
"name": "Vacuum_pump_warmup"
},
{
"addr": "DB62,X134.2",
"name": "Ventilation_lack"
},
{
"addr": "DB62,X134.3",
"name": "Air_filter"
},
{
"addr": "DB62,X134.4",
"name": "Low_stage_compressor_start-up_failure"
},
{
"addr": "DB62,X134.5",
"name": "High_stage_compressor_start-up_failure"
},
{
"addr": "DB62,X134.6",
"name": "Movement_timeout"
},
{
"addr": "DB62,X134.7",
"name": "Defrosting_in_progress"
},
{
"addr": "DB62,X135.0",
"name": "Defrosting_timeout"
},
{
"addr": "DB62,X135.1",
"name": "Capacitive_probe_temperature_out_of_range"
},
{
"addr": "DB62,X135.2",
"name": "Acceleration_critical_deviation"
},
{
"addr": "DB62,X135.3",
"name": "Oxygen_min._concentration_(Non_critical)"
},
{
"addr": "DB62,X135.4",
"name": "Hardware_alarm_(WinSmartkit)"
},
{
"addr": "DB62,X137.4",
"name": "Remote_mode_control"
},
{
"addr": "DB62,X137.5",
"name": "Abort_test_in_program_mode"
},
{
"addr": "DB62,X137.6",
"name": "End_test"
},
{
"addr": "DB62,X137.7",
"name": "Critical_alarm"
}
]
},
{
"id": "cd79e9901663568e",
"type": "ui_group",
"name": "Group 1",
"tab": "70cc5f9e2792ba6a",
"order": 1,
"disp": true,
"width": 6
},
{
"id": "70cc5f9e2792ba6a",
"type": "ui_tab",
"name": "Alarms",
"icon": "dashboard",
"order": 2,
"disabled": false,
"hidden": false
}
]
The dashboard :
Thank you for your help