Sensors to live in Automagically

http://automagucally.weebly.com

Moderators: davka003, Telldus

Post Reply
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Sensors to live in Automagically

Post by KHolm »

EDIT4: Fixed issues from yesterday and issued a new pull request

Hi,

Just sent a pull request to David that enables to send sensor events, like temperature, to Live. It's not as straight forward as the rest of the system as it only works with Signal Transforms. More informations is available in the actual request:
https://bitbucket.org/davka003/automagi ... t-added-to
The failed pull from yesterday has now been completed. Sensors works in two steps. First a SensorReport and then SensorEvents.
To use: Send once: sensor_report,SD99:Test:oregon:EA4C:temp:0 Send to update value: sensor_event,SD99:oregon:EA4C:temp:5
Typically, add a signal transform to use sensor_events. But before that, make sure to send in a sensor_report with the same Id.
SensorReport sensor_report,SD[ID]:[NAME]:[PROTOCOL]:[MODEL]:[MEAS_TYPE]:[VALUE]
SensorEvent: sensor_event,SD[ID]:[PROTOCOL]:[MODEL]:[MEAS_TYPE]:[VALUE]
Start looking at your signal trace, should look something like this:

Code: Select all

2014-01-25 19:46:08.126833	tellstick	tellstick,raw:class:sensor;protocol:oregon;model:EA4C;id:66;temp:-5.0; 	
2014-01-25 19:46:08.135369	tellstick	tellstick,sensor,protocol:oregon,id:66,Temperature,value:-5.0 
Take note of the id and send in the following signal - changing 66 to whatever id you had in your trace and Ute to whatever name you want to have:

Code: Select all

sensor_report,SD66:Ute:oregon:EA4C:temp:-5.0
Now, go to Telldus Live and make sure that a sensor called Ute has appeared.

Then, add a signal transform by clicking the "tellstick,sensor,protocol:oregon,id:66,Temperature,value:-5.0" link.

Pattern to match (change to your id):

Code: Select all

tellstick,sensor,protocol:oregon,id:66,Temperature,value:%f
Send the following signal(s) on match:

Code: Select all

sensor_event,SD66:oregon:EA4C:temp:$1
Now you should be receiving updated values of your temperature to Telldus Live - take note of the Last Updated column on live and see it ticking.

I have only tested "temp", but the following signals should also work - no guarantee.

Code: Select all

Oregon 1A2D
sensor_event,SD45:Skogen:oregon:1A2D:temp:-10:humidity:20

Oregon 2914"
sensor_event,SD46:Utomhus:oregon:2914:rainrate:2:raintotal:10

Oregon 1984
sensor_event,SD47:Havet:oregon:1984:winddirection:NE:windaverage:6:windgust:10

Oregon C844
sensor_event,SD48:Skogen:oregon:C844:temp:30

Oregon F824
sensor_event,SD49:Tradet:oregon:F824:temp:0:humidity:65

Mandolyn
sensor_event,SD40:Stenen:mandolyn:temperaturehumidity:temp:12:humidity:20

Fineoffset Temperature and Humidity
sensor_event,SD40:Stubben:fineoffset:temperaturehumidity:temp:-12:humidity:15

Fineoffset Temperature
sensor_event,SD40:Akvariet:fineoffset:temperature:temp:22
/Marcus
misterleffe
Posts: 57
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by misterleffe »

I try to follow your guide, but no success ... In the "Signal trace", I put this: "sensor_report,SD66:Ute:oregon:EA4C:temp:-5.0" I use this line from your post, because I think this works for you?
Then I go to Telldus Live, wait some minutes and reload the page, but I can't see anything at the "sensor-page" in Telldus Live.

Am I doing anything in the wrong way?

I really don't need this feature, because I made a DNS for my Pi, so I can use the remote from the Internet. But it's nice to have redundance and if it's possible so why not?


/misterleffe
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by KHolm »

Before you can use this you need to secure that you have the latest version, noticed David merged my pull request just the other day. So, make sure to update your system before trying the above.

Had to rollback from a backup so I'll test the instruction again in the weekend.
misterleffe
Posts: 57
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by misterleffe »

Ok, I think I'll have the latest software. I was recommended from Telldus to download this, TelldusCenter-2.1.2_beta10, for my Telldus Duo. Telldus told me that the beta was tested, so it shouldn't be any probs to use that firmware. But I can see at the hompage, that the latest firmware is 2.1.1. Should it work with my beta firmware? I think, my firmare is newer than the "official"?

What firmware version, are you using?


/misterleffe
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by KHolm »

misterleffe wrote:Ok, I think I'll have the latest software. I was recommended from Telldus to download this, TelldusCenter-2.1.2_beta10, for my Telldus Duo. Telldus told me that the beta was tested, so it shouldn't be any probs to use that firmware. But I can see at the hompage, that the latest firmware is 2.1.1. Should it work with my beta firmware? I think, my firmware is newer than the "official"?
What firmware version, are you using?
/misterleffe
I'm on the same firmware as you, but in all honesty I was referring to Automagically. If you havn't updated you system since the latest merge (28/1), then you need to update. This can be done both on the admin interface (http://192.168.XXX.XXX/update/do/) and via command line.

I personally prefer doing it from the command line:

Code: Select all

$ cd ~/source/automagically/
$ sudo ./update.sh
$ sudo shutdown -r now
When your system is back again, you should access to SensorReport and SensorEvent.

/Marcus
misterleffe
Posts: 57
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by misterleffe »

Ok, I made an update in Automagically and after that I can send and see, in Telldus Live this line: "sensor_report,SD66:Ute:oregon:EA4C:temp:-5.0" This is the line that you have as an example. So far so good ...

But I'm using the Mandolyn protocol and if I try anoteher line that you have as an example: "sensor_event,SD40:Stenen:mandolyn:temperaturehumidity:temp:12:humidity:20" This will not come up in Telldus Live. But as you say in your post, "I have only tested "temp", but the following signals should also work - no guarantee ..."

Should there be another formatting of the line if I'm using the Mandolyn protocol? Is there a solution for the Mandolyn protocol?



/misterleffe
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by KHolm »

misterleffe wrote:Ok, I made an update in Automagically and after that I can send and see, in Telldus Live this line: "sensor_report,SD66:Ute:oregon:EA4C:temp:-5.0" This is the line that you have as an example. So far so good ...

But I'm using the Mandolyn protocol and if I try anoteher line that you have as an example: "sensor_event,SD40:Stenen:mandolyn:temperaturehumidity:temp:12:humidity:20" This will not come up in Telldus Live. But as you say in your post, "I have only tested "temp", but the following signals should also work - no guarantee ..."

Should there be another formatting of the line if I'm using the Mandolyn protocol? Is there a solution for the Mandolyn protocol?
/misterleffe
I made a test and something strange happens when I register a sensor with both temp and humidity. I get 3 instances of the same sensor in Live, and none of them takes an update.
So, something is wrong - so for now I can only help you to get temp updated.

A good thing with using signals is that we can transform them as we wish :-)

In order to help properly, I need to get your signal - but let's assume you see the following:

Code: Select all

tellstick,sensor,protocol:mandolyn,id:99,Temperature,value:1.9,Humidity,value:10
Note: The 99 is something else, and I have only guessed the ",Humidity,value:10" part.

#1 - Register the new device (replace "99" and "Taket":

Code: Select all

sensor_report,SD99:Taket:oregon:EA4C:temp:-5.0
Transform this into e.g an oregon device using a signal transform:

Code: Select all

Pattern to match:   tellstick,sensor,protocol:mandolyn,id:99,Temperature,value:%f,Humidity,value:%f
Send the following: sensor_event,SD99:oregon:EA4C:temp:$1
This will at least update the temperature for your Mandolyn. Meanwhile I'll try to understand what's wrong with the code...

Send your signal trace where I can see what comes for this device; will help me help you...

/Marcus
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by KHolm »

KHolm wrote:So, something is wrong
Indeed something was wrong; both SensorReport and SensorEvent could only handle one value per update (e.g. temp) and failed miserably when trying to send multiple at the same time (e.g. temp and humidity).

This is now fixed. A pull request as been created for the bug. For those who cannot wait, attached a patch that can be used. Unzip and copy to your pi. These are the commands to apply the patch.

