Events system thread (questions and feedback)

Must be cleaned all topics go to the right subforum
Tom23
Posts: 1
Joined: Tuesday 28 January 2014 17:00
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Events system feedback thread

Postby Tom23 » Tuesday 28 January 2014 20:21

Hello,
First, sorry for my english, but i'm french.

I'm trying to make a lua time script to do twitter notification with the line command client TTytter.
When i launch manually a script like this:

Code: Select all

commandArray = {}
t1 = os.date("%M")
t2 = t1
if t2 <= "57" then os.execute('/home/pi/ttytter/ttytter -status="test"')
--os.execute('sudo killall TTYtter')
print("Tweet envoye "..t1)
end

It's works fine and the message is post. But when domoticz launch the same script automatically, the ttytter's process run on 100%, dont post and dont stop. I must kill the process.
In the process list in htop i see two process:
-ttytter
-/home/pi/ttytter/ttytter -status="test"
I don't if it's normal.

Can you help me ?

Yihaaa
Posts: 67
Joined: Sunday 14 July 2013 10:31
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands

Re: Events system feedback thread

Postby Yihaaa » Tuesday 11 February 2014 21:51

I am trying to set up an event for automatic switching on some lights in my living room. I want when I enter the room between 06:00 and upto sunrise three lamps to go on. They have to switch on and stay on until it is sunrise.

But somehow it doesn't work, does somebody know what is wrong and how to correct this?
Attachments
Scene.PNG
Scene.PNG (26.38 KiB) Viewed 2631 times
Last edited by Yihaaa on Tuesday 11 February 2014 22:57, edited 1 time in total.

User avatar
CopyCatz
Developer
Posts: 751
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Events system feedback thread

Postby CopyCatz » Tuesday 11 February 2014 22:29

You can only do on for x minutes. How on earth is the system going to make sense of "sunrise minutes"?

Yihaaa
Posts: 67
Joined: Sunday 14 July 2013 10:31
Target OS: Raspberry Pi
Domoticz version: beta
Location: The Netherlands

Re: Events system feedback thread

Postby Yihaaa » Tuesday 11 February 2014 23:00

Well I thought so actually, and hoped the system was kind of smart to know this.
Some other ideas to make sure that the lights are only switched on in the described time frame? And go off when sun rises?

CodeItAway
Posts: 34
Joined: Tuesday 11 February 2014 22:44
Target OS: Linux
Domoticz version:
Contact:

Re: Events system feedback thread

Postby CodeItAway » Tuesday 11 February 2014 23:15

I am trying to set the setpoint temperature on a OTGW using a blockly script but i keep getting a: Malformed action sequence! in the logs.
What am I doing wrong?
thermostat.PNG
thermostat.PNG (6.08 KiB) Viewed 2620 times

I also tried setting the value in a LUA script, but that isn't working either (with no errors).

ace2
Posts: 30
Joined: Sunday 02 February 2014 14:34
Target OS: Linux
Domoticz version:
Contact:

Blocky problem

Postby ace2 » Sunday 16 February 2014 17:18

I have a problem i have a switch that i always will have on,
Lets say the power go off then it shud turn this switch on even if i accidently turnd it off shall it turn it self on.
How do i do that whit blocky ?

SweetPants
Posts: 1217
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V3.7377
Location: The Netherlands
Contact:

Re: Blocky problem

Postby SweetPants » Sunday 16 February 2014 17:25

Hmm, don't know if this is possible with Blockly
You can use 2 LUA scripts to do this.

script_time_always_on.lua (called every 60 sec) will turn on your light after start of domoticz

commandArray = {}
if (otherdevices['Lamp_2_Woonkamer'] == 'Off') then
commandArray['Lamp_2_Woonkamer'] = 'On'
end
return commandArray

script_device_always_on.lua (after device change) will turn your light on again if you turn if off

commandArray = {}
if (devicechanged['Lamp_2_Woonkamer'] == 'Off') then
commandArray['Lamp_2_Woonkamer'] = 'On'
end
return commandArray

