"SmartNodeRules" concept idea

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

"SmartNodeRules" concept idea

#1 Post by FanOfHue » 24 Dec 2018, 15:26

I have started to work on a "SmartNodeRules" idea, further explained here: https://github.com/SmartNodeRules/Documentation/wiki

I just finished creating some prototypes to demonstrate how this could work in my own home and so far it seems to work as planned. A plugin for ESPEasy is also available to let it become a node on this network. The concept has been set with KISS and YAGNI in mind (https://en.wikipedia.org/wiki/You_aren% ... na_need_it)

It could be nice to have a RaspBerryPI edition prototype, but my skills on Linux are mainly non existing. and i don't own a RPI (yet).

Would like to hear if someone else likes the idea. If you already own a fancy Home Automation controller, you likely don't need this. But I only have a simple Hue bridge which is limited to lighting stuff. My older Arduino hardware has now been migrated to this concept and I'm using two shortcuts on my smartphone to control everything. One is the Hue app, the other is a web shortcut to the main page on one of the smartnode units. It looks like i don't need much more than this right now.

User avatar
dynamicdave
Normal user
Posts: 130
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK
Contact:

Re: "SmartNodeRules" concept idea

#2 Post by dynamicdave » 24 Dec 2018, 16:20

Hi,
That sounds like a brillant idea - how much of it is workable at the moment???

I have a home automation system running on a couple of RPi-3s using Node-RED and MQTT.
Around the house I have a number of WeMos D1 Minis (re-flashed with ESP Easy) that send various readings (temp, humdiity, pressure, switch settings) via MQTT to NR.
I also have a number of SonOff-S20 mains switches that communicate with NR via Tasmota.
Also some Yeelights and Alexa devices that "talk" to my system.

The current system works really well and has been very reliable for a couple of years.

I have a spare RPi, that I use for development work, that I could devote to checking out your SmartNodeRules.

Looking forward to hearing more of your project development.

Kind regards and Happy Christmas from Dynamic Dave in the UK.

User avatar
ThomasB
Normal user
Posts: 335
Joined: 17 Jun 2018, 20:41
Location: USA

Re: "SmartNodeRules" concept idea

#3 Post by ThomasB » 24 Dec 2018, 21:19

I use OpenHab for home control, so I don't require a standalone solution. But there are ESP Easy that would benefit from your concept. So I just stopped by to show my support.

- Thomas

tim
Normal user
Posts: 25
Joined: 05 Dec 2015, 11:24

Re: "SmartNodeRules" concept idea

#4 Post by tim » 28 Dec 2018, 16:53

I'm using ArduinoEasy for a while with Domoticz. Could be nice to have a small webgui with power control buttons to control this unit directly. Maybe in case Domoticz has crashed like it did a while ago when the SD card in the RPI suddenly died.

ArduinoEasy does not have such an option and it seems there's no development on that version anymore because it is listed as archived on the wiki. My Arduino Mega unit has a double relay board attached so i only need 4 buttons.

But can the ArduinoMegaRules version work with Domoticz?
The wiki says that it works without a centralized Home Automation controller, but can't we have both options, so with and or without?

FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

Re: "SmartNodeRules" concept idea

#5 Post by FanOfHue » 06 Jan 2019, 16:58

tim wrote:
28 Dec 2018, 16:53
I'm using ArduinoEasy for a while with Domoticz. Could be nice to have a small webgui with power control buttons to control this unit directly. Maybe in case Domoticz has crashed like it did a while ago when the SD card in the RPI suddenly died.

ArduinoEasy does not have such an option and it seems there's no development on that version anymore because it is listed as archived on the wiki. My Arduino Mega unit has a double relay board attached so i only need 4 buttons.

But can the ArduinoMegaRules version work with Domoticz?
The wiki says that it works without a centralized Home Automation controller, but can't we have both options, so with and or without?
Well it could be controlled by anything that can send plain UDP text messages to trigger an event on one of the nodes. I don't know if Domoticz can do that?
Maybe I should update the wiki because it was not intended to work as standalone exclusively.

But http control might also be an option as the webserver is still there for that kind of basic tasks like processing events.

FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

Re: "SmartNodeRules" concept idea

#6 Post by FanOfHue » 06 Jan 2019, 17:03

ThomasB wrote:
24 Dec 2018, 21:19
I use OpenHab for home control, so I don't require a standalone solution. But there are ESP Easy that would benefit from your concept. So I just stopped by to show my support.

- Thomas
Thanks for taking the time to respond. I presume that you're using MQTT with OpenHAB? I have a testversion ready that can use both UDP as MQTT as a generic broacast type message bus. Running Mosquitto on Windows, just to verify the workings. Maybe MQTT is a better choice for a message bus, but in case you only have two nodes, you could fallback to bare UDP peer to peer.

But maybe I'm the only one here that thinks that way ? Everyone uses fancy controllers?

FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

Re: "SmartNodeRules" concept idea

#7 Post by FanOfHue » 06 Jan 2019, 17:05

dynamicdave wrote:
24 Dec 2018, 16:20
Hi,
That sounds like a brillant idea - how much of it is workable at the moment???

I have a home automation system running on a couple of RPi-3s using Node-RED and MQTT.
Around the house I have a number of WeMos D1 Minis (re-flashed with ESP Easy) that send various readings (temp, humdiity, pressure, switch settings) via MQTT to NR.
I also have a number of SonOff-S20 mains switches that communicate with NR via Tasmota.
Also some Yeelights and Alexa devices that "talk" to my system.

The current system works really well and has been very reliable for a couple of years.

I have a spare RPi, that I use for development work, that I could devote to checking out your SmartNodeRules.

Looking forward to hearing more of your project development.

Kind regards and Happy Christmas from Dynamic Dave in the UK.
I guess that you have also noticed the RPIEasy project? So it's not needed to build something new. But a universal message bus would still be on my wish list to exchange event between multiple IoT platforms.

User avatar
ThomasB
Normal user
Posts: 335
Joined: 17 Jun 2018, 20:41
Location: USA

Re: "SmartNodeRules" concept idea

#8 Post by ThomasB » 06 Jan 2019, 19:58

Everyone uses fancy controllers?
I suspect that many ESPEasy users {that have elaborate home automation} are using fancy controllers. My automation devices utilize Amazon Echo speech and a lot of rules, so OpenHab is essential to me. But your concept is ideal for those that have less demanding applications.

- Thomas

tim
Normal user
Posts: 25
Joined: 05 Dec 2015, 11:24

Re: "SmartNodeRules" concept idea

#9 Post by tim » 10 Jan 2019, 16:21

On Arduino Mega:

Sending this http://<ip>/control?cmd=gpio,12,1

I get this error:

Unknown or restricted command!

Could you have a look at it?

FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

Re: "SmartNodeRules" concept idea

#10 Post by FanOfHue » 14 Jan 2019, 15:18

tim wrote:
10 Jan 2019, 16:21
On Arduino Mega:

Sending this http://<ip>/control?cmd=gpio,12,1

I get this error:

Unknown or restricted command!

Could you have a look at it?
That should be solved on github now. In the mean time, a new feature has been added to show nodes in groups. A new command:

Config,Group,<group name>

has been introduced. Th main page now shows a list of groups based on the nodelist. Click on a group to show all nodes within that group.

happytm
Normal user
Posts: 47
Joined: 15 Aug 2016, 17:53

Re: "SmartNodeRules" concept idea

#11 Post by happytm » 09 Jul 2019, 21:15

I looked at you wiki page and it is interesting concept. I sometimes need minimum setup for small project.we have ongoing discussion at https://github.com/enesbcs/rpieasy/issues/73 regarding ESP-Now protocol.Please share your thoughts there.I am trying to understand few things from your wiki.

- Does this implementation support dummy sensor ? For me dummy sensor plugin makes rule engine more powerful.
- are any other plugin supported ? if so how to implement them ? I would like to have both IR plugins standard in any implementation.

Thanks

FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

Re: "SmartNodeRules" concept idea

#12 Post by FanOfHue » 15 Jul 2019, 17:00

happytm wrote:
09 Jul 2019, 21:15
I looked at you wiki page and it is interesting concept. I sometimes need minimum setup for small project.we have ongoing discussion at https://github.com/enesbcs/rpieasy/issues/73 regarding ESP-Now protocol.Please share your thoughts there.I am trying to understand few things from your wiki.

- Does this implementation support dummy sensor ? For me dummy sensor plugin makes rule engine more powerful.
- are any other plugin supported ? if so how to implement them ? I would like to have both IR plugins standard in any implementation.

Thanks
I've created that project because I needed a small core for private development of plugins. Size is only 350k so I can OTA without a double step on the older 1M modules. It also leaves a lot of free RAM to use for plugins.

It's in stable production for approx. 6 months now and has not required any updates since. It does not work with devices but instead all is scripted using the ESP Easy rule engine. I guess the dummy device is used to store measurements, but this project just uses named variables that can be used within the rule engine. Plugins need to be modified because the configuration will be command based instead of a gui.

So in short: it's just a network core with a web-based script editor and a rule engine.

happytm
Normal user
Posts: 47
Joined: 15 Aug 2016, 17:53

Re: "SmartNodeRules" concept idea

#13 Post by happytm » 16 Jul 2019, 02:16

Understood.

Thanks.

TD-er
Core team member
Posts: 1268
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: "SmartNodeRules" concept idea

#14 Post by TD-er » 16 Jul 2019, 11:03

I really like the idea.

The ESPeasy p2p protocol is getting some rewrite to share plugin data among nodes.
If you need any changes/additions or have some good ideas, please let me know.
This is just something I was thinking about also, but was not yet able to make it due to time and time lost in the track of WDT reboots.

Edit:
If you like, I can also add this plugin to the main builds: https://github.com/SmartNodeRules/ESPEa ... eRules.ino

FanOfHue
Normal user
Posts: 26
Joined: 06 Oct 2018, 10:08

Re: "SmartNodeRules" concept idea

#15 Post by FanOfHue » 16 Jul 2019, 17:40

TD-er wrote:
16 Jul 2019, 11:03
I really like the idea.

The ESPeasy p2p protocol is getting some rewrite to share plugin data among nodes.
If you need any changes/additions or have some good ideas, please let me know.
This is just something I was thinking about also, but was not yet able to make it due to time and time lost in the track of WDT reboots.

Edit:
If you like, I can also add this plugin to the main builds: https://github.com/SmartNodeRules/ESPEa ... eRules.ino
In my home, all is now driven from simple textbased UDP messages. Philips Hue is controlled through a Windows .net version of SmartNodeRules. (because the windows node can run SSL very fast. ESP32 can also do it, but it takes a few seconds to establish the SSL connection)
Any node can control Hue lights and sockets using the Windows Node as an SSL bridge to Hue.

The ESP build-in P2P protocol was a binary format version and i decided to use just plain text messages on a broadcast UDP port instead of unicast.
Much easier and a lot faster. I've also added a very basic 'confirmation' option, but i've not used it yet.

I admit that the protocol is not secure at all, but it only lives in the dedicated VLAN where all IOT devices are connected.
Maybe it would need some form of encryption with a preshared key to make it more secure but still keep it simple to operate.

TD-er
Core team member
Posts: 1268
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: "SmartNodeRules" concept idea

#16 Post by TD-er » 16 Jul 2019, 19:28

FanOfHue wrote:
16 Jul 2019, 17:40
[...]
The ESP build-in P2P protocol was a binary format version and i decided to use just plain text messages on a broadcast UDP port instead of unicast.
Much easier and a lot faster. I've also added a very basic 'confirmation' option, but i've not used it yet.
[...]
About the broadcast messages. Do you miss some every now and then on nodes connected to WiFi?
One of the things I really want to change is the way the p2p protocol is sending packets to any other node using unicast.
That's at least O(n^2) and maybe even worse.
But I've noticed sometimes broadcast messages get lost on some of the WiFi connected nodes.
Even unicast messages sometimes get lost.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests