@jdaviso1/node-red-velair 0.1.2

Node-RED nodes to control UFLEX Velair smart air conditioners over their local Wi-Fi API (unofficial)

npm install @jdaviso1/node-red-velair

@jdaviso1/node-red-velair

Node-RED nodes to control UFLEX Velair smart air conditioners over the local network, through the HTTP API of their Wi-Fi module. Turn the AC on and off, set the mode, temperature, fan speed and night mode, and read its status, all from your own flows.

Unofficial. This project is not affiliated with, endorsed by, or supported by UFLEX or Innova Energie. The unit's local API is undocumented and could change with a firmware update. Use at your own risk.

Contents

Features

  • Local only. Talks to the AC directly on your network.
  • Every command is confirmed. The AC answers "received" even when it ignores a command, so after each change the node reads the status back and only reports success when the AC really shows the new setting. If it doesn't, the command is resent once.
  • Gentle with the AC. The unit's web server is small: each AC gets one request at a time, in order, with a short pause between requests. Any number of nodes and flows can share one AC safely.
  • Rides through hiccups. Requests the AC misses are retried (the Wi-Fi module occasionally restarts), within a 25-second limit per command.
  • °C or °F, per AC.
  • Errors go to Catch nodes, with a short message and machine-readable details.
  • An example flow with link nodes for your other flows and HTTP endpoints for phone shortcuts and scripts.

Requirements and tested units

  • Node-RED 3.0 or later, Node.js 18 or later. Tested with Node-RED 4 (automated tests, Node.js 18–24) and Node-RED 5.0 (daily use on a Raspberry Pi); Node-RED 3 hasn't been tried.
  • A Velair air conditioner with the Velair Wi-Fi module, already set up on your Wi-Fi with the official Velair app.
Model Wi-Fi firmware Result
Compact i16VSD SMART, Generation II 20.0.0 works

Using another model or firmware? Please open an issue saying whether it works, so this table can grow. The firmware version is the firmware field of the node's output.

Install

In Node-RED: Menu → Manage palette → Install, search for velair, and install @jdaviso1/node-red-velair.

Or from a terminal, in your Node-RED user directory (usually ~/.node-red), then restart Node-RED:

npm install @jdaviso1/node-red-velair

Before you start

  • Give the AC a fixed IP address. The nodes find the AC only by its address. Make a DHCP reservation for it in your router (or give it a static IP). If the address changes, commands could reach another device, or, with several ACs, the wrong AC, and still look successful. A host name only works if your router provides one, and each AC needs its own; with no name available, use the IP address.
  • To find the IP address: open the Velair app and look on the Advanced tab. You can also look in your router's list of connected devices (the Wi-Fi module may show up as an Espressif device). To check it's the AC, open http://<IP>/api/v/1/status in a browser: you should see a JSON reply that includes "success":true.
  • The AC's local API has no password. Anyone on your network can control it. Never port-forward it to the internet. Remote access configuration on the Remote access tab in the Velair app is not supported. See Security and privacy.

Quick start

  1. Drag a velair ac node (palette category Velair) onto a flow.
  2. Double-click it. Next to AC unit, click the pencil to add a unit: give it a name (e.g. Saloon), the AC's IP address, and °C or °F. Click Add, then Done.
  3. Click Deploy. The node reads the AC's status once: after a moment, its status line should show something like ready · OFF · cooling · 26°C (room 28°C).
  4. Send it messages, e.g. from an inject node with msg.topic = setpoint and msg.payload = 24, and wire a debug node to its output.

Or import the ready-made example: Menu → Import → Examples → @jdaviso1/node-red-velair → velair-ac-http, then set the AC unit's IP address (see the example flow).

Using the node

The two nodes

  • velair-unit (configuration node): one per AC. Name, IP address, °C/°F. All the nodes that use the same unit share its queue.
  • velair ac: does one thing per message: a command or a status read. Use as many as you like.

The node's Action setting chooses what it does:

Action Takes from the message
from msg.topic (default) msg.topic = the action, msg.payload = the value
Power on / Power off nothing
Set mode / Set temperature / Set fan / Night mode msg.payload = the value
Read status nothing

Commands

msg.topic msg.payload
power on / off (also true/false, 1/0, yes/no)
mode cooling, heating, auto, fanonly
setpoint 16–31 °C, or 61–88 °F if the unit is set to °F; rounded to a whole degree
fan 0–3, see fan speeds
night on / off (same values as power)
status anything (ignored)