Harry

User avatar
mbliek
Posts: 800
Joined: Friday 12 July 2013 14:08
Target OS: Raspberry Pi
Domoticz version: beta
Location: the Netherlands
Contact:

Re: Blocky problem

Postby mbliek » Sunday 16 February 2014 17:28

It's not a problem. Just a question about how to do. Merged with the events feedback thread.
Op zoek naar een Domoticz Start Set?


Like ons op Facebook en krijg een cadeaubon van €5,00

ace2
Posts: 30
Joined: Sunday 02 February 2014 14:34
Target OS: Linux
Domoticz version:
Contact:

Re: Events system thread (questions and feedback)

Postby ace2 » Sunday 16 February 2014 19:55

That was a nice one SweetPants. Thanks for that
But if i whil send a "on" comand every 10 min ?

gabou14
Posts: 1
Joined: Monday 03 March 2014 1:54
Target OS: Linux
Domoticz version:
Contact:

Re: Events system thread (questions and feedback)

Postby gabou14 » Monday 03 March 2014 1:56

Hi !

I'd like to use external text to speech notification in the events using the blockly interface, but everytime I add a space in the url of the openURL action, it doesn't work.
I also tried with the characters encoded (%20), it does not seem to work either.

Am I doing something wrong ?

Thank ou very much !

simonrg
Posts: 1046
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version:
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Postby simonrg » Friday 02 May 2014 19:35

I think you need commandArray['UpdateDevice'] = ..... you can find an example of its usage for energy logging in the Wiki here - http://www.domoticz.com/wiki/Capturing_Energy_Usage_with_Lua_Scripts - commandArray['UpdateDevice'] = id .. "|0|" .. power .. ";" .. energy, not sure about exact format for humidity and temperature, but knowing the humidity and temperature ids I guess it should be a matter of just writting the values back to them.
Raspberry Pi 2 B - [email protected] PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

simonrg
Posts: 1046
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version:
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Postby simonrg » Friday 02 May 2014 22:23

Using commandArray['UpdateDevice'] to update the value, updates the device, so yes this modifies the otherdevices_lastupdate to the time / date at which the update occurs.
Raspberry Pi 2 B - [email protected] PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

simonrg
Posts: 1046
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version:
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Postby simonrg » Friday 02 May 2014 23:52

Strange, as you say for humidity this does not seem to work correctly as it does for energy meters.

I created a dummy humidity device 'DummyHumidity', then wrote a simple time test script - checking the web humidity display all seems to work fine, the humidity is change to 32% as set with 1 being it is comfortable, the last updated is always less than 1 minute ago as the time script is executed every minute and the devices pages shows the updated time.

However in the script I have 3 issues:
1. otherdevices_humidity['DummyHumidity'] returns nil, not the humidity value, what am I doing wrong?
2. otherdevices_svalues['DummyHumidity'] returns 50% always
3. otherdevices_lastupdate['DummyHumidity'] does not change and so is a time unrelated to that displayed on the web page.

Code: Select all

-- ~/domoticz/scripts/lua/device_time_humidity.lua
commandArray = {}

print('Humidity Script')
hum4 = otherdevices_svalues['DummyHumidity']
-- hum4 = otherdevices_humidity['DummyHumidity']
print('Humidity '..hum4)
print(otherdevices_lastupdate['DummyHumidity'])
commandArray[1] = {['UpdateDevice'] = 417 .. "|32|" .. 1}

return commandArray
Raspberry Pi 2 B - [email protected] PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

simonrg
Posts: 1046
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi
Domoticz version:
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Postby simonrg » Wednesday 07 May 2014 20:24

Without devicechanged_lastupdate ['devicename'], you can use a dummy switch which you switch on at the end of the script each time the script is called. Then before setting the switch you can use otherdevices_lastupdate ['dummy switch'] and so work out the time since the last switching. Have a look at http://www.domoticz.com/wiki/Capturing_ ... ua_Scripts where this concept is used to calculate energy used from power measurements.
Raspberry Pi 2 B - [email protected] PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266

panosnl
Posts: 8
Joined: Monday 10 March 2014 14:18
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Events system thread (questions and feedback)

Postby panosnl » Wednesday 25 June 2014 15:22

Hi I just discovered the event interface and it is great.

I seem to have discovered a bug though:

When a block is disbled it gets nicely greyed out. However this block is still executed.

So the only way to diable a block is to completerly remov it.

Running v 1.1811 on raspberry

User avatar
epierre
Posts: 726
Joined: Wednesday 05 March 2014 14:16
Target OS: Linux
Domoticz version:
Location: France
Contact:

Re: Events system thread (questions and feedback)

Postby epierre » Tuesday 22 July 2014 7:51

Hello,

I have a virtual sensor for Pressure (Pressure type, not the composite Weatherunderground).

Using either otherdevices_barometer[Barometer] or otherdevices[Barometer] does not brings anything, any idea ? data are in the nvalue column...
ImperiHome & MyDomoAtHome on top of:
868.42Mhz - Vera Lite - Fibaro SS-101, S-211, K-101, FWP - Fortress SSA2
433Mhz - Cubie Domoticz + RFXtrx + Oregon || Foscam 9821W
2,4Ghz - Cubie MySensors Gateway + COV + TempHumidity + Pressure + WaterMeter

leby
Posts: 172
Joined: Monday 28 July 2014 9:58
Target OS: Windows
Domoticz version: 3.6242
Location: Stockholm
Contact:

Re: Events system thread (questions and feedback)

Postby leby » Friday 15 August 2014 20:44

Not sure if I should post in this or in the variable part but the challenge is a mix..

To avoid duplicate messages being sent in a PIR scenario I tried to set up a variable instead of a switch to block new event from triggering for x minutes. I realise that it will work with a switch but the variable would be e neater solution.

I have done a simplified scenario to show my question:

blockly.PNG
blockly.PNG (9.26 KiB) Viewed 2395 times

Now I would expect when triggered by the test switch that the variable would first be set to "1" and after 2 minutes be set to "0". unfortunately the second do never happens, if it would work this would be a very handy tool.

var.PNG
var.PNG (1.72 KiB) Viewed 2395 times


Should this work or have I used the blocks incorrect?
/lennart

User avatar
CopyCatz
Developer
Posts: 751
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Events system thread (questions and feedback)

Postby CopyCatz » Friday 15 August 2014 21:35

that doesn't work.

leby
Posts: 172
Joined: Monday 28 July 2014 9:58
Target OS: Windows
Domoticz version: 3.6242
Location: Stockholm
Contact:

Re: Events system thread (questions and feedback)

Postby leby » Friday 15 August 2014 22:23

To bad, guess that I can't use a string variable either with On and Off as alternative, I'll use a dummy switch instead or a script
thx for the info anyhow
/lennart

User avatar
epierre
Posts: 726
Joined: Wednesday 05 March 2014 14:16
Target OS: Linux
Domoticz version:
Location: France
Contact:

Re: Events system thread (questions and feedback)

Postby epierre » Thursday 04 September 2014 21:39

Hello,

Is there a way to read the CO2 value ? otherdevices and _svalues does not report anything...

And more globally is it possible to have an otherdevices_nvalues[] in LUA so we could get all devices values with one or the other ?

thanks !
ImperiHome & MyDomoAtHome on top of:
868.42Mhz - Vera Lite - Fibaro SS-101, S-211, K-101, FWP - Fortress SSA2
433Mhz - Cubie Domoticz + RFXtrx + Oregon || Foscam 9821W
2,4Ghz - Cubie MySensors Gateway + COV + TempHumidity + Pressure + WaterMeter


Return to “Scripts [cleaning in progress]”

Who is online

Users browsing this forum: No registered users and 2 guests