Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved
Collapse
Discussion Forum to share and further the development of home control and automation, independent of platforms.
ElcidE

Elcid

@Elcid
[HowTo] Using HABridge with Reactor
therealdbT
If you’re like me and still running HABridge to control your devices locally via Alexa, you might need to tweak your endpoints to call Reactor via HTTP. Here’s the best way to do it, IMO: Insert the Reactor Canonical ID (e.g., zwavejs>71-1) into the MapID field, but make sure it’s URL-encoded like this: zwavejs%3E71-1. Then, configure these endpoints as needed: On: http://[ReactorIP]:8111/api/v1/entity/${device.mapId}/perform/power_switch.on Off: http://[ReactorIP]:8111/api/v1/entity/${device.mapId}/perform/power_switch.off Dim: For lights: http://[ReactorIP]:8111/api/v1/entity/${device.mapId}/perform/dimming.set?level=${intensity.decimal_percent} For roller shutters: http://[ReactorIP]:8111/api/v1/entity/${device.mapId}/perform/position.set?value=${intensity.decimal_percent} Color: http://[ReactorIP]:8111/api/v1/entity/${device.mapId}/perform/rgb_color.set_rgb?red=${color.r}&green=${color.g}&blue=${color.b} Just replace [ReactorIP] with your actual IP address. By using these placeholders, you can standardize your endpoints across all devices, making maintenance easier. This setup works with any device mapped under MSR, regardless of the controller (ZWaveJS, Vera, HASS, OpenSprinkler, virtual, MQTT, DynamicEntities, etc.). If you need different calls, just go to the entities, get the action and parameters, and adjust accordingly. Enjoy super fast access to your devices via Alexa! If you're migrating from Vera, the endpoints are (URL-encoded) in a file called device.db, in JSON format, under your config. You'd write a script to align the new endpoints to the new one, if you prefer to do it automatically. YMMV.
How-To
[Reactor] Bug when sending MQTT boolean payloads
therealdbT
Topic thumbnail image
Multi-System Reactor
Genuinely impressed with Zigbee and HA / Reactor
CatmanV2C
Just for the record, in case anyone is following, I'm really rather impressed. I have installed one of these: https://www.amazon.co.uk/dp/B0B6P22YJC?ref=ppx_yo2ov_dt_b_fed_asin_title&th=1 That's connected (physically) to the VM running on my Synology, with a 2m USB extension. The same host also runs Openluup, Mosquito, HA Bridge. Yesterday I installed Zigbee2mqtt. That was a bit of a PITA but mostly because of ports and permissions. Once up and running, and the correct boxes ticked, immediately visible in Home Assistant via the MQTT integration, and thence into Reactor I've only got two devices. I bought the cheapest sensor I could find, which is a door sensor. Dead easy to add to ZIgbee2mqtt and again, immediately visible in HA. https://www.amazon.co.uk/dp/B0FPQLWRW1?ref=ppx_yo2ov_dt_b_fed_asin_title The dongle is on the top floor of the house, and I wanted the sensor on the back door (just about as far apart as it's possible to get short of going into the garage) When I moved the sensor downstairs it dropped out pretty instantly (which wasn't a huge surprise) so quick bit of research found out that smart plugs will act as routers so... https://www.amazon.co.uk/dp/B0FDQDPGBB?ref=ppx_yo2ov_dt_b_fed_asin_title Took me about 30 seconds to connect. Updated the name. Instantly visible in Reactor with the new name pushed over from Zigbee2mqtt. And lo, the door sensor now has a signal of 140 and works as far as I can tell perfectly and instantly (unlike my z-wave one). A few more of those will be purchased and used to replace the Tuya wifi cloud devices and the (continually failing) Z-wave plugs (yeah, they were TKB so....) Commended to the house. Thanks for everyone that got me on the right lines. C
Zigbee
Difficulty defining repeating annual period
R
I have tried numerous ways to define a recurring annual period, for example from December 15 to January 15. No matter which method I try - after and before, between, after and/not after, Reactor reports "waiting for invalid date, invalid date. Some constructs also seem to cause Reactor to hang, timeout and restart. For example "before January 15 is evaluated as true, but reports "waiting for invalid date, invalid date". Does anyone have a tried and true method to define a recurring annual period? I think the "between" that I used successfully in the past may have broken with one of the updates.
Multi-System Reactor
Need help with sequence
T
Good evening all, For about the past week or so, I've been having problems with a specific rule in my home automation that controls when my home goes from an Away mode to Home mode. One of the conditions it checked for was my alarm panel, when it changed from Armed Away to Disarmed. There seems to have been a firmware update on the panel that added an intermittent step of "pending", and I can't say for certain it happens 100% of the time. Is there a way to write a condition that so it changes from one condition, to the next, and then another condition? As in, Home alarm changes from armed_away to pending to disarmed. Thanks.
Multi-System Reactor
Possible feature request?
CatmanV2C
No idea how easy this would be. During my migration away from Z-wave I've been replacing the Z-wave devices with Sonoff which has broken some of my automations. Any chance of a 'Test Reaction' function to call out which ones are broken because an entity no longer exists? Without actually running the reaction? Or does this exist already and I'm just not aware of how to do it? Obviously I can see entities that are no longer available, but not quite what I'm looking for. I guess it's something of an edge case so no huge issue. TIA! C
Multi-System Reactor
Copying a global reaction
tunnusT
With build 25328, if you copy a global reaction, a new reaction does not appear in the UI unless you do a refresh. I recall this used to work without needing this page refresh? Anyway, only a minor nuisance.
Multi-System Reactor
Logic Assistance: Exterior Lights on when Illuminance Below Threshold
PablaP
Topic thumbnail image
Multi-System Reactor
Time series documentation
tunnusT
Is the current manual (incl. examples) up to date with how retention value is handled in time series configuration? Referring to this post
Multi-System Reactor
MQTT templates for ZIgbee scene controller, or a better way?
CatmanV2C
Topic thumbnail image
Multi-System Reactor
Reset a delay
CatmanV2C
I'm sure this has been asked, and answered, but damned if I can figure it out Use case: I have a rear garden with lights. A door from the kitchen into the garden and a door from the garage. Currently if I open the kitchen door the lights come on (yay) and a 3 minute delay starts. After 3 minutes, no matter what else happens, the lights go off (Boo! But also yay!) What I would like is for the 3 minute delay until the lights go off to start from the latest door open event. That is, if I'm going from kitchen to garage, and back again, the lights stay on until there's three minutes of no activity. I've tried 'hacking' with a virtual switch, but can't seem to stop the delay. Any pointers? TIA C
Multi-System Reactor
Zigbee2mqtt installed! sytemctl not happy :(
CatmanV2C
Hello oh great ones. After a couple of hours messing with ports and permissions I have Zigbee2mqtt installed and running on my virtual pi Can connect to the front end and everything Odd one though, simply cannot get systemctl to work and the error is, well, unhelpful. The service file is this: [Unit] Description=zigbee2mqtt After=network.target [Service] Environment=NODE_ENV=production Type=notify ExecStart=/usr/local/bin/node index.js WorkingDirectory=/opt/zigbee2mqtt StandardOutput=inherit # Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5) StandardError=inherit WatchdogSec=10s Restart=always RestartSec=10s User=pi [Install] WantedBy=multi-user.target Straight out of the docs with the change to point to my local node install (which we know works as it's the same as the very fine Reactor is using. Running manually pnpm start in /opt/zigbee2mqtt works fine However: catman@openluup:/etc/systemd/system$ sudo systemctl start zigbee2mqtt.service Job for zigbee2mqtt.service failed because the control process exited with error code. See "systemctl status zigbee2mqtt.service" and "journalctl -xe" for details. Which I have catman@openluup:/etc/systemd/system$ sudo systemctl status zigbee2mqtt.service ● zigbee2mqtt.service - zigbee2mqtt Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; disabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Tue 2025-12-16 12:32:42 GMT; 4s ago Process: 3093 ExecStart=/usr/local/bin/node index.js (code=exited, status=217/USER) Main PID: 3093 (code=exited, status=217/USER) and -- A start job for unit zigbee2mqtt.service has begun execution. -- -- The job identifier is 17477. Dec 16 12:35:16 openluup systemd[3178]: zigbee2mqtt.service: Failed to determine user credentials: No such process Dec 16 12:35:16 openluup systemd[3178]: zigbee2mqtt.service: Failed at step USER spawning /usr/local/bin/node: No such process -- Subject: Process /usr/local/bin/node could not be executed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The process /usr/local/bin/node could not be executed and failed. -- -- The error number returned by this process is ERRNO. Dec 16 12:35:16 openluup systemd[1]: zigbee2mqtt.service: Main process exited, code=exited, status=217/USER -- Subject: Unit process exited -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- An ExecStart= process belonging to unit zigbee2mqtt.service has exited. -- -- The process' exit code is 'exited' and its exit status is 217. Dec 16 12:35:16 openluup systemd[1]: zigbee2mqtt.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- The unit zigbee2mqtt.service has entered the 'failed' state with result 'exit-code'. Dec 16 12:35:16 openluup systemd[1]: Failed to start zigbee2mqtt. -- Subject: A start job for unit zigbee2mqtt.service has failed -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- A start job for unit zigbee2mqtt.service has finished with a failure. Which strikes me as very odd. Any blindingly obvious things I'm missing? TIA! C
Zigbee
Any thoughts on which is better
CatmanV2C
Obviously a quiet forum, but perhaps it's time I'm looking at rolling Zigbee into my system, in large part for the Aqara FP300 presence sensors which seem to finally provide a solution to if the wasp is actually in the box. My current set up is as follows: One Debian VM on Synology NAS running: Z-wave Server Open Luup Multi system reactor HA bridge Mosquito MQQT broker This machine has a UZB Z-wave stick connected via the USB port on the NAS Another HAOS VM on the same NAS running HAOS I've got some older Z-wave stuff that I keep around until it fails. I have some Tuya stuff integrated in HA My thought was to get either a SMLIGHT SLZB-06M or an Aqara Hub M2 Integrate them via Zigbee2MQQT (running on the Debian machine) and then expose them in HA so I can continue to automate in MSR. Thoughts on which of those devices wold be preferable long term. Both are POE capable which is good. It also appears I could add a USB dongle to the NAS and expose it to the HAOS machine. Any thoughts from the assembled experts here? TIA C
Zigbee
Single protocol?
CatmanV2C
Another question to the hive mind. Prompted by the fact that I lost yet another z-wave device over the weekend due to a power issue. It looks like z-way server is reporting another device failed (although it's working fine) and message queue is far too long IMHO. Also the failed device has been removed in the expert interface, but still there in the 'normal' one. Sigh. Currently I have z-wave, Tuya, thinking about Zigbee.... Does anyone use one single protocol for everything? Right now I'm feeling that as the z-wave stuff dies, I'm just gonna replace it with something else.... C
General Discussion
HDMI oddness
CatmanV2C
Not really Smart Home stuff, but going to ask as we have smart people... Bear with me on this one. Asking here because of the font of knowledge! For many eek years I have had a Virgin V6 box and a Raspberry Pi running Kodi connected to my TV through a cheap *** HDMI switch. It all worked beautifully but the absolutely critical thing was that the TV remote passed the signals back to the Pi to allow remote control of Kodi. Couple of changes of late: Installed a soundbar on the TV using the ARC (audio return channel). That then turns the soundbar on and off when the TV turns on and off and the TV volume control controls the soundbar volume direct. Everything continues to work Upgraded the software of the Tivo box to Virgin 360. This is literally software only. You get sent a snacky new Bluetooth remote hit 'upgrade' on the screen and off it goes. Now, things are not playing well. Typically when I turn on to watch Kodi the soundbar comes on (as it should) but the TV either puts out sound through its own speakers and the soundbar, or just the soundbar. It's not possible to control the volume of the soundbar through the TV. Also it's not longer possible to control Kodi using the TV remote. If I turn the TV360 box off, i.e. power it down, before turning on to watch Kodi, everything is fine. This makes little to no sense to me. My assumption is that the cheap *** HDMI switch is getting something from the TV360 connection that it didn't used to get when the software was Tivo and that's screwing up the HDMI communications. I'm upgrading the switch to something a little less chap, but wondered if anyone could validate my theory at all? TIA C
General Discussion
Reactor Loading Screen Safari
S
Topic thumbnail image
Multi-System Reactor
Constraints states visually do not match actual
S
Topic thumbnail image
Multi-System Reactor
Oh the joy of pairing
CatmanV2C
When I remember the old days Just added a new Tuya plug (OK so it's cloud) Start to finish, visible in HA and MSR < 30 seconds... C
Vera
Home Assistant Connect ZWA-2 & ZBT-2
therealdbT
Topic thumbnail image
Hardware
[MSR] Feature request: For Each action on arrays/groups
therealdbT
Topic thumbnail image
Multi-System Reactor
About
Posts
251
Topics
20
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Not so quiet around here :)
    ElcidE Elcid

    @cw-kid I have not been able to login since the 28/03.
    As to rebel, just a little more blunt than you. As I see it someone was on a purge.
    Shame they are purging people that help others, specially vera support, still plenty of support here though.

    General Discussion

  • My Wandering
    ElcidE Elcid

    I am a Electrician. I installed hundreds of smart devices for others prior to having my own home automation. In 2013 I bought a new house and decided to make it smart. I did some homework and settled on Z-wave and VeraPlus.
    My installation comprises of
    25 Z-wave dimmer/switch inserts
    3 Z-wave door sensors
    10 sonoff devices(basics,TH16 and Mini) ,
    4 Tuya(lamps and RGB strips) ,
    6 shellys(connected to motion sensors and 2 controlling dead DIY bolts )
    3 Amazon Dots(gen2)
    2 Broadlink (RMPro's)
    4 DIY RF Venetian Blinds
    2 Multi button DIY remotes
    1 NVR
    1 Network drive/Media server/ftp server.
    1 smart thermostat heating and hot water
    4 wired 240v/battery Aico smoke and heat detectors (connect to zwave via Relays)
    1 robot hover.
    1 Siren
    Node-red server running on android.
    Testing openluup on android.
    Automate App running on andorid Boxes/phones.
    All tv's are connected to android boxes.
    No windows PC.
    Debian running on android box.
    Plugins Reactor, AlexaTTS, Switchboard and Virtual HTTP Switch.

    I can control all of my devices from anyone of these platforms Vera/OpenLuup, Node-red, Automate(phone/tv box) or Alexa.
    All devices have a standard/manual switch for anyone to control, and can be controlled even if my VeraPlus stopped working or internet out. My system is stable and may get a luup reload every couple of weeks.

    None of my sonoff's or tuya have been flashed. I found Shelly very late into game and will be using these more now i found them, as they offer local control.

    I have some coding knowledge from the 90's, but have never worked in the industry.

    Blogs

  • Alarm Clock
    ElcidE Elcid

    I now have node-red setting a silent switching of a v device, by saying "wake me up at [any time and/or day]". also depending which echo i use i can set a different v device, so different morning routines for each bedroom.

    @catman you can also do all your H A Bridge devices in node red to, as it has the local hue lights bridge to. So you could replace H A Bridge with node-red. It would not be difficult to set a http request to set your virtual alarm.

    Plugins

  • First post to say hello
    ElcidE Elcid

    Hi to all, Thought i would join as not to miss out on anygood information that you developers may share here.

    note- The input box for text does not display to well.I can not see what i am typing.
    Android 8 full sreen on tv box using firefox mobile view.
    If i use desktop view everything is ok.

    General Discussion

  • This is me
    ElcidE Elcid

    @CatmanV2 said in This is me:

    Well, if I see further, it's because I stand of the shoulders of giants. I've got where I got because of the experts here.

    Well said.

    Blogs

  • Not so quiet around here :)
    ElcidE Elcid

    @cw-kid

    Yes i am here, as always I will help anyone who asks.

    Just for info - I have no idea what the reason for my suspension, I have contacted CS but they seem to be just ignoring my request for a clear reason.

    As to GDPR if they run servers in europe then we are covered by GDPR, even if they move the servers to the US, as I think there is a privacy agreement with the US.

    aleksandr

    Is there GDPR in the US? - GDPR USA - Cookiebot™

    Is there GDPR in the US? - GDPR USA - Cookiebot™

    Is there GDPR in the US? Let Cookiebot explain GDPR in the USA to make sure you fully understand regulations and how to comply.

    General Discussion

  • Setting RGB colour values
    ElcidE Elcid

    0.5019607843137255, 0, 0.5019607843137255 You may want to round them. LOL

    Multi-System Reactor

  • Removing Orange Notification
    ElcidE Elcid

    Yes thanks for your efforts @DesT

    Comments & Feedback

  • Lua example http post request with json body
    ElcidE Elcid
    -- https request  json body
    -- Enable potentially unsafe lua code in,  user account - security
    local https = require "ssl.https"
    local http = require "socket.http"
    local ltn12 = require "ltn12"
    local json = require "dkjson"
    local payload = {{"test", "test", null, 0}}  --payload to be sent
    
    local request_body = { secret = "1.KAddd87s8s8FasL7-ze4KG_p5hrVg4Kee1-t3vnwGFhI=", to = "test@gmail.com", device = null, priority = "high", payload = payload } --the json body
    local response_body = {}
    request_body = json.encode(request_body)
    
    local r, c, h, s = https.request {
      url = 'https://llamalab.com/automate/cloud/message',
      method = 'POST',
      headers = {
        ["Content-Type"] = "application/json",
        ["Content-Length"] = string.len(request_body)
      },
      source = ltn12.source.string(request_body),
      sink = ltn12.sink.table(response_body)
    }
    
    
    Code/Snippet library

  • Expressions and LuaXP Functions
    ElcidE Elcid

    isNaN([1,2,3]) and isNaN("ten"/2) and isNaN("ten" + "eight") are all true

    Multi-System Reactor

  • Video Doorbells
    ElcidE Elcid

    My door is covered by a hidden microwave sensor. when triggered reactor sends a http request to my phone or tv box, depending on home or away. My phone/box uses Automate to receive the http request, Automate then opens the camera app and displays the camera. I can talk and listen though the camera app. Normally takes 5-10 seconds to complete. If i am home vera sends a TTS to alexa, informing me there is some one at the door.

    IPCam

  • node-red Alexa OpenLuup/Vera voice integration
    ElcidE Elcid

    Here is a simple integration of OpenLuup/vera device to Alexa via Node-red.

    Node-red-Vera/veraalexavoiceintegration.flow at main · E1cid/Node-red-Vera

    Node-red-Vera/veraalexavoiceintegration.flow at main · E1cid/Node-red-Vera

    Node-red flows for Vera. Contribute to E1cid/Node-red-Vera development by creating an account on GitHub.

    The speed is fast sub 1 second responses.

    Requirements -
    node-red.
    alexa.
    node-red-contrib-amazon-echo(local Hue devices).
    openluup or Vera (or any controller via http requests).

    Capabilities-
    Binary switch.
    dimming switch.
    rgb switch.
    Run scenes.

    Each alexa device node is configured in the topic of the amazon-echo device node -
    (device number#type of switch)
    bnary - 123#binary.
    dimming - 123#dimming.
    rgb - 123#colour (W/D is default 310 to adjust colour temp add value to end e.g. 123#colour#300
    scene - 123#scene#124 (123 on 124 off. 124 can be omitted).

    Enter the ip of your controller in the http request block.
    Just copy code and import into Node-red

    [
        {
            "id": "de7838ac.ebead",
            "type": "amazon-echo-hub",
            "z": "8659fc6b.981b4",
            "port": "8980",
            "processinput": "0",
            "discovery": true,
            "x": 150,
            "y": 840,
            "wires": [
                [
                    "cd0ae070.e98378",
                    "a605448.899d8b8",
                    "21ca89ff.b0f6ce"
                ]
            ]
        },
        {
            "id": "a605448.899d8b8",
            "type": "amazon-echo-device",
            "z": "8659fc6b.981b4",
            "name": "bedroom four",
            "topic": "199#colour",
            "x": 410,
            "y": 860,
            "wires": [
                [
                    "688830f.c57775"
                ]
            ]
        },
        {
            "id": "21ca89ff.b0f6ce",
            "type": "amazon-echo-device",
            "z": "8659fc6b.981b4",
            "name": "app safe",
            "topic": "164#binary",
            "x": 390,
            "y": 900,
            "wires": [
                [
                    "688830f.c57775"
                ]
            ]
        },
        {
            "id": "cd0ae070.e98378",
            "type": "amazon-echo-device",
            "z": "8659fc6b.981b4",
            "name": "lounge 1",
            "topic": "8#dimming",
            "x": 390,
            "y": 940,
            "wires": [
                [
                    "688830f.c57775"
                ]
            ]
        },
        {
            "id": "688830f.c57775",
            "type": "function",
            "z": "8659fc6b.981b4",
            "name": "",
            "func": "let types = {\n    \"dimming\":[\"urn:upnp-org:serviceId:Dimming1\",\"SetLoadLevelTarget\",\"newLoadlevelTarget\"],\n    \"binary\":[\"urn:upnp-org:serviceId:SwitchPower1\",\"SetTarget\",\"newTargetValue\"],\n    \"scene\":[\"urn:micasaverde-com:serviceId:HomeAutomationGateway1\",\"RunScene\",\"SceneNum\"],\n    \"colour\":[\"urn:micasaverde-com:serviceId:Color1\",{\"tt\":\"SetColor\",\"hs\":\"SetColorRGB\",\"ct\":\"SetColorTemp\"},{\"tt\":\"newColorTarget\",\"hs\":\"newColorRGBTarget\",\"ct\":\"newColorTempTarget\"}] \t\n}\nfunction binaryPayload(device, type, turnOn, payload) {\n    payload.id = \"action\";\n    payload.serviceId = type[0];\n    payload.DeviceNum = device;\n    payload.action = type[1];\n    payload[type[2]] = (turnOn === true ? 1 : 0);\n    payload.message = payload[type[2]];\nreturn payload;\n}\n\nfunction dimmingPayload(device, type, level, payload) {\n    payload.id = \"action\";\n    payload.serviceId = type[0];\n    payload.DeviceNum = device;\n    payload.action = type[1];\n    payload[type[2]] = level;\n    payload.message = level;\nreturn payload;\n}\nfunction scenePayload(device, type, turnOn, payload) {\n    payload.id = \"action\";\n    payload.serviceId = type[0];\n    payload.action = type[1];\n    payload[type[2]] = (turnOn === true ? device[0] : (device[2] || device[0]));\n    payload.message =\"Run Scene \" + payload[type[2]];\nreturn payload;\n}\n\nfunction rgbPayload(device, types, msg, payload) { \n    if(msg.on === true && msg.meta.changes.on === false && msg.meta[\"input\"].on === true){\n        payload =  binaryPayload(device[0], types[\"binary\"], msg.on, {});\n    }else if (msg.meta.changes.percentage && msg.on === true){\n        payload = dimmingPayload(device[0], types[\"dimming\"], msg.percentage, {});\n    }else if (msg.on === true && msg.colormode === \"hs\"){\n        payload.id = \"action\";\n        payload.serviceId = types[\"colour\"][0];\n        payload.DeviceNum = device[0];\n        payload.action = types[\"colour\"][1][\"hs\"];\n        payload[types[\"colour\"][2][\"hs\"]] =  msg.rgb.join(\",\");\n        payload.message = msg.rgb.join(\",\");\n    }else if (msg.on === true && msg.colormode === \"ct\"){\n        let diff = msg.ct - (Number(device[2]) || 310);\n        msg.ct = (diff < 0) ? \"D\" + Math.min(Math.abs(diff * 1.7),255).toFixed() : \"W\" + Math.abs(Math.min((diff * 1.7),255) - 255).toFixed();\n        payload.id = \"action\";\n        payload.serviceId = types[\"colour\"][0];\n        payload.DeviceNum = device[0];\n        payload.action = types[\"colour\"][1][\"ct\"];\n        payload[types[\"colour\"][2][\"ct\"]] = msg.ct;\n        payload.message = msg.ct;\n    }\nreturn payload;\n}\n\nmsg.topic = msg.topic.split(\"#\").map(Function.prototype.call, String.prototype.trim);\nmsg.hold = msg.payload;\nmsg.payload = {};\nlet type = msg.topic[1] || \"binary\";\nif(msg.topic[1] === \"scene\"){\n    msg.payload = scenePayload(msg.topic, types[\"scene\"], msg.on, {});\n}else if (msg.topic[1] === \"binary\" || msg.percentage === 0 || msg.on === false){\n    msg.payload =  binaryPayload(msg.topic[0], types[\"binary\"], msg.on, {});\n}else if(msg.topic[1] ===\"dimming\"){\n    msg.payload = dimmingPayload(msg.topic[0], types[\"dimming\"], msg.percentage, {});\n}else if (msg.topic[1] === \"colour\"){\n    msg.payload = rgbPayload(msg.topic, types, msg, {});\n}\nlet  error = [\"green\", msg.topic[1] + \" | \" + msg.topic[0], msg.payload.message];\ndelete msg.payload.message;\nif (Object.keys(msg.payload).length < 1){\n    error[0] =\"red\";\n    error[2] =\"failed to create payload\";\n}\nnode.status({\"fill\": error[0],\"shape\":\"ring\",\"text\": error[1] + \" | \" + error[2]});\n\nreturn msg;\n",
            "outputs": 1,
            "noerr": 0,
            "initialize": "",
            "finalize": "",
            "x": 590,
            "y": 940,
            "wires": [
                [
                    "680d28ae.8a163"
                ]
            ]
        },
        {
            "id": "680d28ae.8a163",
            "type": "http request",
            "z": "8659fc6b.981b4",
            "name": "Get request",
            "method": "GET",
            "ret": "txt",
            "paytoqs": "query",
            "url": "http://192.168.1.11:3480/data_request",
            "tls": "",
            "persist": false,
            "proxy": "",
            "authType": "",
            "x": 760,
            "y": 1000,
            "wires": [
                [
                    "cb471442.5d60c8"
                ]
            ]
        }
    ]
    
    Code/Snippet library

  • Expression to randomly run Global Reactions ?
    ElcidE Elcid

    @cw-kid said in Expression to randomly run Global Reactions ?:

    Ideally I'd like for a different colour each time to be selected, but I guess the expression for the random numbers could select the same number again and therefore the colour would not change for that cycle.

    I use this to generate a random number that has not been used last time. In the reaction use express variable randomVal, once the reaction is over set randomVal to
    ${{int(split(join(split("1234567", randomVal || 0),""),"")[floor(random()*6)])}}
    Then every time you get a different number.

    Multi-System Reactor

  • Expression to randomly run Global Reactions ?
    ElcidE Elcid

    @cw-kid This is probably more efficient

    ${{int(substr(replace("1234567", randomVal || 0,""),floor(random()*6),1))}}
    

    Then I looked at moving this to MSR as I have it in Reactor, . I found the remove function and this is now easily expanded to larger number and you can easily set a range

    ${{remove( 1..7, randomVal - 1)[floor(random()*6)]}}
    

    @toggledbits , possible bug
    list(1..7]) gives [[1,2,3,4,5,6,7]] a nested array.
    Is that expected.

    Multi-System Reactor

  • Vera account suspended for a 1000 years
    ElcidE Elcid

    Stange, That post is still up. If that was the cause i would have thought it would have been removed to. If they keep up this tyrannical behaviour the forum will die a death of a thousand cuts.

    Vera

  • Video Doorbells
    ElcidE Elcid

    @sender
    Be careful with the placement as these sensors can see through doors and thin walls, You can block the sensor with thin metal to stop false trips.
    I mounted my sensor in meter cupboard and place a section of angle iron at bottom to stop trips from cats etc. The white box at bottom contains the sensor and Shelly
    20200430_095307.jpg

    IPCam

  • Interfacing Alexa with Reactor via Routines and Dimmer VS
    ElcidE Elcid

    I use an expression set to 0, I update the variable using node-red local alexa(similar to HA Bridge) In reactor I have several RS's that monitor this expression variable for different values, if the reaction is triggered one of the actions will be to set the variable back to 0. You must have no actions in the false reaction, as when expression is reset to 0 the true action will stop as reactor would want to run the false actions. So far no issues. i have 4 RS's monitoring this variable for different values, but it is unlimited.

    Home Assistant

  • Why is this Green and ticked when its not true ? And how to do OR
    ElcidE Elcid

    Yes will fire/go true, if one or more windows,

    You can also add time condition, say you wanted to wait 60 seconds just in case some one just opened window for a few seconds.
    click 3 dots for other options on trigger/condition

    Multi-System Reactor

  • Vera Alexa Plugin 7.32
    ElcidE Elcid

    @librasun Have you tried to install JQuery on the vera, it's is now available with 7.32

    Vera

  • Video Doorbells
    ElcidE Elcid

    I use a
    https://www.ebay.co.uk/itm/AC-110-220V-Microwave-Radar-Sensor-Switch-Body-Motion-Detector-for-LED-Light/274176461640?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
    connected to a Shelly 1, which is integrated with @therealdb Virtul HTTP Switch as a sensor.

    IPCam
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Unsolved