atlewee / node-red-contrib-sacn

Simple sACN output for Node-RED
MIT License
1 stars 4 forks source link

sacn not woring with anyting else than Inject node. #4

Closed MikeJollie21 closed 4 years ago

MikeJollie21 commented 5 years ago

Hi,

I recently implemented dmx relays and dimers around my house for controlling my lighting, Now i wanted to use your Sacn node in node-red but is spits out a wird error whan i am trying to send values from somethis else than a inject node, i made an example below, I hope you can help me :)

Greatings from the Netherlands

error from the debug log "TypeError: Cannot read property 'split' of undefined"

[{"id":"f1483c2.26ec6c","type":"ui_switch","z":"1178f1f7.88f206","name":"","label":"switch","group":"88ae2a21.a68b4","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"255","offvalueType":"num","officon":"","offcolor":"","x":210,"y":240,"wires":[["7bf5c69b.e10538"]]},{"id":"7bf5c69b.e10538","type":"sACN","z":"1178f1f7.88f206","server":"4ac01d07.6216cc","universe":"1","channel":"12","transition":"instant","transitionRate":50,"transitionTime":1000,"name":"","x":550,"y":240,"wires":[]},{"id":"998b0f56.fb3fa","type":"inject","z":"1178f1f7.88f206","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":320,"wires":[["7bf5c69b.e10538"]]},{"id":"8ff69285.1ddf98","type":"inject","z":"1178f1f7.88f206","name":"","topic":"","payload":"255","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":360,"wires":[["7bf5c69b.e10538"]]},{"id":"88ae2a21.a68b4","type":"ui_group","z":"","name":"Alle verlichting","tab":"55bca700.7e566","order":1,"disp":true,"width":"6","collapse":false},{"id":"4ac01d07.6216cc","type":"sacn-config","z":"","hostOrUniverse":"1","port":"5568"},{"id":"55bca700.7e566","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

atlewee commented 5 years ago

Hi, thanks for your report. It seems to be a bug if there is no topic present in the msg object. (I will fix it in next version) If you type anything in the topic of your button, the error msg will dissapear.. like this:

[
    {
        "id": "b3fa52c1.2b1ff",
        "type": "ui_switch",
        "z": "7c8c4a1d.f7cb54",
        "name": "",
        "label": "switch",
        "tooltip": "",
        "group": "5e53c71d.72a9e8",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "anyTopic",
        "style": "",
        "onvalue": "1",
        "onvalueType": "num",
        "onicon": "",
        "oncolor": "",
        "offvalue": "255",
        "offvalueType": "num",
        "officon": "",
        "offcolor": "",
        "x": 306.1428527832031,
        "y": 281,
        "wires": [
            [
                "bb85b195.0a1b7"
            ]
        ]
    },
    {
        "id": "5e53c71d.72a9e8",
        "type": "ui_group",
        "z": "",
        "name": "Alle verlichting",
        "tab": "c21d0b1b.ca90c8",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "c21d0b1b.ca90c8",
        "type": "ui_tab",
        "z": "",
        "name": "Home",
        "icon": "dashboard"
    }
]
MikeJollie21 commented 5 years ago

Hi, Tanks for your quick reply , indeed the error message disappears but the relay on ch 1 does not toggle when i toggle the switch,

Greetings.

atlewee commented 5 years ago

Strange, I have several 100 channels spread across several universes and different type of units with no issues. Using both sliders/rgb picker and switches..

Does your relay toggle when using the inject nodes?

I noticed your switch had values 1 and 255, maybe it must be 0 and 255 ?

MikeJollie21 commented 5 years ago

Oh yah you are right that was my bad its working now, Thank you very much.

atlewee commented 4 years ago

Fixed in 0.0.8 :)