# Enforce node to send zero value

**URL:** https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014
**Category:** General
**Created:** [19 November 2018 01:44 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014 "2018-11-19T01:44:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![manal](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@manal](https://discourse.nodered.org/u/manal)
#### Post date: [19 November 2018 01:44 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/1 "2018-11-19T01:44:54Z")

</div>

Hey there,

I use ds18b20 node in node-red to read sensor values directly, I want to write python code to enforce this node to send zero value instead of its real value. could you help me, please?

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [19 November 2018 02:07 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/2 "2018-11-19T02:07:46Z")

</div>

I assume this is on a Rpi ? Do you mean you want to ignore whatever value is coming in and then just send out a Zero instead - presumably sending it out on a MQTT topic ?

Not need to get python involved

Just use the change node

Craig

---

<div class="post-metadata">

### Author: ![manal](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@manal](https://discourse.nodered.org/u/manal)
#### Post date: [19 November 2018 02:12 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/3 "2018-11-19T02:12:18Z")

</div>

yes it is raspberry pi

I think python code is better, as I want this sensor send zero instead of its real value when I run python script, and when stop it then it return back to its normal situation ..

---

<div class="post-metadata">

### Author: ![manal](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@manal](https://discourse.nodered.org/u/manal)
#### Post date: [19 November 2018 05:31 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/4 "2018-11-19T05:31:14Z")

</div>

I don't like to change it through node-red by itself, I need to write python script and change it , so the node-red read the new value  
can I change the value "t" in w1\_Slave? writing python code to set it zero each time, so node-red node reads this new values from w1\_Slave, or may this is not applicable and it doesn't work.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [19 November 2018 07:12 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/5 "2018-11-19T07:12:05Z")

</div>

What is w1\_slave? Is that a variable in some code somewhere or what?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [19 November 2018 07:16 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/6 "2018-11-19T07:16:34Z")

</div>

> [@manal](#):
>
> I don't like to change it through node-red by itself, I need to write python script and change it

This is not entirely a Node-RED question is it. You can do this purely in Node-RED and even have a switch that lets you turn on/off the zero flow if you wish.

---

<div class="post-metadata">

### Author: ![manal](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@manal](https://discourse.nodered.org/u/manal)
#### Post date: [19 November 2018 07:29 UTC](https://discourse.nodered.org/t/enforce-node-to-send-zero-value/5014/7 "2018-11-19T07:29:17Z")

</div>

ok. thanks. it is really not pure node-red question. I am sorry for that I will delete it
