Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Tellstick Duo - how to use temperatures?

Questions and comments specific to a particular plugin should go here.
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Tellstick Duo - how to use temperatures?

Post by LoA »

Does anybody use temperatures from Tellstick Duo in EG to for example control radiators etc? I get the temprature readings in the log and I would like condition an event based on time, day of week and temperature. For example:

When the time is 4 am on a work day and the temperature from one of my sensors are below xx degrees I would like to star a certain event. If the temperature is higher I┬┤d like to trigger an other event.

I don┬┤t have a clue as how to start and I don┬┤t know any Python (I┬┤m not afraid of it though). Any tips?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

The temperature & humidity sensor support in Tellstick Duo is rather "experimental" at the moment and it doesn't support the major important sensor types. Not saying you can't do something with what you have.

The principle is that you take an event from the sensor and then drag it to a macro. The macro will execute when the event happens next time.

But how does the event from your sensor look like? Maybe we can fix it so that it fits better. I only have Oregon sensors that currently not supported.

What distance are you able to cover with your Duo and the temp sensors?

Best regards, Walter
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

Thank you for responding Walter.

I haven┬┤t experimented to much with distances but as far as I can tell I get about the same receiving distances as I get transmitting distance with the Tellstick /Tellstick Duo. I have the Clas Ohlson temp sensor since it┬┤s the only supported one at the moment and I get it to give me a result in the log in EG like "TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:23.0;Duo_ID:3".

This would be a useful input if I needed something to be done if the temerature was EXACTLY 23 degrees but of course I want something more sophisticated than that. I use EG today with the Android app and I┬┤m aware of the way of using events to trigger macros.

I have a couple of Oregon sensors as well and I hope the will be supported soon, but right now I would like to get EG working with the temperature in combination with time and week day to be able control heating... that would really be useful to me.

Best regards

LoA
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

@ LoA

I do not have that type of sensor myself. Can you try the attached version and see if you get the data printed in the eg log and the events? It is still experimental so I expect that things might not work yet...
__init__.py
Exerimental with sensor data callbacks....
(21.75 KiB) Downloaded 307 times
To use the events in a macro with a python script you could for instance create a macro and put a python script inside like the example below. Then you can trigger the macro with corresponding event. I kept the id of the sensor in the event suffix so that you easily can define separate macros for each heater/room.

Code: Select all

m = [0.0]
n = [0.0]

m = eg.event.suffix.split('.')
n = eg.event.payload.split('|')

if float(n[0])>23.0:
    print "Do something like turn off heating"
    eg.TriggerEvent("Do something like turn off heating")
    
if float(n[0])<20.0:
    print "Do something like turn on heating"
    eg.TriggerEvent("Do something like turn on heating")
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

@krambriw

This is really exiting. I put your attached script in a folder named "Temp" in the plugin-folder and started EG. What happens ist that a lot of information start appearing in the log even though i have checked the box to only show assigned events. Fron the specific sensor that I┬┤d like to use i get the following:


Information:

11:11:00 oregon
11:11:00 EA4C
11:11:00 239
11:11:00 1
11:11:00 20.0
11:11:00 1318842660
11:11:00 4
11:11:00 Sensor: oregon EA4C id: 239
11:11:00 Temperature: 20.0 C, 2011-10-17 11:11:00


Errors:

11:11:00 Traceback (most recent call last) (1540):
11:11:00 File "_ctypes/callbacks.c", line 295, in 'calling callback function'
11:11:00 File "C:\Program Files\EventGhost\plugins\Temp\__init__.py", line 295, in sensorEventCallback
11:11:00 +str(dataType),
11:11:00 NameError: global name 'deviceId' is not defined


I can┬┤t make anything out of this but maybe you can?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

Perfect,

Try this version now
__init__.py
(21.75 KiB) Downloaded 313 times
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

Ok, now I get the following:

CO sensor:

13:10:36 Temperature: 21.5 C, 2011-10-17 13:10:36
13:10:36 Temperature: 21.5 C, 2011-10-17 13:10:36


Unknown devices:

13:10:05 Temperature: -20.4 C, Humidity: 255 2011-10-17 13:10:05%, 2011-10-17 13:10:05
13:10:05 Temperature: -20.4 C,Humidity: 255 2011-10-17 13:10:05
13:10:05 %, 2011-10-17 13:10:05
13:10:05 Temperature: -20.4 C,Humidity: 255 2011-10-17 13:10:05
13:10:05 %, 2011-10-17 13:10:05
13:10:06 Temperature: -20.4 C, 2011-10-17 13:10:06Humidity: 255
13:10:06 %, 2011-10-17 13:10:06


The Clas Ohlson-sensor makes absolute sense but reports twice everytime. I still get strange info from unknown devices, this might be from one or more of my Oregon sensors lacking support with Tellstick Duo at the moment.

EG stops responding when I try to add a macro while having the Temp-script in the plugin-folder. When I remove the script there┬┤s no problem... it┬┤makes it hard to explore the macro part ;-)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

EG stops responding when I try to add a macro while having the Temp-script in the plugin-folder. When I remove the script there┬┤s no problem... it┬┤makes it hard to explore the macro part
You shall not copy the script manually to the plugin-folder!!!!

