Store RGB Values from Dashboard and activate them on sunset

#1

Hi,
i´d like to build an nice User-Interface for my House lights.

For that i want to build a nice browser user interface:

  1. Get the RGB Value for the lights via 3 Sliders (=>working)
  2. use an button to store the value
  3. on next sunrise set the Values to zero (lights off during day)
  4. on next sunset set the values to last stored Value

this is what i have so far:

[
    {
        "id": "b1fa37d.90c64c8",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": ""
    },
    {
        "id": "bde591be.9e273",
        "type": "function",
        "z": "b1fa37d.90c64c8",
        "name": "Set Red",
        "func": "msg.payload = {\n  buckets: [\n    {channel:  1, value: [msg.payload]},\n    {channel:  4, value: [msg.payload]},\n    {channel:  7, value: [msg.payload]},\n    {channel: 10, value: [msg.payload]},\n    {channel: 13, value: [msg.payload]},\n    {channel: 16, value: [msg.payload]},\n    {channel: 19, value: [msg.payload]},\n    {channel: 22, value: [msg.payload]},\n    {channel: 25, value: [msg.payload]},\n    {channel: 28, value: [msg.payload]},\n    ]\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 526,
        "y": 242,
        "wires": [
            [
                "7afe69ac.bbd908"
            ]
        ]
    },
    {
        "id": "6cd9acc9.77cd94",
        "type": "ui_slider",
        "z": "b1fa37d.90c64c8",
        "name": "Red Treppen",
        "label": "red",
        "tooltip": "",
        "group": "d44c4a2d.ad6c38",
        "order": 1,
        "width": "0",
        "height": "0",
        "passthru": true,
        "outs": "all",
        "topic": "",
        "min": 0,
        "max": "255",
        "step": 1,
        "x": 368,
        "y": 242,
        "wires": [
            [
                "bde591be.9e273"
            ]
        ]
    },
    {
        "id": "726cc947.2ecc98",
        "type": "function",
        "z": "b1fa37d.90c64c8",
        "name": "Set Green",
        "func": "msg.payload = {\n  buckets: [\n    {channel:  2, value: [msg.payload]},\n    {channel:  5, value: [msg.payload]},\n    {channel:  8, value: [msg.payload]},\n    {channel: 11, value: [msg.payload]},\n    {channel: 14, value: [msg.payload]},\n    {channel: 17, value: [msg.payload]},\n    {channel: 20, value: [msg.payload]},\n    {channel: 23, value: [msg.payload]},\n    {channel: 26, value: [msg.payload]},\n    {channel: 29, value: [msg.payload]},\n    ]\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 530.5,
        "y": 299,
        "wires": [
            [
                "7afe69ac.bbd908"
            ]
        ]
    },
    {
        "id": "6aff8ee9.2ac8b",
        "type": "ui_slider",
        "z": "b1fa37d.90c64c8",
        "name": "Green Treppen",
        "label": "grün",
        "tooltip": "",
        "group": "d44c4a2d.ad6c38",
        "order": 2,
        "width": "0",
        "height": "0",
        "passthru": true,
        "outs": "all",
        "topic": "",
        "min": 0,
        "max": "255",
        "step": 1,
        "x": 376.5,
        "y": 300,
        "wires": [
            [
                "726cc947.2ecc98"
            ]
        ]
    },
    {
        "id": "e7ad7dfe.94be8",
        "type": "function",
        "z": "b1fa37d.90c64c8",
        "name": "Set Blue",
        "func": "msg.payload = {\n  buckets: [\n    {channel:  3, value: [msg.payload]},\n    {channel:  6, value: [msg.payload]},\n    {channel:  9, value: [msg.payload]},\n    {channel: 12, value: [msg.payload]},\n    {channel: 15, value: [msg.payload]},\n    {channel: 18, value: [msg.payload]},\n    {channel: 21, value: [msg.payload]},\n    {channel: 24, value: [msg.payload]},\n    {channel: 27, value: [msg.payload]},\n    {channel: 30, value: [msg.payload]},\n    ]\n};\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 530.5,
        "y": 365,
        "wires": [
            [
                "7afe69ac.bbd908"
            ]
        ]
    },
    {
        "id": "4b48298c.e9efe8",
        "type": "ui_slider",
        "z": "b1fa37d.90c64c8",
        "name": "Blau Treppen",
        "label": "blau",
        "tooltip": "",
        "group": "d44c4a2d.ad6c38",
        "order": 3,
        "width": "0",
        "height": "0",
        "passthru": true,
        "outs": "all",
        "topic": "",
        "min": 0,
        "max": "255",
        "step": 1,
        "x": 380.5,
        "y": 364,
        "wires": [
            [
                "e7ad7dfe.94be8"
            ]
        ]
    },
    {
        "id": "7afe69ac.bbd908",
        "type": "artnet out",
        "z": "b1fa37d.90c64c8",
        "name": "Artnet_out 192-168-98-61",
        "address": "192.168.98.61",
        "port": 6454,
        "size": "512",
        "rate": 40,
        "universe": "0",
        "x": 1554.923080444336,
        "y": 319.2307586669922,
        "wires": []
    },
    {
        "id": "d44c4a2d.ad6c38",
        "type": "ui_group",
        "z": "",
        "name": "Treppen",
        "tab": "9433325f.72235",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "9433325f.72235",
        "type": "ui_tab",
        "z": "",
        "name": "Master",
        "icon": "dashboard"
    }
]
0 Likes

#2

Not infront of my pc to import your flow.

But if you can read the RGB values from the dashboard one way would be to store that as a global context value

Then in a flow that uses a sunset app (there are many) wire that to a change node where you “pick-up” the context values.

1 Like