Code: Select all

$ cp tellduslive.patch ~/source/automagically/site/plugins/.
$ sudo /etc/init.d/automagically stop
$ cd source/automagically/site/plugins/
$ sudo patch tellduslive.py -R -i tellduslive.patch
$ sudo rm tellduslive.pyc
$ sudo rm tellduslive.patch
$ sudo /etc/init.d/automagically start
Note: The patch shall only be applied of a recent update has been removed. To undo the patch:

Code: Select all

$ sudo /etc/init.d/automagically stop
$ cd source/automagically/site/plugins/
$ git checkout -- tellduslive.py
$ sudo rm tellduslive.pyc
$ sudo /etc/init.d/automagically start
The following signals now works ok:

Code: Select all

sensor_report,SD10:Stenen:mandolyn:temperaturehumidity:temp:10:humidity:20
sensor_event,SD10:mandolyn:temperaturehumidity:temp:25:humidity:15
Sorry for the inconvenience,
/Marcus
Attachments
tellduslive.zip
Patch for annoying bug...
(265 Bytes) Downloaded 377 times
misterleffe
Posts: 57
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by misterleffe »

Ok and thanks for your help! You asked for the signal trace and in fact it's 3 signals coming into the tellstick. Here they are:

tellstick tellstick,raw:class:sensor;protocol:mandolyn;id:21;model:temperaturehumidity;temp:21.2;humidity:106;
tellstick tellstick,sensor,protocol:mandolyn,id:21,Temperature,value:21.2
tellstick tellstick,sensor,protocol:mandolyn,id:21,Humidity,value:106

Will this help you or do you already found the solution?
Maybe this patch will be included in the next update of Automagically?



/misterleffe
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by KHolm »

misterleffe wrote: Will this help you or do you already found the solution?
Maybe this patch will be included in the next update of Automagically?
This absolutely help, though I notice that how Mandolyn is implemented in Automagic requires us to Transform from the raw device.

With these signals, to make temp work on the current version - start by sending in this signal to register the sensor:

Code: Select all

sensor_report,SD21:Garaget:oregon:EA4C:temp:10
Then add this signal transform:

Code: Select all

Pattern to match:   tellstick,sensor,protocol:mandolyn,id:21,Temperature,value:%f
Send the following: sensor_event,SD21:oregon:EA4C:temp:$1
When the patch has been applied, you need to:
Send in the following signal:

Code: Select all

sensor_report,SD21:Garaget:mandolyn:temperaturehumidity:temp:10:humidity:100
Change the signal transform to:

Code: Select all

Pattern to match:   tellstick tellstick,raw:class:sensor;protocol:mandolyn;id:21;model:temperaturehumidity;temp:%f;humidity:%f; 
Send the following: sensor_event,SD21:mandolyn:temperaturehumidity:temp:$1:humidity:$2
In a post above I have just explained that the problem is solved and a patch available. When David takes in my pull request is up to him. Until then you can always patch the system yourself. See http://www.telldus.com/forum/viewtopic. ... 145#p24546

Good luck and thanks for the signal trace.

/Marcus
jimmy927
Posts: 27
Joined: Fri Mar 17, 2023 9:45 am
Location: Stockholm
Contact:

Re: Sensors to live in Automagically

Post by jimmy927 »

To enable the Telldus Live plugin i need a UUID and a Activation URL. I dont understand where i can retrieve this information, i have only username and password for telldus live.

Where do i get this info ? Do i have to register a additional account somehow ?
KHolm
Posts: 163
Joined: Fri Mar 17, 2023 9:45 am

Re: Sensors to live in Automagically

Post by KHolm »

jimmy927 wrote:To enable the Telldus Live plugin i need a UUID and a Activation URL. I dont understand where i can retrieve this information, i have only username and password for telldus live.

Where do i get this info ? Do i have to register a additional account somehow ?
The method to enable Telldus Live is described here (ignore the update part)
http://automagically.weebly.com/1/post/ ... slive.html

Feel free to update the Wiki with a better instruction when you're done.
http://automagically.wikia.com/wiki/Con ... &redlink=1

/Marcus
Post Reply