Okay, so far so good.

Try this:

1) add a new macro
2) select "EventGhost". "Python Script"
3) copy & paste the script example I posted
4) save

You say this does not work?

Next step

1) uncheck the check box so that ALL events are shown
2) wait until your sensor sends a signal and you should see this event in the log
3) drag this event to your newly defined macro

Next time the event happens, your script should be executed. If temperature is >23 or <20 a new event should be seen in the log.

The strange readings must be coming the Duo picking up signal from other devices or normal signals that have been distorted.

Best regards, Walter
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

How am I supposed to add the plugin if not manually adding it?

I┬┤dont get how to add the event in the macro. Theres no result when I add the python-script and if i drag the temp-event from the log it will only activate when the temperature exactly corresponds to what it was when I dragged it from the log?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

The plugin yes, thats correct , you have to copy it manually. But you started to mention the script!?

Lets try again.

Paste here the copy of the event you get now. And not the raw event, it is not used in the macro, there should be a new event for the sensor event. Do you receive that? Have you checked the box in the settings for the plugin "Check to log device events" ?

It should (I hope) definitly have the temperature in the payload so therefore it would not be for a specific temperature. In the script, we are filtering out the actual temperature and evaluating the level.

Give it a go and try to drag the new event from the log to macro folder on the right side and tell me what is happening

Best regards, Walter
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

Ahh, I meant the plugin so that means I┬┤ve done it right so far :-)

I have checked the box for the Tellstick Duo plugin ("Check to log device events").

This is what one temperature reading looks lite now if I uncheck to view all events, otherwise I only get the two similar info-rows.

(info) 16:10:39 Temperature: 22.1 C, 2011-10-17 16:10:39
(event) 16:10:39 Temperature: 22.1 C,TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:22.1;Duo_ID:3
(event) 16:10:39 TellStickDuo.oregon.EA4C.239.1 '22.1|2011-10-17 16:10:39'
(info) 16:10:39 Temperature: 22.1 C, 2011-10-17 16:10:39
(event) 16:10:39 Temperature: 22.1 C, TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:22.1;Duo_ID:3
(event) 16:10:39 TellStickDuo.oregon.EA4C.239.1 '22.1|2011-10-17 16:10:39'

Without the plugin it looks like this:

(event) 16:19:06 TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:22.0;Duo_ID:3
(event) 16:19:06 TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:22.0;Duo_ID:3

For some reason I get the readings twice but thats not because of this plugin. Anyway I clearly get a new event that i can drag to my macro, the it stops showing up in the log and in the macro it looks like this:

TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:22.0;Duo_ID:3

Below this i put the python script and now the result is:

(info) 16:33:24 Temperature: 22.0 C, 2011-10-17 16:33:24
(event) 16:33:24 TellStickDuo.RawEvent: class:sensor;protocol:oregon;model:EA4C;id:0xEF;temp:22.0;Duo_ID:3
(macro) 16:33:24 Python-skript
(action) 16:33:24 Python-skript
(error) 16:33:24 Traceback (most recent call last):
(error) 16:33:24 Python script "1", line 5, in <module>
(error) 16:33:24 n = eg.event.payload.split('|')
(error) 16:33:24 AttributeError: 'NoneType' object has no attribute 'split'

Thank you for responding and putting up with my limited knowledge of Eventghost! :-)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

I think you have dragged the wrong event to the macro folder. You must take the one that looks like this:

Code: Select all

(event) 16:10:39 TellStickDuo.oregon.EA4C.239.1 '22.1|2011-10-17 16:10:39'
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

I dragged the other one instead and now it works :-)

I get the respective text message about turning on/off the heating. How do I replace the text with an action? As the script is written now it will send the command everytime a temperature value is recognized, right? For my IR controlled heater it means that it will get that instruction every 30 seconds and make a loud beep (the heaters confirmation sound) every time. If so, is there a way to change this so it only turns on/off once for every time it breaks a temperature barrier?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Tellstick Duo - how to use temperatures?

Post by krambriw »

Yes, with the power of EventGhost and python, everything is of course possible. You now have made events coming out from the Duo for your temp sensors which was the original problem.
How do I replace the text with an action
Well, the simple script is currently not solving everything for you, it demonstrates the principals by making new events when you are outside specific temperature levels. Those events can in turn be used to trigger another macro (just drag it there) where you also put an action. But as you say, if your equipment beeps like that, you need a bit more sophisticated script. Or to disable the buzzer....

Try to study and fully understand what we have done so far and how you could use the new events that the script is creating, then when you feel fully comfortable, we can continue to the next level.

Building a better script in python with a status memory, time & date control etc would be the next exercise to accomplish to handle your specific heaters and your work days specifics.

Best regards, Walter
LoA
Posts: 24
Joined: Wed Sep 28, 2011 7:48 am

Re: Tellstick Duo - how to use temperatures?

Post by LoA »

I got it working with eg.TriggerEvent now and that is a huge help, thanks a lot!

I will actually attend a Python course next week (with a slight diffrent focus though), after that I will try to see if I can make an intelligent system using both time and week day aswell as temperatures (maybe even more than one temp, like a combination of inside and outside temp).

Best regards
LoA
Post Reply