# How to subscribe bus

**URL:** https://discuss.tryton.org/t/how-to-subscribe-bus/6414
**Category:** Developer
**Created:** [August 5, 2023, 10:11am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414 "2023-08-05T10:11:53Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [August 5, 2023, 10:11am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/1 "2023-08-05T10:11:53Z")

</div>

Hi,

I would like to send the message to bus to trigger action.  
Example: post to bus using channel Reminder.  
From the message to filter and select action.

But may i know where in trytond to put the subscribe for the channel?

Please advice

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 5, 2023, 10:16am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/2 "2023-08-05T10:16:36Z")

</div>

> [@bala4901](#):
>
> I would like to send the message to bus to trigger action.

What message?  
Which action?

> [@bala4901](#):
>
> From the message to filter and select action.

Filter what?

---

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [August 5, 2023, 10:33am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/3 "2023-08-05T10:33:39Z")

</div>

Recently, I am doing a project to read the value from temperature sensor.

I would like to send a bus message to trytond.

```auto
{'channel': 'temperature',
'message': {'sensor': 'temp001', 'temp': 40}
}

```

So from trytond which i would to subscribe bus with channel ‘temperature’ and record to database. But when the temperature is more than 50 then may send the alert to control room.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 5, 2023, 10:47am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/4 "2023-08-05T10:47:47Z")

</div>

> [@bala4901](#):
>
> I would like to send a bus message to trytond.

`trytond` does not receive bus message.

> [@bala4901](#):
>
> But when the temperature is more than 50 then may send the alert to control room.

What protocol does the control room support?

---

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [August 5, 2023, 10:55am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/5 "2023-08-05T10:55:29Z")

</div>

> **[Bus — Tryton server](https://docs.tryton.org/latest/server/ref/bus.html)**

I saw the document trytond listen to the bus message by Post.

Currently I am using ROS2 as the controller and intend using trytond as the logic/business control. Send to control room using webservice

Best regards

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 5, 2023, 11:18am UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/6 "2023-08-05T11:18:29Z")

</div>

> [@bala4901](#):
>
> [Bus — Tryton server](https://docs.tryton.org/projects/server/en/latest/ref/bus.html)
> 
> I saw the document trytond listen to the bus message by Post.

This is for long polling request.

But I do not see why you would like to use the notification bus (which is for the clients).  
You just have to POST the data using the JSON-RPC request or a [custom entrypoint](https://docs.tryton.org/projects/server/en/latest/topics/user_application.html#user-application).

---

<div class="post-metadata">

### Author: ![bala4901](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@bala4901](https://discuss.tryton.org/u/bala4901)
#### Post date: [August 5, 2023, 12:42pm UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/7 "2023-08-05T12:42:41Z")

</div>

Oh, because I think Bus can use at the server side. Then, if so, i can use it.

Thank you for explanation

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [September 4, 2023, 12:43pm UTC](https://discuss.tryton.org/t/how-to-subscribe-bus/6414/8 "2023-09-04T12:43:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
