[SOLVED] - Force controller update for dummy value

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rudloffl
Normal user
Posts: 43
Joined: 04 Jul 2019, 07:17

[SOLVED] - Force controller update for dummy value

#1 Post by rudloffl » 05 Aug 2019, 06:19

Hello everyone,

I'm still working on my sprinkler system (8 relais + 8 buttons + LCD display). I'm storing the value of the active sprinkler in a dummy variable (1 to 8), and I would like to update the controller (jeedom over general http) immediately.
I can use the interval update to put lower refreshing value but I believe it's not a great solution (Impossible to put 0 like other devices to automatically update on value modification).

Is there a rule command I could use to force the update to the controller:
- I was hoping that publish could do the job, but I believe in only works with mqtt
- I can use a sendtohttp, but it seems over-complicated, it could also lead to wrong value transferred (I'm setting a taskvalue and have to feed again the value in the http link)
- I have seen some jeedom user using "Jeedom virtuals", but you need to use an API code hard coded in the rules... Also seems an overkill (I might be wrong)
- When I decrease the automatic refresh rate, I have noticed some stability issues (I might be wrong on that one too)

Is there a good solution to force the update to the controller for dummy (since the value is not automatically update for the dummies).

Thanks for your help
Last edited by rudloffl on 06 Aug 2019, 05:51, edited 1 time in total.

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

Re: Force controller update for dummy value

#2 Post by TD-er » 05 Aug 2019, 20:12

You can use TaskRun for this.
It needs the number of the plugin in the plugin list.
So for instance if your dummy variable is in slot 8 on the device page, you call
TaskRun 8

For example one of my rules on a tracker I made (triggered on a GPS position update):

Code: Select all

on gps#long do
  TaskValueSet 7,1,[S8#co2]
  TaskValueSet 7,2,[S8#T]
  TaskValueSet 7,3,[bat#V]
  TaskValueSet 7,4,[sys#uptime]
  TaskValueSet 8,1,[sys#rssi]
  TaskValueSet 8,2,[bme#T]
  TaskValueSet 8,3,[bme#H]
  TaskValueSet 8,4,[bme#P]
  TaskRun 7
  TaskRun 8
endon

rudloffl
Normal user
Posts: 43
Joined: 04 Jul 2019, 07:17

Re: Force controller update for dummy value

#3 Post by rudloffl » 06 Aug 2019, 05:50

Yep, exactly what I was looking for !

Taskrun works as expected, many thanks

Jedrunia
Normal user
Posts: 12
Joined: 28 Mar 2019, 09:22

Re: [SOLVED] - Force controller update for dummy value

#4 Post by Jedrunia » 06 Aug 2019, 15:10

Or for the last updated value in dummy device you can use:
TaskValueSetAndRun command

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 25 guests