No, you can't do that using Sonoff since it is an on-off switch with relay.
You need an Triac to do that. Normally the brightness control applications for AC will be done through Triac by changing the firing angle.
Short answer is yes, at least according this feature request:
Define convention for 'stateful' sessions #63
This request is closed with a commit stating that a web socket node is added, which is based on a session token.
The payload comes from the incoming message. It does not make sense to define a static payload in the MQTT-out node.
The entry in the node-settings is just a mouse over label for the input, since nodes can only have 1 input it's not that useful, it's more for when nodes have multiple outputs to make it easier to identify which output is which.
In the case ...
You need to look at the Node-RED Admin API, this will allow you to retrieve the current flow, you can then manipulate it and push an updated version back to the runtime.
Flows are represented as JSON objects that have entries for each node on the canvas and the links between them.
The best place to get help with the API will be on the Node-RED forum or ...
From the documentation:
If the error is one that a user of the node may want to handle for themselves, the function should be called with the original message (or an empty message if this is an Input node) as the second argument:
node.error("hit an error", msg);
This will trigger any Catch nodes present on the same tab.
So calling node.error() ...
Alexa does not have any device types that support humidity at the moment, so this is not possible using the Smart Home Skills.1
Here is the list of device types and their capabilities.
You could create your own normal skill, but this would mean asking something like "Alexa, ask FooBar what the humidity is". There is a node for Node-RED to do normal skills ...
The answer is no and yes.
Flows in node-red are pretty static, there is no notion of instantiating a flow when the first requests comes in such that you might have an instance of a flow per request.
There is also no built-in notion of a session that would allow you to associate messages flowing through flows with a session.
However, you can relatively ...
You have edited the wrong settings.js file. The version in the node_modules/node-red directory is the template that gets copied to the User directory when Node-RED is started for the very first time.
When Node-RED starts it logs the settings file it is using as follows:
21 Jul 13:31:49 - [warn] ------------------------------------------------------
21 Jul ...
It's worth remembering that everything in the NodeJS world is asynchronous which means nothing blocks the event loop.
In this case it sounds like you get the first incoming message, which you store with a fixed key in the flow context, you then move on to the Select query. At this point the SQL node is going to end up doing some network IO which will block ...
Indeed you can! Regarding what you are most comfortable with you can use different technology as a broker.
For instance you can use :
Which is a well know opensource mqtt broker. You'd find plenty of tutorial/example to help you getting started.
If you're a node guy, I've tested https://github.com/mcollina/mosca which works very ...
Finally, I was able to achieve my target to be able to query Alexa for custom sensor readings without the need to program my own skill.
The following elements are used in my setup:
A Raspberry Pi in my home LAN with Node-RED installed on it
Some source for a sensor signal (in my case a Nodemcu with a DHT22 sensor that sends the humidity readings via ...
If I were you I'll do the following :
Pick a master that will be in charge of asking for information to the other
Pick a slave you're familiar with, they will be in charge of responding the master
Choose the communication protocol you are familiar with
Enumerate all the modules you can be using
Now the more flexibility you will want the more complexity ...
I would make many wifi modules. Then you can use a variety of higher-level tools like node-red to quickly sequence complex actions and reactions.
Wire an ESP8266 to all the things, and give each a generic low-level rest API in the firmware. For a relay module, this might support three endpoints: /on, /off, and /toggle. A temp sensor could have one like /...
There are devices made specially for dimming using only on-off impulses to set the brightness. A common pattern is to use a short on/off signal for on/off, and a longer on/off signal to increase brightness in n % steps.
So provided you can make the Sonoff switch on and off sufficiently fast, and reliably to get the timing right, adding a device like this or ...