Yesterday I got notification about this video and watched it, and I was amazed. Dave got to the root of the problem and found genius solution how to handle it! We all know that “Open Source H…
Sonoff is a WiFi wireless switch that can connect to appliance of different types and brands. Sonoff sends data to cloud platform through the WiFi Router, which enables you to remotely control all appliances with the App eWeLink on your smart phone.
Source: PSF-A85 WiFi Wireless Module
Variables is a big thing in the VSCP daemon. You may wonder why? What the fuck, can a variable be sexy or even be an interesting feature. I would say yes. But don’t trust me. Read on.
In VSCP land two sorts of variables are known. Persistent and non persistent. This is all about sessions. A non persistent variable is fast but is sent to never never land after a power loss or a VSCP daemon restart. That is, they get lost when a session ends. Still useful for many things. But never around for to long. A bit like money if you think of it. At least my money. Fun and useful when they are around.
The other type, the persistent one, lives also after a power drop and a VSCP server restart. They live and survive also over sessions. That is, works just as they where a database items. Tell you a secret? They are. They are just exposed to the word as a “variable”.
All VSCP variables have a type. The type tells what sort of value a variable holds. There are plenty of types. First there are types like a string, integer, long, double, boolean. A string just stores some sort of text, just as an integer type stores a number and so on. You have date, time and that kind of thing also of course.
Well a short explanation may be in place. The scripts can be executed by the daemon when an event is received. Yes you can program your advanced scenes with them. The HTML pages and user interface parts are holders for user interface elements for your particular setup.
The great things with variables is that they are remotely available. To write a variable from an Arudino or some other board just log into the TCP/IP interface and issue
variable write current-temperature 13.31
to set an integer variable value to the value “13.31”. Or to read its value
variable readvalue current-temperature
which will return the variables current value. You can do this from anywhere. From small things or from php scripts and from large things.
it’s not just through the tcp/ip interface you can handle variables. You can reach them over all interfaces. The REST interface. The websocket interface. The MQTT interface. The CoAP interface. They are accessible from all parts of the system.
So in their simplest form. Variables is just a storage position. You store something in them. But once stored they can be displayed, calculated with, being the source for complex decisions or automatically be sent to other parts of a system for that part to carry out great things when they arrive.
which is state of the art of course.
Yes I definitely think that VSCP variables is a sexy thing.