Topics and values are case-insensitive. An invalid value is refused with an error, and nothing is sent to the AC.

While the AC is off, mode commands are refused (nothing is sent), because on the tested unit a mode change switches the AC on. Turn it on first. Fan and setpoint changes work while it's off, and are kept for when it's switched on.

Fan speeds

The values match the fan keys on the wall panel:

fan Panel What it does
0 AUTO the unit varies the fan speed, faster the further the room is from the setpoint
1 moon minimum speed, compressor at reduced power. The unit also moves the setpoint by itself: up 1 °C after one hour and another 1 °C after two hours when cooling (down when heating)
2 one fan medium speed
3 two fans maximum speed

(From the unit's manual and tests on a Compact i16VSD SMART.) The fan setting is kept when the AC is switched off and on.

Night mode is the moon setting: night on sets the fan to 1, and night off sets it to 0 (AUTO), not back to the speed it had before.

The output's fan uses the same numbers as the commands, so what you send is what you read back. (On Wi-Fi firmware 20.0.0 the AC's own status field reports 1 and 2 the other way round; the node swaps them back. raw.fs shows the AC's value.)

Output

When a command is confirmed (or a status read succeeds), the node sends the message on with:

  • msg.topic = "status"
  • msg.command = what was confirmed, e.g. "setpoint 24°C", or null for a status read
  • msg.payload = the AC's status:
Field Example Meaning
name "Saloon" the unit's name from its configuration node
power "on" "on" or "off"
on true the same as a boolean
mode "cooling" cooling, heating, auto, fanonly, dehumidification (if the unit is in that mode), or unknown(n)
setpoint 24 target temperature, in the unit's °C/°F
roomTemp 27 room temperature measured by the AC, in °C/°F (see limitations)
fan 2 fan speed setting, 0–3 (see fan speeds)
night false night mode
alarms [] alarms reported by the unit
wifiSignal -58 Wi-Fi signal strength in dBm
summary "Saloon: ON · cooling · 24°C (room 27°C)" ready to show on a dashboard or phone
serial, ip, firmware the unit's serial number, IP address and Wi-Fi firmware
raw { ... } every field exactly as the AC sent it

A value the AC doesn't send, or that doesn't make sense (e.g. a room temperature of 200 °C), comes out as null, shown as ? in the summary.

All other message properties pass through untouched (so msg.res from an http in node still works).

Errors

Errors are reported to Catch nodes, with the original message plus:

  • msg.error.message: a short text, e.g. AC not reachable or setpoint 22°C not confirmed: AC shows setpoint=26
  • msg.velairError: details for your flow to act on:
Field Meaning
kind input: refused before anything was sent (bad value, or a setting the unit won't accept). device: the AC didn't answer, refused, or didn't apply the command. internal: a bug in this module, or the flow was redeployed while a command was in progress.
stage where it happened: queue (too many commands waiting), status (status read), lookup (the status check before a command), command (sending it), verify (reading it back)
topic the action, e.g. setpoint
value the refused value (input errors from bad values)
attempts how many times the request or command was tried
detail the start of what came back, or the network error, for troubleshooting
status for "not confirmed": the status object showing what the AC does show

For example, to answer an HTTP request with 400 for bad input and 502 when the AC is at fault, a function node after a Catch node could do:

const kind = (msg.velairError || {}).kind;
msg.statusCode = kind === "input" ? 400 : kind === "device" ? 502 : 500;
msg.payload = { ok: false, error: msg.error.message };
return msg;

The example flow does exactly this.

The status line

Every velair ac node shows the state of its AC:

Status Meaning
grey ring checking… reading the AC's status after deploy
green dot ready · ON · cooling · 24°C (room 27°C) the AC is on (grey dot when it's off)
blue setpoint 24°C…, … sent, checking a command is in progress (on the node that sent it)
yellow AC not reachable, retry 1 in 2s the AC missed a request; retrying
yellow … not applied (setpoint=26), resending the AC didn't show the change; sending it once more
red dot unreachable (192.168.0.50) or an error the last command or status read failed
red ring a message refused before reaching the AC (bad value, missing setting), e.g. IP address not set on the Velair unit, on the node that sent it

The node doesn't poll the AC: the status line shows the result of the latest command or status read.

What happens when you send a command

  1. Queue. Commands to one AC run one at a time, in the order they arrive. Each must finish within 25 seconds of arriving. At most 10 can wait; more are refused at once (too many queued AC commands): that usually means a flow is looping.
  2. Look up. The node reads the AC's status. If the unit would ignore the command (heating or cooling disabled, hotel mode limiting the setpoint), or would switch on by surprise (a mode change while the AC is off), it's refused here and nothing is sent.
  3. Send the command.
  4. Wait 2 seconds for the AC to apply it, or 7 seconds for fan and night commands: for a few seconds after a fan change the AC just repeats the value it was sent, before showing the real one.
  5. Verify. Read the status back. If it shows the new setting, the node outputs the status. If not, the command is resent once; if it still doesn't show, the node reports … not confirmed: AC shows ….
  6. Mode only: check it holds. A unit that doesn't support a mode shows it at first and changes back a few seconds later, so mode commands are read once more after 5 seconds. If the mode changed back, the node reports … not confirmed: AC changed back, shows ….

A request the AC doesn't answer (4-second timeout) is retried after 2, 4 and 8 seconds, as long as the 25-second limit allows. A command the AC explicitly refuses is sent at most twice.

Situation Typical time
Status read under 0.1 s
Command (send, wait, verify) about 2.5 s
Fan or night command, or mode command (with the second check) about 8 s
Command that needed resending 5–7 s
AC unreachable gives up after about 18 s; never more than 25 s

The example flow: HTTP endpoints and phone shortcuts

Import it with Menu → Import → Examples → @jdaviso1/node-red-velair → velair-ac-http. It adds a tab with one velair ac node and:

  • Link-in nodes for your other flows: AC Power On, AC Power Off, AC Set Mode, AC Set Temp, AC Set Fan, AC Night Mode, AC Get Status. Each has a test inject button.
  • Link-out nodes with the results: AC Status (the status object) and AC Error ({ error, kind, topic, ... }).
  • HTTP endpoints, for phone shortcuts, scripts and browsers.

After importing, double-click the Velair AC node, edit the My AC unit, set its IP address, and Deploy.

Endpoints

Replace <node-red> with your Node-RED address and port, e.g. 192.168.0.10:1880.

Method URL Does
GET http://<node-red>/velair/ac/status read the status (also works in a browser)
POST http://<node-red>/velair/ac/power/on turn on (off to turn off)
POST http://<node-red>/velair/ac/mode/cooling set the mode (cooling, heating, auto, fanonly)
POST http://<node-red>/velair/ac/setpoint/24 set the temperature
POST http://<node-red>/velair/ac/fan/2 set the fan speed (0–3)
POST http://<node-red>/velair/ac/night/on night mode (on / off)

Commands use POST. Typing a command URL into a browser's address bar sends a GET, which won't match.

Replies are always JSON, with ok and a ready-to-show summary:

HTTP code When Body
200 success the status object (without raw), plus ok: true and command
400 input error { ok: false, error, summary }
502 device error { ok: false, error, summary }, plus status for "not confirmed"
500 internal error { ok: false, error, summary }
504 no reply within 30 s (a safety net; shouldn't happen) { ok: false, error, summary }

From a terminal:

curl http://<node-red>/velair/ac/status
curl -X POST http://<node-red>/velair/ac/power/on
curl -X POST http://<node-red>/velair/ac/setpoint/23

iPhone Shortcuts

To make an "AC On" shortcut:

  1. Create a new shortcut and add Get Contents of URL.
  2. Enter http://<node-red>/velair/ac/power/on.
  3. Tap Show More and set Method to POST. The request body can stay empty.
  4. Add Get Dictionary Value, with Key summary, from the previous step's contents.
  5. Add Show Result.

Running it shows e.g. Saloon: ON · cooling · 26°C (room 28°C), or an error such as AC error: AC not reachable. Duplicate the shortcut and change the URL for the other actions. For a status shortcut, use the status URL with method GET.

Away from home: the endpoints only work on your own network. For remote use, run a VPN such as Tailscale or WireGuard on the phone and use the Node-RED machine's VPN address. Don't expose them with port forwarding.

More than one AC

Each AC needs its own velair-unit configuration node. The simplest way:

  1. Select everything on the example tab, copy it, create a new tab and paste.
  2. In the copy, double-click the velair ac node, choose Add new velair-unit… for the AC unit, and set the second AC's name and IP address.
  3. Change the two http in paths, e.g. /velair/ac/… to /velair/saloon/….
  4. Rename the link-in and link-out nodes so you can tell them apart, e.g. Saloon AC Power On.

Troubleshooting

Symptom Likely cause and fix
no AC unit configured Double-click the node and choose or add an AC unit.
IP address not set on the Velair unit Edit the AC unit, enter its IP address, and Deploy.
AC not reachable / unreachable (<IP>) Check the IP: open http://<IP>/api/v/1/status in a browser. Check the AC has power and is on Wi-Fi (try the Velair app). If the browser request hangs too, the Wi-Fi module may be stuck: switch the AC off at its breaker for a minute.
… not confirmed: AC shows … The AC received the command but didn't apply it. msg.velairError.status shows what it does show. Possible causes: the unit's own settings, the wall panel or the Velair app changing it at the same moment, or a value the unit doesn't support.
heating is disabled on this unit, cooling is disabled on this unit, hotel mode limits the setpoint to … The unit's own configuration doesn't allow it, so the node refuses instead of sending a command the AC would ignore.
the AC is off: … The mode can only be changed while the AC is on (a mode change would switch it on). Send power on first.
mode … not confirmed: AC changed back, … The unit doesn't support that mode (the tested Compact i16VSD doesn't do fanonly).
The setpoint went up by itself Fan speed 1 (the panel's moon key) raises it by up to 2 °C over two hours when cooling. Use another fan speed.
AC refused … The AC answered with success: false. Check the value is one the unit supports.
timed out waiting for earlier AC commands Commands backed up behind an unreachable AC. Fix the connection; nothing to change in the flow.
too many queued AC commands More than 10 commands were waiting: usually a flow that loops or sends on every sensor update.
node redeployed A command was in progress when the flow was redeployed. Send it again.
A brief yellow retry … status Normal: the AC missed a request (e.g. its Wi-Fi module restarted) and the node is retrying.
HTTP endpoint returns 404 Wrong path or method. Status is GET …/status; commands are POST …/<action>/<value>.

Known limitations

  • Room temperature is reported in whole °C only (the wall panel shows tenths; the API doesn't).
  • Modes depend on the unit. The wall panel only switches between heating and cooling. The node accepts the modes the official app offers (cooling, heating, auto, fanonly), but the tested Compact i16VSD changes back from fanonly within seconds (reported as not confirmed). There's no dehumidification mode, as in the app; if the unit is in that mode, the status shows dehumidification.
  • No schedules. The unit's built-in weekly schedule isn't supported; use Node-RED to schedule commands instead.
  • The status doesn't say whether the compressor is running. While the unit was heating (sun symbol on, warm air), nothing in its status changed; it only reports the mode and setpoint.
  • Hotel mode limits the setpoint (heating 16–24 °C, cooling 22–28 °C), and a unit can be configured not to heat or not to cool. The node refuses commands these settings would block.
  • No polling. The node only talks to the AC when it gets a message.
  • One model tested so far (see the table). Other models or firmware may differ; the read-back check will report commands that don't take effect.

Security and privacy

  • The AC's local API has no password. Anything on your network can control the unit. Keep it on a network you trust and never port-forward it to the internet.
  • Node-RED's HTTP endpoints have no password either, unless you set httpNodeAuth in Node-RED's settings.js. For remote access, use a VPN rather than port forwarding.
  • The unit also talks to the manufacturer's cloud, which is how the Velair app works away from home. This module never contacts the cloud: it only talks to the AC's local address.
  • The status output includes the unit's serial number. Treat it as private: don't post it in screenshots or issue reports.

Development

npm install
npm test                 # unit and flow tests, against a simulated AC
npm run build:example    # after editing examples/src/*.js

The example flow's function code lives in examples/src/ and is built into examples/velair-ac-http.json; a test fails if they're out of step.

What's known about the unit's local API (endpoints, status fields, and endpoints to stay away from) is in docs/velair-api.md.

Licence and trademarks

MIT, see LICENSE. UFLEX and Velair are trademarks of their respective owners, used here only to describe compatibility.

Node Info

Version: 0.1.2
Updated 1 day ago
License: MIT
Rating: 5.0 1

Categories

Actions

Rate:

Downloads

0 in the last week

Nodes

  • velair-unit
  • velair-ac

Keywords

  • node-red
  • velair
  • uflex
  • air conditioner
  • marine
  • hvac

Maintainers