Advice on rule design

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
garnold
Normal user
Posts: 93
Joined: 17 Jun 2019, 03:59

Advice on rule design

#1 Post by garnold » 22 Jun 2019, 04:17

I’d like to have the following happen via a rule.....

1. On system boot have the led stay lit for 3 seconds
2. If WiFi connection is made blink led 3 times slow
3. If MQTT connection is made blink led 3 times fast
4. Publish to MQTT server every 5 mins and blink the led when that happens

I’ve read about the pulse command that I think will help with the led blinking.
As for the others, I’ve read on this forum the possibily using ping could help with this. The issue I have with ping is that I can’t guarantee which ip to hit for testing.

I’m sure there are a few ways to handle this so I thought I would toss this out to the masses for ideas.

garnold
Normal user
Posts: 93
Joined: 17 Jun 2019, 03:59

Re: Advice on rule design

#2 Post by garnold » 22 Jun 2019, 05:45

So here’s my start. I was trying to mess around with variables but didn’t have much luck. I thought I would set them during an event and then test for them later.

On System#Boot do

Pulse,14,1,500


endon

On WiFi#Connected do
Let,1,1
timerSet,1,1
Endon


on Rules#Timer=1 do

Pulse,14,1,500
Pulse,14,0,500
Pulse,14,1,500
Pulse,14,0,1000
Endon

On MQTT#Connected do
Let,2,1
timerSet,2,1
Endon


on Rules#Timer=2 do

Pulse,14,1,500
Pulse,14,0,500
Pulse,14,1,500
Pulse,14,0,500
Pulse,14,1,500

Endon

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

Re: Advice on rule design

#3 Post by ThomasB » 24 Jun 2019, 21:15

I was trying to mess around with variables but didn’t have much luck.
This discussion should help you: viewtopic.php?t=6288

- Thomas

garnold
Normal user
Posts: 93
Joined: 17 Jun 2019, 03:59

Re: Advice on rule design

#4 Post by garnold » 25 Jun 2019, 01:05

Thank you.

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests