Events system thread (questions and feedback)

Moderator: leecollings

Tom23
Posts: 1
Joined: Tuesday 28 January 2014 16:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Events system feedback thread

Post by Tom23 »

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: 23
Joined: Sunday 14 July 2013 10:31
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands

Re: Events system feedback thread

Post by Yihaaa »

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 12562 times
Last edited by Yihaaa on Tuesday 11 February 2014 21:57, edited 1 time in total.
User avatar
CopyCatz
Developer
Posts: 123
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Events system feedback thread

Post by CopyCatz »

You can only do on for x minutes. How on earth is the system going to make sense of "sunrise minutes"?
Yihaaa
Posts: 23
Joined: Sunday 14 July 2013 10:31
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Netherlands

Re: Events system feedback thread

Post by Yihaaa »

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: 27
Joined: Tuesday 11 February 2014 21:44
Target OS: Linux
Domoticz version:
Contact:

Re: Events system feedback thread

Post by CodeItAway »

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 12549 times
I also tried setting the value in a LUA script, but that isn't working either (with no errors).
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Blocky problem

Post by ace2 »

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

Re: Blocky problem

Post by SweetPants »

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: 194
Joined: Friday 12 July 2013 14:08
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: the Netherlands
Contact:

Re: Blocky problem

Post by mbliek »

It's not a problem. Just a question about how to do. Merged with the events feedback thread.
ace2
Posts: 10
Joined: Sunday 02 February 2014 13:34
Target OS: Linux
Domoticz version:
Contact:

Re: Events system thread (questions and feedback)

Post by ace2 »

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 0:54
Target OS: Linux
Domoticz version:
Contact:

Re: Events system thread (questions and feedback)

Post by gabou14 »

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: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Post by simonrg »

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_ ... ua_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 - 2A@5V 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: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Post by simonrg »

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 - 2A@5V 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: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Post by simonrg »

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 - 2A@5V 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: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Events system thread (questions and feedback)

Post by simonrg »

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 - 2A@5V 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: 1
Joined: Monday 10 March 2014 13:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Events system thread (questions and feedback)

Post by panosnl »

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: 522
Joined: Wednesday 05 March 2014 13:16
Target OS: Linux
Domoticz version:
Location: France
Contact:

Re: Events system thread (questions and feedback)

Post by epierre »

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: 98
Joined: Monday 28 July 2014 9:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Stockholm
Contact:

Re: Events system thread (questions and feedback)

Post by leby »

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 12324 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 12324 times
Should this work or have I used the blocks incorrect?
/lennart
User avatar
CopyCatz
Developer
Posts: 123
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Events system thread (questions and feedback)

Post by CopyCatz »

that doesn't work.
leby
Posts: 98
Joined: Monday 28 July 2014 9:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Stockholm
Contact:

Re: Events system thread (questions and feedback)

Post by leby »

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: 522
Joined: Wednesday 05 March 2014 13:16
Target OS: Linux
Domoticz version:
Location: France
Contact:

Re: Events system thread (questions and feedback)

Post by epierre »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests